Ignore:
Timestamp:
Jul 26, 2010, 6:30:33 PM (14 years ago)
Author:
aitotat
google:author:
aitotat
Message:

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

File:
1 edited

Legend:

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

    r3 r26  
    22; Project name  :   IDE BIOS
    33; Created date  :   9.12.2007
    4 ; Last update   :   12.4.2010
     4; Last update   :   26.7.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Int 13h function AH=Dh, Reset Hard Disk (Alternate reset).
     
    2525ALIGN JUMP_ALIGN
    2626AHDh_HandlerForResetHardDisk:
    27     push    dx
    28     push    cx
    29     push    bx
    30     push    ax
    3127    call    AHDh_ResetDrive
    32     jmp     Int13h_PopXRegsAndReturn
     28    jmp     Int13h_PopDiDsAndReturn
    3329
    3430
     
    4440;       CF:     0 if succesfull, 1 if error
    4541;   Corrupts registers:
    46 ;       AL, BX, CX, DX
     42;       Nothing
    4743;--------------------------------------------------------------------
    4844ALIGN JUMP_ALIGN
    4945AHDh_ResetDrive:
    5046    push    di
     47    push    dx
     48    push    cx
     49    push    bx
     50    push    ax
     51
    5152    call    FindDPT_ForDriveNumber      ; DS:DI now points to DPT
    5253    call    AHDh_ResetMasterAndSlave
     
    5758    mov     dx, [RAMVARS.wIdeBase]      ; Load base port address
    5859    call    AHDh_InitializeMasterAndSlave
    59     jc      SHORT .ReturnError
    60     xor     ax, ax                      ; Clear AH since success
    61     pop     di
    62     ret
    63 .ReturnError:
    64     mov     ah, RET_HD_RESETFAIL        ; Load Reset Failed error code
     60
     61    pop     bx                          ; Pop old AX
     62    mov     al, bl                      ; Restore AL
     63    pop     bx
     64    pop     cx
     65    pop     dx
    6566    pop     di
    6667    ret
     
    110111;       DX:     IDE Base Port address
    111112;   Returns:
     113;       AH:     Error code
    112114;       CF:     0 if initialization succesfull
    113115;               1 if any error
    114116;   Corrupts registers:
    115 ;       AX, BX, CX, DX, DI
     117;       AL, BX, CX, DX, DI
    116118;--------------------------------------------------------------------
    117119ALIGN JUMP_ALIGN
     
    136138    ret
    137139.ReturnError:
     140    mov     ah, RET_HD_RESETFAIL        ; Load Reset Failed error code
    138141    stc
    139142    ret
Note: See TracChangeset for help on using the changeset viewer.