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/HError.asm

    r3 r27  
    22; Project name  :   IDE BIOS
    33; Created date  :   30.11.2007
    4 ; Last update   :   8.4.2010
     4; Last update   :   28.7.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Error checking functions for BIOS Hard disk functions.
     
    88; Section containing code
    99SECTION .text
     10
     11;--------------------------------------------------------------------
     12; HError_GetErrorCodeToAHforBitPollingTimeout
     13;   Parameters:
     14;       AL:     IDE Status Register contents
     15;       DX:     IDE Status Register Address
     16;   Returns:
     17;       AH:     Hard disk BIOS error code
     18;       CF:     Set since error
     19;   Corrupts registers:
     20;       AL, CX
     21;--------------------------------------------------------------------
     22ALIGN JUMP_ALIGN
     23HError_GetErrorCodeToAHforBitPollingTimeout:
     24    test    al, FLG_IDE_ST_BSY                      ; Other bits undefined when BSY set
     25    jnz     SHORT HError_GetErrorCodeForStatusReg   ; Busy, normal timeout
     26    test    al, FLG_IDE_ST_DF | FLG_IDE_ST_CORR | FLG_IDE_ST_ERR
     27    jnz     SHORT HError_GetErrorCodeForStatusReg   ; Not busy but some error
     28    or      al, FLG_IDE_ST_BSY                      ; Polled bit got never set, force timeout
     29    ; Fall to HError_GetErrorCodeForStatusReg
    1030
    1131;--------------------------------------------------------------------
     
    3757    mov     [HDBDA.wHDStAndErr], ax         ; Store Status and Error to BDA
    3858    pop     ds
    39 
    40     ; Translate registers to BIOS error code
    4159    ; Fall to HError_ConvertIdeErrorToBiosRet
    4260
     
    5876ALIGN JUMP_ALIGN
    5977HError_ConvertIdeErrorToBiosRet:
    60     ; Any error?
     78    test    al, FLG_IDE_ST_BSY
     79    jnz     SHORT .TimeoutError
    6180    test    al, FLG_IDE_ST_DF | FLG_IDE_ST_CORR | FLG_IDE_ST_ERR
    6281    jnz     SHORT .ReadErrorFromStatusReg
    6382    xor     ah, ah                  ; No errors, zero AH and CF
     83    ret
     84
     85.TimeoutError:
     86    mov     ah, RET_HD_TIMEOUT
     87    stc
    6488    ret
    6589
Note: See TracChangeset for help on using the changeset viewer.