Ignore:
Timestamp:
Jul 28, 2010, 6:53:32 PM (14 years ago)
Author:
aitotat
google:author:
aitotat
Message:
  • v1.1.1 broke booting from foreign drives, it is now fixed.
  • Fixed a bug where Disk Parameter Table was accessed with wrong pointer register after writing last block.
  • Cleaned AH=00h, Disk Controller Reset a bit.
  • Timeout errors might now get translated for better error codes on certain situations.
File:
1 edited

Legend:

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

    r26 r27  
    22; Project name  :   IDE BIOS
    33; Created date  :   15.12.2009
    4 ; Last update   :   26.6.2010
     4; Last update   :   28.7.2010
    55; Author        :   Tomi Tilli
    66; Description   :   IDE Status Register polling functions.
     
    189189; IDE Status register polling.
    190190; This function first waits until controller is not busy.
    191 ; When not busy, IDE Status Register is polled until wanted
    192 ; flag (HBIT_ST_DRDY or HBIT_ST_DRQ) is set.
     191; When not busy, IDE Status Register is polled until wanted flag is set.
    193192;
    194193; HStatus_PollBusyAndFlg
     
    207206ALIGN JUMP_ALIGN
    208207HStatus_PollBsyAndFlg:
    209     call    SoftDelay_InitTimeout       ; Initialize timeout counter
     208    call    SoftDelay_InitTimeout               ; Initialize timeout counter
    210209ALIGN JUMP_ALIGN
    211210.PollLoop:
    212     in      al, dx                      ; Load IDE Status Register
    213     test    al, FLG_IDE_ST_BSY          ; Controller busy?
    214     jnz     SHORT .UpdateTimeout        ;  If so, jump to timeout update
    215     test    al, ah                      ; Test secondary flag
    216     jnz     SHORT HStatus_PollCompleted ; If set, break loop
     211    in      al, dx                              ; Load IDE Status Register
     212    test    al, FLG_IDE_ST_BSY                  ; Controller busy?
     213    jnz     SHORT .UpdateTimeout                ;  If so, jump to timeout update
     214    test    al, ah                              ; Test secondary flag
     215    jnz     SHORT GetErrorCodeFromPollingToAH   ; If set, break loop
    217216ALIGN JUMP_ALIGN
    218217.UpdateTimeout:
    219     call    SoftDelay_UpdTimeout        ; Update timeout counter
    220     jnc     SHORT .PollLoop             ; Loop if time left (sets CF on timeout)
    221     mov     ah, RET_HD_TIMEOUT          ; Load error code for timeout
    222     ret
    223 
     218    call    SoftDelay_UpdTimeout                ; Update timeout counter
     219    jnc     SHORT .PollLoop                     ; Loop if time left (sets CF on timeout)
     220    jmp     HError_GetErrorCodeToAHforBitPollingTimeout
    224221
    225222;--------------------------------------------------------------------
     
    241238ALIGN JUMP_ALIGN
    242239HStatus_PollBsy:
    243     call    SoftDelay_InitTimeout       ; Initialize timeout counter
     240    call    SoftDelay_InitTimeout               ; Initialize timeout counter
    244241ALIGN JUMP_ALIGN
    245242.PollLoop:
    246     in      al, dx                      ; Load IDE Status Reg
    247     test    al, FLG_IDE_ST_BSY          ; Controller busy? (clears CF)
    248     jz      SHORT HStatus_PollCompleted ;  If not, jump to check errors
    249     call    SoftDelay_UpdTimeout        ; Update timeout counter
    250     jnc     SHORT .PollLoop             ; Loop if time left (sets CF on timeout)
    251     mov     ah, RET_HD_TIMEOUT          ; Load error code for timeout
    252     ret
    253 
    254 ALIGN JUMP_ALIGN
    255 HStatus_PollCompleted:
    256     test    al, FLG_IDE_ST_DF | FLG_IDE_ST_ERR
    257     jnz     SHORT .GetErrorCode         ;  If errors, jump to get error code
    258     xor     ah, ah                      ; Zero AH and clear CF
    259     ret
    260 .GetErrorCode:
     243    in      al, dx                              ; Load IDE Status Reg
     244    test    al, FLG_IDE_ST_BSY                  ; Controller busy?
     245    jz      SHORT GetErrorCodeFromPollingToAH   ;  If not, jump to check errors
     246    call    SoftDelay_UpdTimeout                ; Update timeout counter
     247    jnc     SHORT .PollLoop                     ; Loop if time left (sets CF on timeout)
     248ALIGN JUMP_ALIGN
     249GetErrorCodeFromPollingToAH:
    261250    jmp     HError_GetErrorCodeForStatusReg
Note: See TracChangeset for help on using the changeset viewer.