Changeset 160 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm


Ignore:
Timestamp:
May 4, 2011, 5:49:22 PM (13 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to XTIDE Universal BIOS:

  • Support for XTIDE mod now works.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm

    r158 r160  
    1010;       DS:DI:  Ptr to Disk Parameter Table
    1111;       ES:SI:  Ptr to 512-byte ATA information read from the drive
     12;       CS:BP:  Ptr to IDEVARS for the controller
    1213;   Returns:
    1314;       Nothing
     
    103104    xor     ax, ax
    104105    ret
    105 
    106 
    107 ;--------------------------------------------------------------------
    108 ; Device_OutputALtoIdeRegisterInDL
    109 ;   Parameters:
    110 ;       AL:     Byte to output
    111 ;       DL:     IDE Register
    112 ;       DS:DI:  Ptr to DPT (in RAMVARS segment)
    113 ;   Returns:
    114 ;       Nothing
    115 ;   Corrupts registers:
    116 ;       BX, DX
    117 ;--------------------------------------------------------------------
    118 ALIGN JUMP_ALIGN
    119 Device_OutputALtoIdeRegisterInDL:
    120     mov     bx, IdeIO_OutputALtoIdeRegisterInDX
    121     jmp     SHORT TranslateRegisterAddressInDLifNecessaryThenJumpToBX
    122 
    123 
    124 ;--------------------------------------------------------------------
    125 ; Device_OutputALtoIdeControlBlockRegisterInDL
    126 ;   Parameters:
    127 ;       AL:     Byte to output
    128 ;       DL:     IDE Control Block Register
    129 ;       DS:DI:  Ptr to DPT (in RAMVARS segment)
    130 ;   Returns:
    131 ;       Nothing
    132 ;   Corrupts registers:
    133 ;       BX, DX
    134 ;--------------------------------------------------------------------
    135 ALIGN JUMP_ALIGN
    136 Device_OutputALtoIdeControlBlockRegisterInDL:
    137     mov     bx, IdeIO_OutputALtoIdeControlBlockRegisterInDX
    138     jmp     SHORT TranslateRegisterAddressInDLifNecessaryThenJumpToBX
    139 
    140 
    141 ;--------------------------------------------------------------------
    142 ; Device_InputToALfromIdeRegisterInDL
    143 ;   Parameters:
    144 ;       DL:     IDE Register
    145 ;       DS:DI:  Ptr to DPT (in RAMVARS segment)
    146 ;   Returns:
    147 ;       AL:     Inputted byte
    148 ;   Corrupts registers:
    149 ;       BX, DX
    150 ;--------------------------------------------------------------------
    151 ALIGN JUMP_ALIGN
    152 Device_InputToALfromIdeRegisterInDL:
    153     mov     bx, IdeIO_InputToALfromIdeRegisterInDX
    154     ; Fall to TranslateRegisterAddressInDLifNecessaryThenJumpToBX
    155 
    156 
    157 ;--------------------------------------------------------------------
    158 ; TranslateRegisterAddressInDLifNecessaryThenJumpToBX
    159 ;   Parameters:
    160 ;       AL:     Byte to output (if output function in BX)
    161 ;       DL:     IDE Register
    162 ;       BX:     I/O function to jump to
    163 ;       DS:DI:  Ptr to DPT (in RAMVARS segment)
    164 ;   Returns:
    165 ;       AL:     Inputted byte (if input function in BX)
    166 ;   Corrupts registers:
    167 ;       BX, DX
    168 ;--------------------------------------------------------------------
    169 TranslateRegisterAddressInDLifNecessaryThenJumpToBX:
    170     test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_REVERSED_A0_AND_A3
    171     jz      SHORT .JumpToIoFunctionInSI
    172 
    173     ; Exchange address lines A0 and A3 from DL
    174     mov     dh, MASK_A3_AND_A0_ADDRESS_LINES
    175     and     dh, dl                          ; DH = 0, 1, 8 or 9, we can ignore 0 and 9
    176     jz      SHORT .JumpToIoFunctionInSI     ; Jump out since DH is 0
    177     xor     dh, MASK_A3_AND_A0_ADDRESS_LINES
    178     jz      SHORT .JumpToIoFunctionInSI     ; Jump out since DH was 9
    179     and     dl, ~MASK_A3_AND_A0_ADDRESS_LINES
    180     or      dl, dh                          ; Address lines now reversed
    181 
    182 ALIGN JUMP_ALIGN
    183 .JumpToIoFunctionInSI:
    184     push    bx
    185     xor     dh, dh
    186     eMOVZX  bx, BYTE [di+DPT.bIdevarsOffset]; CS:BX now points to IDEVARS
    187     ret
Note: See TracChangeset for help on using the changeset viewer.