Changeset 566 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src


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.
Location:
trunk/XTIDE_Universal_BIOS/Src
Files:
4 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:
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm

    r558 r566  
    106106    jc      .ReturnWithErrorCodeInAH
    107107%else
    108     jnc     SHORT .ContinueInitializationSinceDriveSelectedSuccesfully
     108    jnc     SHORT .ContinueInitializationSinceDriveSelectedSuccessfully
    109109    jmp     .ReturnWithErrorCodeInAH
    110 .ContinueInitializationSinceDriveSelectedSuccesfully:
     110.ContinueInitializationSinceDriveSelectedSuccessfully:
    111111%endif
    112112
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13hBiosInit.asm

    r561 r566  
    2828; Int 13h software interrupt handler.
    2929; This handler captures boot sector read from foreign drive when our
    30 ; INT 19h is not called. This way we can for XTIDE Universal BIOS
     30; INT 19h is not called. This way we can force XTIDE Universal BIOS
    3131; initialization even without INT 19h being called.
    3232;
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/Vision.asm

    r564 r566  
    179179    test    al, FLG_QDCONTROL_HDONLY_in
    180180    eCMOVNZ ah, FLG_QDCONTROL_NONATAPI              ; Enable Read-Ahead and Post-Write Buffers
    181     or      ah, MASK_QDCONTROL_FLAGS_TO_SET
    182181    mov     al, ah
     182    or      al, MASK_QDCONTROL_FLAGS_TO_SET
    183183    out     dx, al
    184184    sub     dx, BYTE QD6580_CONTROL_REGISTER
     
    187187    ; QD6500 has only one channel that can be Primary at 1F0h or Secondary at 170h.
    188188    ; QD6580 always has Primary channel at 1F0h. Secondary channel at 170h can be Enabled or Disabled.
    189     mov     bx, [di+DPT.wBasePort]
    190     cmp     bx, DEVICE_ATA_PRIMARY_PORT
     189    cmp     WORD [di+DPT.wBasePort], DEVICE_ATA_PRIMARY_PORT
    191190    je      SHORT .CalculateTimingTicksForQD6580    ; Primary Channel so no need to modify DX
    192191    times 2 inc dx                                  ; Secondary Channel IDE Timing Register
     
    216215
    217216    ; Merge the values to a single byte to output
    218     eSHIFT_IM   al, POSITON_QD65XXIDE_RECOVERY_TIME, shl
     217    eSHL_IM al, POSITION_QD65XXIDE_RECOVERY_TIME
    219218    or      al, bl
    220219    out     dx, al
Note: See TracChangeset for help on using the changeset viewer.