Ignore:
Timestamp:
Oct 10, 2012, 6:22:23 PM (11 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Large changes to prepare full XT-CF support (DMA not yet implemented and memory mapped transfers are not working).
File:
1 edited

Legend:

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

    r441 r473  
    150150;       None
    151151;   Corrupts registers:
    152 ;       AX, BX, CX, DX, SI, DI
     152;       AX, BL, CX, DX, SI, DI
    153153;--------------------------------------------------------------------
    154154StartDetectionWithDriveSelectByteInBHandStringInCX:
     
    157157    call    HotkeyBar_UpdateDuringDriveDetection
    158158%endif
     159    ; Fall to .AutodetectXTCFport or .ReadAtaInfoFromHardDisk
     160
     161
     162%ifdef MODULE_8BIT_IDE
     163;--------------------------------------------------------------------
     164; .AutodetectXTCFport
     165;   Parameters:
     166;       BH:     Drive Select byte for Drive and Head Register
     167;       CS:BP:  Ptr to IDEVARS for the drive
     168;       DS:     RAMVARS segment
     169;       ES:     Zero (BDA segment)
     170;   Returns:
     171;       DX:     Autodetected port (for devices that support autodetection)
     172;   Corrupts registers:
     173;       AX
     174;--------------------------------------------------------------------
     175.AutodetectXTCFport:
     176    ; Detect port for XTCF
     177    call    DetectDrives_DoesIdevarsInCSBPbelongToXTCF
     178    jne     SHORT .SkipXTCFportDetection
     179
     180    ; XT-CF do not support slave drives so we can safely update port
     181    ; for next drive (another XT-CF card on same system)
     182.DetectNextPort:
     183    call    BootVars_GetNextXTCFportToDetectToDX
     184    cmp     dx, XTCF_BASE_PORT_4
     185    ja      SHORT DetectDrives_DriveNotFound    ; XT-CF not found from any port
     186
     187    call    AH1Eh_DetectXTCFwithBasePortInDX
     188    jc      SHORT .DetectNextPort               ; XT-CF not found from this port
     189.SkipXTCFportDetection:
    159190    ; Fall to .ReadAtaInfoFromHardDisk
     191%endif ; MODULE_8BIT_IDE
     192
    160193
    161194;--------------------------------------------------------------------
     
    163196;   Parameters:
    164197;       BH:     Drive Select byte for Drive and Head Register
     198;       DX:     Autodetected port (for devices that support autodetection)
    165199;       CS:BP:  Ptr to IDEVARS for the drive
    166200;       DS:     RAMVARS segment
     
    176210    push    es
    177211    push    si
     212    push    dx
    178213    push    bx
    179214    call    Device_IdentifyToBufferInESSIwithDriveSelectByteInBH
    180215    pop     bx
     216    pop     dx
    181217    pop     si
    182218    pop     es
     
    208244;   Parameters:
    209245;       BH:     Drive Select byte for Drive and Head Register
     246;       DX:     Autodetected port (for devices that support autodetection)
    210247;       CS:BP:  Ptr to IDEVARS for the drive
    211248;       ES:SI   Ptr to ATA information for the drive
     
    226263    call    DriveDetectInfo_CreateForHardDisk
    227264    jmp     SHORT DetectPrint_DriveNameFromDrvDetectInfoInESBX
     265
     266
     267%ifdef MODULE_8BIT_IDE
     268;--------------------------------------------------------------------
     269; DetectDrives_DoesIdevarsInCSBPbelongToXTCF
     270;   Parameters:
     271;       CS:BP:  Ptr to IDEVARS for the drive
     272;   Returns:
     273;       ZF:     Set if IDEVARS belongs to XT-CF device
     274;               Cleared if some other device
     275;   Corrupts registers:
     276;       AL
     277;--------------------------------------------------------------------
     278DetectDrives_DoesIdevarsInCSBPbelongToXTCF:
     279    mov     al, [cs:bp+IDEVARS.bDevice]
     280    cmp     al, DEVICE_8BIT_XTCF_PIO8
     281    je      SHORT .DeviceIsXTCF
     282    cmp     al, DEVICE_8BIT_XTCF_DMA
     283    je      SHORT .DeviceIsXTCF
     284    cmp     al, DEVICE_8BIT_XTCF_MEMMAP
     285.DeviceIsXTCF:
     286    ret
     287%endif ; MODULE_8BIT_IDE
Note: See TracChangeset for help on using the changeset viewer.