Changeset 521 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h


Ignore:
Timestamp:
Mar 10, 2013, 3:46:59 PM (12 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Hopefully fixed problems with recent changes to AH=00h.
  • Timeout error code is no longer displayed when trying to boot from floppy drive.
Location:
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h
Files:
2 edited

Legend:

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

    r520 r521  
    119119    jz      SHORT .ErrorCodeNotUsed
    120120    mov     bl, [di+DPT.bIdevarsOffset]                 ; replace drive number with Idevars pointer for cmp with dl
    121 .ErrorCodeNotUsed:
    122 
    123     mov     si, ControllerResetForDPTinDSDI
    124     call    .CallSIforEveryController                   ; Reset all drives to power on settings
    125     mov     si, ControllerInitForMasterOrSingleDPTinDSDI
    126     ; Fall to .CallSIforEveryController                 ; Initialize all controllers (Master and Slave drives)
    127 
    128 .CallSIforEveryController:                              ; BH will be garbage on exit if this entry point is used,
     121.ErrorCodeNotUsed:                                      ; BH will be garbage on exit if this entry point is used,
    129122                                                        ; but reset of all drives will still happen
    130 
    131123    mov     dl, ROMVARS.ideVars0                        ; starting Idevars offset
    132124
     
    139131
    140132.loop:
    141     push    si
    142     call    FindDPT_ForIdevarsOffsetInDL                ; look for the first drive on this controller, if any
    143     pop     si
    144     jc      SHORT .notFound
     133    call    FindDPT_MasterOrSingleForIdevarsOffsetInDL
     134    jc      SHORT .ControllerNotAvailable
    145135
    146     push    bx
     136    ; Reset controller (both Master and Slave Drive). We ignore error codes
     137    ; here since initialization is the one that matters.
    147138    push    cx
    148139    push    dx
    149     call    si                                          ; Reset Master AND Slave or initialize Master OR Slave drive
     140    push    bx
     141%ifdef MODULE_IRQ
     142    call    Interrupts_UnmaskInterruptControllerForDriveInDSDI
     143%endif
     144    call    Device_ResetMasterAndSlaveController
     145%ifdef MODULE_ADVANCED_ATA
     146    call    AdvAtaInit_InitializeControllerForDPTinDSDI
     147%endif
     148    pop     bx
    150149    pop     dx
     150
     151    ; Initialize Master Drive
     152    call    AH9h_InitializeDriveForUse                  ; Initialize Master drive
     153    call    BackupErrorCodeFromTheRequestedDriveToBH
     154
     155    ; Initialize Slave Drive
     156    call    FindDPT_SlaveForIdevarsOffsetInDL
     157    jc      SHORT .SlaveDriveNotAvailable
     158    call    AH9h_InitializeDriveForUse
     159    ; Here we have a small problem. Since DL now has offset to IDEVARS, it will be the same
     160    ; for both Master and Slave Drive. We simply ignore error from slave drive reset since most
     161    ; systems do not have slave drives at all and it is unlikely that AH=00h would be called for
     162    ; specific drive anyway. AH=Dh is for that.
     163
     164.SlaveDriveNotAvailable:
    151165    pop     cx
    152     pop     bx
    153     call    BackupErrorCodeFromTheRequestedDriveToBH    ; save error code if same controller as drive from entry
    154 
    155 .notFound:
     166.ControllerNotAvailable:
    156167    add     dl, IDEVARS_size                            ; move Idevars pointer forward
    157168    loop    .loop
    158169    ret
    159 
    160 
    161 ;--------------------------------------------------------------------
    162 ; ControllerResetForDPTinDSDI
    163 ;   Parameters:
    164 ;       DS:DI:  Ptr to DPT for drive to reset (resets both Master and Slave drive)
    165 ;       SS:BP:  Ptr to IDEPACK
    166 ;   Returns:
    167 ;       AH:     Int 13h return status
    168 ;   Corrupts registers:
    169 ;       AL, BX, CX, DX
    170 ;--------------------------------------------------------------------
    171 ControllerResetForDPTinDSDI:
    172 %ifdef MODULE_IRQ
    173     call    Interrupts_UnmaskInterruptControllerForDriveInDSDI
    174 %endif
    175 %ifdef MODULE_ADVANCED_ATA
    176     call    Device_ResetMasterAndSlaveController
    177     jmp     AdvAtaInit_InitializeControllerForDPTinDSDI
    178 %else
    179     jmp     Device_ResetMasterAndSlaveController
    180 %endif
    181 
    182 
    183 ;--------------------------------------------------------------------
    184 ; ControllerInitForMasterOrSingleDPTinDSDI
    185 ;   Parameters:
    186 ;       DS:DI:  Ptr to DPT for Master or Single Drive (initializes both Master and Slave drive)
    187 ;       SS:BP:  Ptr to IDEPACK
    188 ;   Returns:
    189 ;       AH:     Int 13h return status
    190 ;   Corrupts registers:
    191 ;       AL, BX, CX, DX
    192 ;--------------------------------------------------------------------
    193 ControllerInitForMasterOrSingleDPTinDSDI:
    194     call    AH9h_InitializeDriveForUse          ; Init Master or Single drive
    195     push    ax                                  ; Store error code
    196 
    197     eMOVZX  ax, BYTE [di+DPT.bIdevarsOffset]    ; Clear AH
    198     add     di, BYTE LARGEST_DPT_SIZE           ; Slave drive or next controller
    199     cmp     [di+DPT.bIdevarsOffset], al
    200     jne     SHORT .NoSlaveDrivePresent
    201 
    202     call    AH9h_InitializeDriveForUse          ; Init Slave drive
    203 .NoSlaveDrivePresent:
    204     pop     bx
    205     MAX_U   ah, bh                              ; Return error code from either drive
    206     ret
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm

    r505 r521  
    7373;       CF:     0 if successful, 1 if error
    7474;   Corrupts registers:
    75 ;       AL, BX, CX, DX
     75;       AL, CX
    7676;--------------------------------------------------------------------
    7777AH9h_InitializeDriveForUse:
     
    9393    push    es
    9494    push    si
     95    push    dx
     96    push    bx
    9597
    9698
     
    232234%endif
    233235
     236    pop     bx
     237    pop     dx
    234238    pop     si
    235239    pop     es
Note: See TracChangeset for help on using the changeset viewer.