Changeset 473 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs


Ignore:
Timestamp:
Oct 10, 2012, 6:22:23 PM (12 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).
Location:
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm

    r443 r473  
    2020; Section containing code
    2121SECTION .text
    22 
    23 %ifdef MODULE_ADVANCED_ATA
    24 ;--------------------------------------------------------------------
    25 ; AccessDPT_GetIdeBasePortToBX
    26 ;   Parameters:
    27 ;       DS:DI:  Ptr to Disk Parameter Table
    28 ;   Returns:
    29 ;       BX:     IDE Base Port Address
    30 ;   Corrupts registers:
    31 ;       Nothing
    32 ;--------------------------------------------------------------------
    33 ALIGN JUMP_ALIGN
    34 AccessDPT_GetIdeBasePortToBX:
    35     eMOVZX  bx, [di+DPT.bIdevarsOffset]         ; CS:BX points to IDEVARS
    36     mov     bx, [cs:bx+IDEVARS.wPort]
    37     ret
    38 %endif  ; MODULE_ADVANCED_ATA
    39 
    4022
    4123;--------------------------------------------------------------------
     
    11395
    11496
     97%ifdef MODULE_8BIT_IDE
     98;--------------------------------------------------------------------
     99; AccessDPT_IsThisDeviceXTCF
     100;   Parameters:
     101;       DS:DI:  Ptr to Disk Parameter Table
     102;   Returns:
     103;       AH:     Device Type
     104;       ZF:     Set if XTCF
     105;               Cleared if some other device
     106;   Corrupts registers:
     107;       Nothing
     108;--------------------------------------------------------------------
     109AccessDPT_IsThisDeviceXTCF:
     110    mov     ah, [di+DPT_ATA.bDevice]
     111    cmp     ah, DEVICE_8BIT_XTCF_PIO8
     112    je      SHORT .DeviceIsXTCF
     113    cmp     ah, DEVICE_8BIT_XTCF_DMA
     114    je      SHORT .DeviceIsXTCF
     115    cmp     ah, DEVICE_8BIT_XTCF_MEMMAP
     116.DeviceIsXTCF:
     117    ret
     118%endif ; MODULE_8BIT_IDE
     119
     120
    115121%ifdef MODULE_EBIOS
    116122;--------------------------------------------------------------------
     
    142148;       Nothing
    143149;--------------------------------------------------------------------
    144 ALIGN JUMP_ALIGN
    145150AccessDPT_GetPointerToDRVPARAMStoCSBX:
    146     eMOVZX  bx, BYTE [di+DPT.bIdevarsOffset]    ; CS:BX points to IDEVARS
     151    call    AccessDPT_GetIdevarsToCSBX
    147152    add     bx, BYTE IDEVARS.drvParamsMaster    ; CS:BX points to Master Drive DRVPARAMS
    148153    test    BYTE [di+DPT.bFlagsLow], FLGL_DPT_SLAVE
     
    150155    add     bx, BYTE DRVPARAMS_size             ; CS:BX points to Slave Drive DRVPARAMS
    151156.ReturnPointerToDRVPARAMS:
     157    ret
     158
     159
     160;--------------------------------------------------------------------
     161; Needed many times during initialization so it is better to
     162; make it as a function to save bytes.
     163;
     164; AccessDPT_GetIdevarsToCSBX
     165;   Parameters:
     166;       DS:DI:  Ptr to Disk Parameter Table
     167;   Returns:
     168;       CS:BX:  Ptr to IDEVARS for the drive
     169;   Corrupts registers:
     170;       Nothing
     171;--------------------------------------------------------------------
     172AccessDPT_GetIdevarsToCSBX:
     173    eMOVZX  bx, BYTE [di+DPT.bIdevarsOffset]
    152174    ret
    153175
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/BootVars.asm

    r397 r473  
    3232;--------------------------------------------------------------------
    3333BootVars_Initialize:
     34%ifdef MODULE_8BIT_IDE
     35    mov     WORD [es:BOOTVARS.wNextXTCFportToScan], XTCF_BASE_PORT_1
     36%endif
     37
    3438    ; Clear to zero
    3539    mov     al, DRVDETECTINFO_size
     
    6670
    6771%endif ; MODULE_HOTKEYS
     72
     73
     74%ifdef MODULE_8BIT_IDE
     75;--------------------------------------------------------------------
     76; BootVars_GetNextXTCFportToDetectToDX
     77;   Parameters:
     78;       ES:     BDA Segment
     79;   Returns:
     80;       DX:     Next XT-CF port to detect
     81;   Corrupts registers:
     82;       AX
     83;--------------------------------------------------------------------
     84BootVars_GetNextXTCFportToDetectToDX:
     85    mov     dx, [es:BOOTVARS.wNextXTCFportToScan]
     86    test    dl, dl
     87    jz      SHORT .NextOneIs240hor340h
     88    add     WORD [es:BOOTVARS.wNextXTCFportToScan], XTCF_BASE_PORT_3 - XTCF_BASE_PORT_2
     89    ret
     90.NextOneIs240hor340h:
     91    mov     BYTE [es:BOOTVARS.wNextXTCFportToScan], XTCF_BASE_PORT_2 & 0FFh ; 40h
     92    ret     
     93%endif ; MODULE_8BIT_IDE
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm

    r445 r473  
    2828;   Parameters:
    2929;       BH:     Drive Select byte for Drive and Head Register
     30;       DX:     Autodetected port (for devices that support autodetection)
    3031;       ES:SI:  Ptr to 512-byte ATA information read from the drive
    3132;       CS:BP:  Ptr to IDEVARS for the controller
     
    4748;   Parameters:
    4849;       BH:     Drive Select byte for Drive and Head Register
     50;       DX:     Autodetected port (for devices that support autodetection)
    4951;       DS:DI:  Ptr to Disk Parameter Table
    5052;       CS:BP:  Ptr to IDEVARS for the controller
     
    5557;--------------------------------------------------------------------
    5658.InitializeDPT:
    57     mov     [di+DPT.bIdevarsOffset], bp     ; IDEVARS must start in first 256 bytes of ROM
     59    call    CreateDPT_StoreIdevarsOffsetAndBasePortFromCSBPtoDPTinDSDI
    5860    ; Fall to .StoreDriveSelectAndDriveControlByte
    5961
     
    230232
    231233;--------------------------------------------------------------------
     234; CreateDPT_StoreIdevarsOffsetAndBasePortFromCSBPtoDPTinDSDI
     235;   Parameters:
     236;       DX:     Autodetected port (for devices that support autodetection)
     237;       DS:DI:  Ptr to Disk Parameter Table
     238;       CS:BP:  Ptr to IDEVARS for the controller
     239;   Returns:
     240;       Nothing
     241;   Corrupts registers:
     242;       AX
     243;--------------------------------------------------------------------
     244CreateDPT_StoreIdevarsOffsetAndBasePortFromCSBPtoDPTinDSDI:
     245    mov     [di+DPT.bIdevarsOffset], bp     ; IDEVARS must start in first 256 bytes of ROM
     246
     247%ifdef MODULE_8BIT_IDE
     248    call    DetectDrives_DoesIdevarsInCSBPbelongToXTCF
     249    jne     SHORT .DeviceUsesPortSpecifiedInIDEVARS
     250    mov     [di+DPT.wBasePort], dx
     251    ret
     252.DeviceUsesPortSpecifiedInIDEVARS:
     253%endif ; MODULE_8BIT_IDE
     254
     255    mov     ax, [cs:bp+IDEVARS.wBasePort]
     256    mov     [di+DPT.wBasePort], ax
     257    ret
     258
     259
     260;--------------------------------------------------------------------
    232261; GetUserDefinedCapacityToBXAXandFlagsToCXandModeToDXfromROMVARS
    233262;   Parameters:
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm

    r444 r473  
    208208    ret
    209209
     210
    210211%ifdef MODULE_SERIAL_FLOPPY
    211212;--------------------------------------------------------------------
    212213; RamVars_UnpackFlopCntAndFirstToAL
    213214;   Parameters:
    214 ;       Nothing
     215;       DS:     RAMVARS segment
    215216;   Returns:
    216217;       AL:     First floppy drive number supported
     
    226227    ret
    227228%endif
     229
     230
     231;--------------------------------------------------------------------
     232; RamVars_IsDriveDetectionInProgress
     233;   Parameters:
     234;       DS:     RAMVARS segment
     235;   Returns:
     236;       ZF:     Set if drive detection is in progress (ROM initialization)
     237;   Corrupts registers:
     238;       None
     239;--------------------------------------------------------------------
     240RamVars_IsDriveDetectionInProgress:
     241    cmp     WORD [RAMVARS.wSignature], RAMVARS_DRV_DETECT_SIGNATURE
     242    ret
Note: See TracChangeset for help on using the changeset viewer.