Changeset 541 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src


Ignore:
Timestamp:
Apr 14, 2013, 5:04:32 PM (11 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Brought back compatible DPTs.
Location:
trunk/XTIDE_Universal_BIOS/Src
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH41h_CheckIfExtensionsPresent.asm

    r535 r541  
    4444    mov     WORD [bp+IDEPACK.intpack+INTPACK.bx], 0AA55h
    4545
    46 %ifdef RETURN_DPTE_ON_AH48H
     46%ifdef CREATE_COMPATIBLE_DPT
    4747    call    AH41h_GetSupportBitsToCX
    4848    mov     [bp+IDEPACK.intpack+INTPACK.cx], cx
     
    5757
    5858
    59 %ifdef RETURN_DPTE_ON_AH48H
     59%ifdef CREATE_COMPATIBLE_DPT
    6060;--------------------------------------------------------------------
    6161; AH41h_GetSupportBitsToCX
     
    8787    ret
    8888
    89 %endif ; RETURN_DPTE_ON_AH48H
     89%endif ; CREATE_COMPATIBLE_DPT
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm

    r535 r541  
    8484
    8585    ; Create DPTE (hardware information for device drivers)
    86 %ifdef RETURN_DPTE_ON_AH48H
     86%ifdef CREATE_COMPATIBLE_DPT
    8787    call    AH41h_GetSupportBitsToCX
    8888    test    cl, ENHANCED_DISK_DRIVE_SUPPORT
    8989    jz      SHORT .DoNotCreateDPTE
    90     call    CreateDeviceParameterTableExtensionToESBXfromDPTinDSSI
     90    call    CompatibleDPT_CreateDeviceParameterTableExtensionToESBXfromDPTinDSSI
    9191.DoNotCreateDPTE:
    9292%endif
     
    110110    ; Store DPTE for standard controllers only,
    111111    ; FFFF:FFFF for non standard controllers
    112 %ifdef RETURN_DPTE_ON_AH48H
     112%ifdef CREATE_COMPATIBLE_DPT
    113113    mov     [di+EDRIVE_INFO.fpDPTE], bx
    114114    mov     [di+EDRIVE_INFO.fpDPTE+2], es
     
    161161.ReturnWithError:
    162162    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    163 
    164 
    165 %ifdef RETURN_DPTE_ON_AH48H
    166 ;--------------------------------------------------------------------
    167 ; CreateDeviceParameterTableExtensionToESBXfromDPTinDSSI
    168 ;   Parameters:
    169 ;       DS:SI:  Ptr to DPT (in RAMVARS segment)
    170 ;       ES:     RAMVARS segment
    171 ;   Returns:
    172 ;       ES:BX:  Ptr to Device Parameter Table Extension (DPTE)
    173 ;   Corrupts registers:
    174 ;       AX, CX, DX, DI
    175 ;--------------------------------------------------------------------
    176 CreateDeviceParameterTableExtensionToESBXfromDPTinDSSI:
    177     ; Point ES:DI to DPTE buffer (valid until next AH=48h call)
    178     mov     di, [cs:ROMVARS.bStealSize]
    179     eSHL_IM di, 10                          ; DI = RAMVARS size in bytes
    180     sub     di, BYTE DPTE_size              ; DI = Offset to DPTE
    181     xor     dx, dx                          ; Clear for checksum
    182 
    183     ; Set 32-bit flag for 32-bit controllers
    184     mov     cx, FLG_LBA_TRANSLATION_ENABLED ; DPTE.wFlags
    185     cmp     BYTE [si+DPT_ATA.bDevice], DEVICE_32BIT_ATA
    186     eCMOVE  cl, FLG_LBA_TRANSLATION_ENABLED | FLG_32BIT_XFER_MODE
    187 
    188     ; DPTE.wBasePort
    189     mov     ax, [si+DPT.wBasePort]
    190     call    StoswThenAddALandAHtoDL         ; Bytes 0 and 1
    191 
    192     ; DPTE.wControlBlockPort
    193     eMOVZX  bx, BYTE [si+DPT.bIdevarsOffset]
    194     mov     ax, [cs:bx+IDEVARS.wControlBlockPort]
    195     call    StoswThenAddALandAHtoDL         ; Bytes 2 and 3
    196 
    197     ; DPTE.bDrvnhead and DPTE.bBiosVendor
    198     xchg    di, si
    199     call    AccessDPT_GetDriveSelectByteForEbiosToAL
    200     xchg    si, di
    201     call    StoswThenAddALandAHtoDL         ; Bytes 4 and 5
    202 
    203     ; DPTE.bIRQ and DPTE.bBlockSize
    204     mov     al, [cs:bx+IDEVARS.bIRQ]        ; No way to define that we might not use IRQ
    205     mov     ah, [si+DPT_ATA.bBlockSize]
    206     cmp     ah, 1
    207     jbe     SHORT .DoNotSetBlockModeFlag
    208     or      cl, FLG_BLOCK_MODE_ENABLED
    209 .DoNotSetBlockModeFlag:
    210     call    StoswThenAddALandAHtoDL         ; Bytes 6 and 7
    211 
    212     ; DPTE.bDmaChannelAndType and DPTE.bPioMode
    213     xor     ax, ax
    214 %ifdef MODULE_ADVANCED_ATA
    215     or      ah, [si+DPT_ADVANCED_ATA.bPioMode]
    216     jz      SHORT .NoDotSetFastPioFlag
    217     cmp     WORD [si+DPT_ADVANCED_ATA.wControllerID], BYTE 0
    218     je      SHORT .NoDotSetFastPioFlag
    219     inc     cx      ; FLG_FAST_PIO_ENABLED
    220 .NoDotSetFastPioFlag:
    221 %endif
    222     call    StoswThenAddALandAHtoDL         ; Bytes 8 and 9
    223 
    224     ; Set CHS translation flags and store DPTE.wFlags
    225     mov     al, [si+DPT.bFlagsLow]
    226     and     al, MASKL_DPT_TRANSLATEMODE
    227     jz      SHORT .NoChsTranslationOrBitShiftTranslationSet
    228     or      cl, FLG_CHS_TRANSLATION_ENABLED
    229     test    al, FLGL_DPT_ASSISTED_LBA
    230     jz      SHORT .NoChsTranslationOrBitShiftTranslationSet
    231     or      cx, LBA_ASSISTED_TRANSLATION << TRANSLATION_TYPE_FIELD_POSITION
    232 .NoChsTranslationOrBitShiftTranslationSet:
    233     xchg    ax, cx
    234     call    StoswThenAddALandAHtoDL         ; Bytes 10 and 11
    235 
    236     ; DPTE.wReserved (must be zero)
    237     xor     ax, ax
    238     call    StoswThenAddALandAHtoDL         ; Bytes 12 and 13
    239 
    240     ; DPTE.bRevision and DPTE.bChecksum
    241     mov     ax, DPTE_REVISION | (DPTE_REVISION<<8)
    242     add     ah, dl
    243     neg     ah
    244     stosw
    245     lea     bx, [di-DPTE_size]
    246     ret
    247 
    248 
    249 ;--------------------------------------------------------------------
    250 ; StoswThenAddALandAHtoDL
    251 ;   Parameters:
    252 ;       AX:     WORD to store
    253 ;       ES:DI:  Ptr to where to store AX
    254 ;       DL:     Checksum byte
    255 ;   Returns:
    256 ;       DL:     Checksum byte
    257 ;       DI:     Incremented by 2
    258 ;   Corrupts registers:
    259 ;       Nothing
    260 ;--------------------------------------------------------------------
    261 StoswThenAddALandAHtoDL:
    262     stosw
    263     add     dl, al
    264     add     dl, ah
    265     ret
    266 
    267 %endif ; RETURN_DPTE_ON_AH48H
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm

    r526 r541  
    8080    call    DetectDrives_FromAllIDEControllers
    8181    call    Interrupts_InitializeInterruptVectors
     82    ; Fall to .StoreDptPointersToIntVectors
     83
     84
     85%ifdef CREATE_COMPATIBLE_DPT
     86;--------------------------------------------------------------------
     87; .StoreDptPointersToIntVectors
     88;   Parameters:
     89;       DS:     RAMVARS segment
     90;       ES:     BDA and interrupt vector segment (zero)
     91;   Returns:
     92;       Nothing
     93;   Corrupts registers:
     94;       AX, CX, DX, SI, DI
     95;--------------------------------------------------------------------
     96.StoreDptPointersToIntVectors:
     97    mov     dl, 80h
     98    call    FindDPT_ForDriveNumberInDL  ; DPT to DS:DI
     99    jc      SHORT .FindForDrive81h      ; Store nothing if not our drive
     100
     101    call    CompatibleDPT_CreateToAXSIforDriveDL
     102    mov     [es:HD0_DPT_POINTER_41h*4], si
     103    mov     [es:HD0_DPT_POINTER_41h*4+2], ax
     104
     105.FindForDrive81h:
     106    mov     dl, 81h
     107    call    FindDPT_ForDriveNumberInDL
     108    jc      SHORT .CompatibleDPTsCreated
     109
     110    call    CompatibleDPT_CreateToAXSIforDriveDL
     111    mov     [es:HD1_DPT_POINTER_46h*4], si
     112    mov     [es:HD1_DPT_POINTER_46h*4+2], ax
     113.CompatibleDPTsCreated:
    82114    ; Fall to .ResetDetectedDrives
     115%endif ; CREATE_COMPATIBLE_DPT
     116
    83117
    84118;--------------------------------------------------------------------
  • trunk/XTIDE_Universal_BIOS/Src/Main.asm

    r536 r541  
    282282    %include "AH48h_GetExtendedDriveParameters.asm"
    283283    %include "AH41h_CheckIfExtensionsPresent.asm"
    284 %endif
     284%ifdef CREATE_COMPATIBLE_DPT
     285    %include "CompatibleDPT.asm"
     286%endif
     287%endif
Note: See TracChangeset for help on using the changeset viewer.