Changeset 140 in xtideuniversalbios


Ignore:
Timestamp:
Mar 14, 2011, 11:38:26 AM (13 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to XTIDE Universal BIOS:

  • INT 13h functions should no longer use Assembly Library.
  • Boot menu now properly displays swapped drive numbers.
Location:
trunk/XTIDE_Universal_BIOS/Src
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuEvent.asm

    r137 r140  
    8585.ItemHighlightedFromCX:
    8686    push    cx
    87     push    dx
    8887    call    RamVars_GetSegmentToDS
    8988    call    DriveXlate_Reset
    9089    call    BootMenu_GetDriveToDXforMenuitemInCX
    9190    call    DriveXlate_SetDriveToSwap
    92     pop     ax      ; Update previous item
     91
     92    xor     ax, ax  ; Update first floppy drive (for translated drive number)
    9393    CALL_MENU_LIBRARY RefreshItemFromAX
    94     pop     ax      ; Update new item
     94    mov     dl, 80h
     95    call    BootMenu_GetMenuitemToDXforDriveInDL
     96    xchg    ax, dx  ; Update first hard disk (for translated drive number)
     97    CALL_MENU_LIBRARY RefreshItemFromAX
     98    pop     ax      ; Update new item (for translated drive number)
    9599    CALL_MENU_LIBRARY RefreshItemFromAX
    96100    CALL_MENU_LIBRARY RefreshInformation
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common/HStatus.asm

    r120 r140  
    172172ALIGN JUMP_ALIGN
    173173HStatus_PollBsyAndFlg:
    174     call    InitializeTimeoutWithTicksInCL      ; Initialize timeout counter
    175     in      al, dx                              ; Discard contents for first read
    176                                                 ; (should read Alternate Status Register)
     174    call    HTimer_InitializeTimeoutWithTicksInCL   ; Initialize timeout counter
     175    in      al, dx                                  ; Discard contents for first read
     176                                                    ; (should read Alternate Status Register)
    177177ALIGN JUMP_ALIGN
    178178.PollLoop:
    179     in      al, dx                              ; Load IDE Status Register
    180     test    al, FLG_IDE_ST_BSY                  ; Controller busy?
    181     jnz     SHORT .UpdateTimeout                ;  If so, jump to timeout update
    182     test    al, ah                              ; Test secondary flag
    183     jnz     SHORT GetErrorCodeFromPollingToAH   ; If set, break loop
     179    in      al, dx                                  ; Load IDE Status Register
     180    test    al, FLG_IDE_ST_BSY                      ; Controller busy?
     181    jnz     SHORT .UpdateTimeout                    ;  If so, jump to timeout update
     182    test    al, ah                                  ; Test secondary flag
     183    jnz     SHORT GetErrorCodeFromPollingToAH       ; If set, break loop
    184184ALIGN JUMP_ALIGN
    185185.UpdateTimeout:
    186     call    SetCFifTimeout
    187     jnc     SHORT .PollLoop                     ; Loop if time left (sets CF on timeout)
     186    call    HTimer_SetCFifTimeout
     187    jnc     SHORT .PollLoop                         ; Loop if time left (sets CF on timeout)
    188188    jmp     HError_ProcessTimeoutAfterPollingBSYandSomeOtherStatusBit
    189189
     
    206206ALIGN JUMP_ALIGN
    207207HStatus_PollBsy:
    208     call    InitializeTimeoutWithTicksInCL      ; Initialize timeout counter
    209     in      al, dx                              ; Discard contents for first read
    210                                                 ; (should read Alternate Status Register)
     208    call    HTimer_InitializeTimeoutWithTicksInCL   ; Initialize timeout counter
     209    in      al, dx                                  ; Discard contents for first read
     210                                                    ; (should read Alternate Status Register)
    211211ALIGN JUMP_ALIGN
    212212.PollLoop:
    213     in      al, dx                              ; Load IDE Status Reg
    214     test    al, FLG_IDE_ST_BSY                  ; Controller busy?
    215     jz      SHORT GetErrorCodeFromPollingToAH   ;  If not, jump to check errors
    216     call    SetCFifTimeout                      ; Update timeout counter
    217     jnc     SHORT .PollLoop                     ; Loop if time left (sets CF on timeout)
     213    in      al, dx                                  ; Load IDE Status Reg
     214    test    al, FLG_IDE_ST_BSY                      ; Controller busy?
     215    jz      SHORT GetErrorCodeFromPollingToAH       ;  If not, jump to check errors
     216    call    HTimer_SetCFifTimeout                   ; Update timeout counter
     217    jnc     SHORT .PollLoop                         ; Loop if time left (sets CF on timeout)
    218218ALIGN JUMP_ALIGN
    219219GetErrorCodeFromPollingToAH:
    220220    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 ;--------------------------------------------------------------------
    233 ALIGN JUMP_ALIGN
    234 InitializeTimeoutWithTicksInCL:
    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 ;       CF:     Set if timeout
    252 ;               Cleared if time left
    253 ;   Corrupts registers:
    254 ;       CX
    255 ;--------------------------------------------------------------------
    256 ALIGN JUMP_ALIGN
    257 SetCFifTimeout:
    258     push    bx
    259     xchg    cx, ax
    260 
    261     mov     bx, RAMVARS.wTimeoutCounter
    262     call    TimerTicks_GetTimeoutTicksLeftToAXfromDSBX
    263 
    264     xchg    ax, cx      ; Restore AX
    265     pop     bx
    266     ret
  • trunk/XTIDE_Universal_BIOS/Src/Main.asm

    r137 r140  
    135135%include "HDrvSel.asm"          ; For selecting drive to access
    136136%include "HCommand.asm"         ; For outputting command and parameters
     137%include "HTimer.asm"           ; For timeout and delay
    137138
    138139; Include .asm files (Interrupt handlers)
Note: See TracChangeset for help on using the changeset viewer.