Ignore:
Timestamp:
Jan 27, 2011, 8:14:13 AM (13 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to XTIDE Universal BIOS:

  • Now uses new libraries (untested)
  • Non-working since code size is too large
File:
1 edited

Legend:

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

    r34 r88  
    1 ; File name     :   HStatus.asm
    2 ; Project name  :   IDE BIOS
    3 ; Created date  :   15.12.2009
    4 ; Last update   :   23.8.2010
    5 ; Author        :   Tomi Tilli
     1; Project name  :   XTIDE Universal BIOS
    62; Description   :   IDE Status Register polling functions.
    73
     
    176172ALIGN JUMP_ALIGN
    177173HStatus_PollBsyAndFlg:
    178     call    SoftDelay_InitTimeout               ; Initialize timeout counter
     174    call    InitializeTimeoutWithTicksInCL      ; Initialize timeout counter
    179175    in      al, dx                              ; Discard contents for first read
    180176                                                ; (should read Alternate Status Register)
     
    188184ALIGN JUMP_ALIGN
    189185.UpdateTimeout:
    190     call    SoftDelay_UpdTimeout                ; Update timeout counter
     186    call    SetCFifTimeout
    191187    jnc     SHORT .PollLoop                     ; Loop if time left (sets CF on timeout)
    192188    jmp     HError_ProcessTimeoutAfterPollingBSYandSomeOtherStatusBit
     
    210206ALIGN JUMP_ALIGN
    211207HStatus_PollBsy:
    212     call    SoftDelay_InitTimeout               ; Initialize timeout counter
     208    call    InitializeTimeoutWithTicksInCL      ; Initialize timeout counter
    213209    in      al, dx                              ; Discard contents for first read
    214210                                                ; (should read Alternate Status Register)
     
    218214    test    al, FLG_IDE_ST_BSY                  ; Controller busy?
    219215    jz      SHORT GetErrorCodeFromPollingToAH   ;  If not, jump to check errors
    220     call    SoftDelay_UpdTimeout                ; Update timeout counter
     216    call    SetCFifTimeout                      ; Update timeout counter
    221217    jnc     SHORT .PollLoop                     ; Loop if time left (sets CF on timeout)
    222218ALIGN JUMP_ALIGN
    223219GetErrorCodeFromPollingToAH:
    224220    jmp     HError_ProcessErrorsAfterPollingBSY
     221
     222
     223;--------------------------------------------------------------------
     224; InitializeTimeoutWithTicksInCL
     225;   Parameters:
     226;       CL:     Timeout value in system timer ticks
     227;       DS:     Segment to RAMVARS
     228;   Returns:
     229;       Nothing
     230;   Corrupts registers:
     231;       CX
     232;--------------------------------------------------------------------
     233ALIGN JUMP_ALIGN
     234InitializeTimeoutWithTicksInCL:
     235    push    bx
     236    xchg    cx, ax
     237
     238    xor     ah, ah      ; Timeout ticks now in AX
     239    mov     bx, RAMVARS.wTimeoutCounter
     240    call    TimerTicks_InitializeTimeoutFromAX
     241
     242    xchg    ax, cx      ; Restore AX
     243    pop     bx
     244    ret
     245
     246;--------------------------------------------------------------------
     247; SetCFifTimeout
     248;   Parameters:
     249;       DS:     Segment to RAMVARS
     250;   Returns:
     251;       Nothing
     252;   Corrupts registers:
     253;       CX
     254;--------------------------------------------------------------------
     255ALIGN JUMP_ALIGN
     256SetCFifTimeout:
     257    push    bx
     258    xchg    cx, ax
     259
     260    mov     bx, RAMVARS.wTimeoutCounter
     261    call    TimerTicks_GetTimeoutTicksLeftToAXfromDSBX
     262
     263    xchg    ax, cx      ; Restore AX
     264    pop     bx
     265    ret
Note: See TracChangeset for help on using the changeset viewer.