Changeset 155 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Device


Ignore:
Timestamp:
May 1, 2011, 6:44:29 PM (14 years ago)
Author:
Tomi Tilli
google:author:
aitotat
Message:

Changes to XTIDE Universal BIOS:

  • AH=4h again uses VERIFY command (copy-pasting had changed it to WRITE).
  • Timeout should now work on all overflow situations.
  • Cleaned code a bit.
Location:
trunk/XTIDE_Universal_BIOS/Src/Device
Files:
4 edited
1 copied

Legend:

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

    r152 r155  
    2222    call    Device_OutputALtoIdeControlBlockRegisterInDL
    2323    mov     ax, HSR0_RESET_WAIT_US
    24     call    HTimer_DelayMicrosecondsFromAX
     24    call    Timer_DelayMicrosecondsFromAX
    2525
    2626    ; HSR1: Clear_wait
     
    3131    call    Device_OutputALtoIdeControlBlockRegisterInDL
    3232    mov     ax, HSR1_RESET_WAIT_US
    33     call    HTimer_DelayMicrosecondsFromAX
     33    call    Timer_DelayMicrosecondsFromAX
    3434
    3535    ; HSR2: Check_status
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm

    r152 r155  
    381381    eSEG    es          ; Source is ES segment
    382382    rep
    383     db      6Fh         ; OUTSW
     383    db      6Fh         ; OUTSW (we want this in XT build)
    384384    ret
    385385
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeWait.asm

    r150 r155  
    5353;--------------------------------------------------------------------
    5454IdeWait_PollStatusFlagInBLwithTimeoutInBH:
    55     eMOVZX  cx, bh      ; Timeout ticks now in CX
    5655    mov     ah, bl
    57     call    HTimer_InitializeTimeoutWithTicksInCX
     56    mov     cl, bh
     57    call    Timer_InitializeTimeoutWithTicksInCL
    5858    and     ah, ~FLG_STATUS_BSY
    5959    jz      SHORT PollBsyOnly
     
    8282    jnz     SHORT IdeError_GetBiosErrorCodeToAHfromPolledStatusRegisterInAL
    8383.UpdateTimeout:
    84     call    HTimer_SetCFifTimeout
     84    call    Timer_SetCFifTimeout
    8585    jnc     SHORT .PollLoop                     ; Loop if time left
    8686    call    IdeError_GetBiosErrorCodeToAHfromPolledStatusRegisterInAL
     
    110110    test    al, FLG_STATUS_BSY                  ; Controller busy?
    111111    jz      SHORT IdeError_GetBiosErrorCodeToAHfromPolledStatusRegisterInAL
    112     call    HTimer_SetCFifTimeout               ; Update timeout counter
     112    call    Timer_SetCFifTimeout                ; Update timeout counter
    113113    jnc     SHORT .PollLoop                     ; Loop if time left (sets CF on timeout)
    114114    jmp     SHORT IdeError_GetBiosErrorCodeToAHfromPolledStatusRegisterInAL
  • trunk/XTIDE_Universal_BIOS/Src/Device/Idepack.asm

    r150 r155  
    5050
    5151    push    bx
    52     call    HAddress_OldInt13hAddressToIdeAddress
     52    call    Address_OldInt13hAddressToIdeAddress
    5353    call    AccessDPT_GetDriveSelectByteToAL
    5454    or      al, bh          ; AL now has Drive and Head Select Byte
  • trunk/XTIDE_Universal_BIOS/Src/Device/Timer.asm

    r150 r155  
    66
    77;--------------------------------------------------------------------
    8 ; HTimer_InitializeTimeoutWithTicksInCX
     8; Timer_InitializeTimeoutWithTicksInCL
    99;   Parameters:
    10 ;       CX:     Timeout value in system timer ticks
     10;       CL:     Timeout value in system timer ticks
    1111;       DS:     Segment to RAMVARS
    1212;   Returns:
     
    1616;--------------------------------------------------------------------
    1717ALIGN JUMP_ALIGN
    18 HTimer_InitializeTimeoutWithTicksInCX:
    19     mov     [RAMVARS.wTimeoutCounter], cx   ; Store timeout ticks
     18Timer_InitializeTimeoutWithTicksInCL:
     19    mov     [RAMVARS.bTimeoutTicksLeft], cl     ; Ticks until timeout
    2020    call    ReadTimeFromBdaToCX
    21     add     [RAMVARS.wTimeoutCounter], cx   ; End time for timeout
     21    mov     [RAMVARS.bLastTimeoutUpdate], cl    ; Start time
    2222    ret
    2323
    2424
    2525;--------------------------------------------------------------------
    26 ; HTimer_SetCFifTimeout
     26; Timer_SetCFifTimeout
    2727;   Parameters:
    2828;       DS:     Segment to RAMVARS
     
    3434;--------------------------------------------------------------------
    3535ALIGN JUMP_ALIGN
    36 HTimer_SetCFifTimeout:
     36Timer_SetCFifTimeout:
    3737    call    ReadTimeFromBdaToCX
    38     cmp     [RAMVARS.wTimeoutCounter], cx
     38    cmp     cl, [RAMVARS.bLastTimeoutUpdate]
     39    je      SHORT .StillPollingTheSameTick
     40    mov     [RAMVARS.bLastTimeoutUpdate], cl
     41    sub     BYTE [RAMVARS.bTimeoutTicksLeft], 1 ; DEC does not update CF
     42.StillPollingTheSameTick:
    3943    ret
    4044
     
    4448; RTC resolution is 977 microsecs.
    4549;
    46 ; HTimer_DelayMicrosecondsFromAX
     50; Timer_DelayMicrosecondsFromAX
    4751;   Parameters:
    4852;       AX:     Number of microsecs to wait
     
    5256;       AX
    5357;--------------------------------------------------------------------
    54 HTimer_DelayMicrosecondsFromAX:
     58Timer_DelayMicrosecondsFromAX:
    5559%ifndef USE_AT
    5660    mov     ax, 2
     
    6973    pop     dx
    7074    mov     ax, 1                               ; Prepare to wait 1 timer tick
    71     jc      SHORT HTimer_DelayTimerTicksFromAX  ; Event Wait was unsupported or busy
     75    jc      SHORT Timer_DelayTimerTicksFromAX   ; Event Wait was unsupported or busy
    7276    ret
    7377%endif
     
    7882; will occur at 54.9 ms intervals.
    7983;
    80 ; HTimer_DelayTimerTicksFromAX
     84; Timer_DelayTimerTicksFromAX
    8185;   Parameters:
    8286;       AX:     Number of timer ticks to wait
     
    8690;       AX
    8791;--------------------------------------------------------------------
    88 HTimer_DelayTimerTicksFromAX:
     92Timer_DelayTimerTicksFromAX:
    8993    sti                             ; Make sure that interrupts are enabled
    9094    call    ReadTimeFromBdaToCX
     
    9397    call    ReadTimeFromBdaToCX
    9498    cmp     cx, ax
    95     jb      SHORT .WaitLoop         ; Loop until end time is reached
     99    jne     SHORT .WaitLoop         ; Loop until end time is reached
    96100    ret
    97101
Note: See TracChangeset for help on using the changeset viewer.