Changeset 566 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeError.asm


Ignore:
Timestamp:
Aug 29, 2013, 12:49:15 AM (11 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Fixed a very old bug (from r150) in IdeError.asm where GetBiosErrorCodeToAHfromStatusAndErrorRegistersInAX would return RET_HD_SEEK_FAIL instead of RET_HD_STATUSERR.
  • Optimizations and other fixes.
File:
1 edited

Legend:

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

    r526 r566  
    5555ALIGN JUMP_ALIGN
    5656GetBiosErrorCodeToAHfromStatusAndErrorRegistersInAX:
    57     test    al, FLG_STATUS_BSY
    58     jz      SHORT .CheckErrorBitsFromStatusRegisterInAL
    59     mov     ah, RET_HD_TIMEOUT
    60     jmp     SHORT .ReturnBiosErrorCodeInAH
     57    test    al, FLG_STATUS_BSY | FLG_STATUS_DF | FLG_STATUS_CORR | FLG_STATUS_ERR   ; Clears CF
     58    jnz     SHORT .CheckErrorBitsFromStatusRegisterInAL
     59    ; The MSB of AL (FLG_STATUS_BSY) is cleared at this point.
     60    cbw                             ; No errors, zero AH (CF already cleared)
     61    ret
    6162
    6263ALIGN JUMP_ALIGN
    6364.CheckErrorBitsFromStatusRegisterInAL:
    64     test    al, FLG_STATUS_DF | FLG_STATUS_CORR | FLG_STATUS_ERR
    65     jnz     SHORT .ProcessErrorFromStatusRegisterInAL
    66     xor     ah, ah                  ; No errors, zero AH and CF
    67     ret
    68 
    69 .ProcessErrorFromStatusRegisterInAL:
     65    js      SHORT .Flg_Status_Bsy   ; Jump if FLG_STATUS_BSY
    7066    test    al, FLG_STATUS_ERR      ; Error specified in Error register?
    7167    jnz     SHORT .ConvertBiosErrorToAHfromErrorRegisterInAH
     
    7470    jnz     SHORT .ReturnBiosErrorCodeInAH
    7571    mov     ah, RET_HD_CONTROLLER   ; Must be Device Fault
    76     jmp     SHORT .ReturnBiosErrorCodeInAH
     72    SKIP2B  bx
     73.Flg_Status_Bsy:
     74    mov     ah, RET_HD_TIMEOUT
     75.ReturnBiosErrorCodeInAH:
     76    stc
     77    ret
    7778
    7879.ConvertBiosErrorToAHfromErrorRegisterInAH:
    79     xor     bx, bx                  ; Clear CF
     80    stc                             ; Needed in case Error register (AH) is zero
     81    mov     bx, .rgbRetCodeLookup-1
    8082.ErrorBitLoop:
    81     rcr     ah, 1                   ; Set CF if error bit set
    82     jc      SHORT .LookupErrorCode
    8383    inc     bx
    84     test    ah, ah                  ; Clear CF
    85     jnz     SHORT .ErrorBitLoop
    86 .LookupErrorCode:
    87     mov     ah, [cs:bx+.rgbRetCodeLookup]
    88 .ReturnBiosErrorCodeInAH:
    89     stc                             ; Set CF since error
     84    rcr     ah, 1
     85    jnc     SHORT .ErrorBitLoop     ; CF will be set eventually
     86    mov     ah, [cs:bx]
    9087    ret
     88
    9189
    9290.rgbRetCodeLookup:
Note: See TracChangeset for help on using the changeset viewer.