Changeset 363 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Initialization


Ignore:
Timestamp:
Mar 26, 2012, 4:20:43 PM (13 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Added Advanced ATA Module (MODULE_ADVANCED_ATA) with native support for QDI Vision QD6500 and QD6580 VLB IDE Controllers.
  • Hopefully optimized IDE transfer functions for 8088 (replaced some memory accesses from WORD to BYTE).
  • XT build does not fit in 8k at the moment!!!
Location:
trunk/XTIDE_Universal_BIOS/Src/Initialization
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm

    r324 r363  
    7272    mul     WORD [di+ATA1.wCylCnt]  ; DX:AX=Sectors per track * number of heads * number of cylinders
    7373    ret
     74
     75
     76%ifdef MODULE_ADVANCED_ATA
     77;--------------------------------------------------------------------
     78; AtaID_GetMaxPioModeToAXandMinCycleTimeToDX
     79;   Parameters:
     80;       ES:SI:  Ptr to 512-byte ATA information read from the drive
     81;   Returns:
     82;       AX:     Max supported PIO mode
     83;       DX:     Minimum Cycle Time in nanosecs
     84;   Corrupts registers:
     85;       BX
     86;--------------------------------------------------------------------
     87AtaID_GetMaxPioModeToAXandMinCycleTimeToDX:
     88    ; Get PIO mode and cycle time for PIO 0...2
     89    mov     bx, [es:si+ATA1.bPioMode]
     90    shl     bx, 1                   ; Shift for WORD lookup
     91    mov     dx, [cs:bx+.rgwPio0to2CycleTimeInNanosecs]
     92    shr     bx, 1
     93    xchg    ax, bx                  ; AL = PIO mode 0, 1 or 2
     94
     95    ; Check if Advanced PIO modes are supported (3 and above)
     96    test    BYTE [es:si+ATA2.wFields], A2_wFields_64to70
     97    jz      SHORT .ReturnPioTimings
     98
     99    ; Get Advanced PIO mode
     100    ; (Hard Disks supports up to 4 but CF cards might support 5)
     101    mov     bx, [es:si+ATA2.bPIOSupp]
     102.CheckNextFlag:
     103    inc     ax
     104    shr     bx, 1
     105    jnz     SHORT .CheckNextFlag
     106    mov     dx, [es:si+ATA2.wPIOMinCyF] ; Advanced modes use IORDY
     107.ReturnPioTimings:
     108    ret
     109
     110
     111.rgwPio0to2CycleTimeInNanosecs:
     112    dw      PIO_0_MIN_CYCLE_TIME_NS
     113    dw      PIO_1_MIN_CYCLE_TIME_NS
     114    dw      PIO_2_MIN_CYCLE_TIME_NS
     115
     116
     117;--------------------------------------------------------------------
     118; AtaID_ConvertPioModeFromAXandMinCycleTimeFromDXtoActiveAndRecoveryTime
     119;   Parameters:
     120;       AX:     Max supported PIO mode
     121;       DX:     Minimum PIO Cycle Time in nanosecs
     122;   Returns:
     123;       CX:     Minimum Active time in nanosecs
     124;       DX:     Minimum Recovery time in nanosecs
     125;   Corrupts registers:
     126;       BX
     127;--------------------------------------------------------------------
     128AtaID_ConvertPioModeFromAXandMinCycleTimeFromDXtoActiveAndRecoveryTime:
     129    ; Subtract Address Valid Time (t1) from Cycle Time (t0)
     130    mov     bx, ax
     131    eMOVZX  cx, BYTE [cs:bx+.rgbPioModeToAddressValidTimeNs]
     132    sub     dx, cx
     133
     134    ; Subtract Active Time (t2) from previous result to get Recovery Time (t2i)
     135    shl     bx, 1           ; Shift PIO Mode for WORD lookup
     136    mov     cx, [cs:bx+.rgwPioModeToActiveTimeNs]
     137    sub     dx, cx
     138    ret
     139
     140
     141.rgbPioModeToAddressValidTimeNs:
     142    db      PIO_0_MIN_ADDRESS_VALID_NS
     143    db      PIO_1_MIN_ADDRESS_VALID_NS
     144    db      PIO_2_MIN_ADDRESS_VALID_NS
     145    db      PIO_3_MIN_ADDRESS_VALID_NS
     146    db      PIO_4_MIN_ADDRESS_VALID_NS
     147
     148.rgwPioModeToActiveTimeNs:
     149    dw      PIO_0_MIN_ACTIVE_TIME_NS
     150    dw      PIO_1_MIN_ACTIVE_TIME_NS
     151    dw      PIO_2_MIN_ACTIVE_TIME_NS
     152    dw      PIO_3_MIN_ACTIVE_TIME_NS
     153    dw      PIO_4_MIN_ACTIVE_TIME_NS
     154
     155%endif ; MODULE_ADVANCED_ATA
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm

    r294 r363  
    204204    call    BootMenuInfo_CreateForHardDisk
    205205    jmp     short DetectPrint_DriveNameFromBootnfoInESBX
    206 
    207 
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm

    r271 r363  
    5353;--------------------------------------------------------------------
    5454Initialize_AndDetectDrives:
     55    mov     WORD [es:BOOTVARS.wMagicWord], BOOTVARS_MAGIC_WORD
    5556    call    BootMenuPrint_InitializeDisplayContext
    5657    call    DetectPrint_RomFoundAtSegment
     
    9899    call    AH0h_ResetAllOurHardDisksAtTheEndOfDriveInitialization
    99100    add     sp, BYTE EXTRA_BYTES_FOR_INTPACK
     101    mov     WORD [es:BOOTVARS.wMagicWord], 0
    100102    ret
Note: See TracChangeset for help on using the changeset viewer.