Changeset 637 in xtideuniversalbios


Ignore:
Timestamp:
May 5, 2026, 10:41:31 AM (9 days ago)
Author:
Krister Nordvall
Message:

Changes:

  • The number of attempts to boot from floppy drives with no floppy inserted has been reduced from 3 to 1. Each attempt can take as much as 3 seconds which means that a total of 9 seconds would be wasted on waiting on the BIOS to stop trying to boot from floppy. This is normally not a problem with most BIOS builds since the default boot drive is C: but with non-interactive builds (builds without MODULE_BOOT_MENU and MODULE_HOTKEYS - e.g. the Tiny build) this delay could be aggravating as the boot order is fixed to first-A-then-C.
  • A few minor optimizations specifically for the 386 builds.
  • Fixed a couple of erroneous comments in IdeIO.asm.
Location:
trunk/XTIDE_Universal_BIOS
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Inc/Revision.inc

    r636 r637  
    1 636
     1637
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIO.asm

    r636 r637  
    9696    test    dl, 1
    9797    jz      SHORT .InputToALfromRegisterInDX
    98     xor     dl, 1001b                       ; Clear A3, Set A0
     98    xor     dl, 1001b                       ; Set A3, Clear A0
    9999%endif
    100100
     
    208208    test    dl, 1
    209209    jz      SHORT OutputALtoRegisterInDX
    210     xor     dl, 1001b                       ; Clear A3, Set A0
     210    xor     dl, 1001b                       ; Set A3, Clear A0
    211211    SKIP2B  bx  ; Skip eSHL_IM dx, 1
    212212%else
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm

    r631 r637  
    44;
    55; XTIDE Universal BIOS and Associated Tools
    6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2025 by XTIDE Universal BIOS Team.
     6; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2026 by XTIDE Universal BIOS Team.
    77;
    88; This program is free software; you can redistribute it and/or modify
     
    108108
    109109    ; Restore system timer tick handler since hotkeys are no longer needed
     110%ifdef USE_386
     111    push    eax         ; Save the high WORD of EAX
     112    mov     eax, [BOOTVARS.hotkeyVars+HOTKEYVARS.fpPrevTimerHandler]
     113    mov     [BIOS_SYSTEM_TIMER_TICK_INTERRUPT_08h*4], eax
     114    pop     eax         ; Restore the high WORD of EAX
     115%else
    110116    cli
    111117    mov     ax, [BOOTVARS.hotkeyVars+HOTKEYVARS.fpPrevTimerHandler]
     
    114120    mov     [BIOS_SYSTEM_TIMER_TICK_INTERRUPT_08h*4+2], ax
    115121    sti
     122%endif
    116123
    117124    pop     ds
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h/BootSector.asm

    r630 r637  
    44;
    55; XTIDE Universal BIOS and Associated Tools
    6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2024 by XTIDE Universal BIOS Team.
     6; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2026 by XTIDE Universal BIOS Team.
    77;
    88; This program is free software; you can redistribute it and/or modify
     
    3737    call    DetectPrint_TryToBootFromDL
    3838    call    BootSector_LoadFirstSectorFromDriveDL
    39     inc     dx                                              ; Determine if hard drive or floppy drive without changing the CF
    40     dec     dl
    4139    jnc     SHORT .FirstSectorLoadedToESBX
    4240
     
    4543    ; display error code every time user intends to boot from hard disk
    4644    ; when A then C boot order is used.
    47     js      SHORT .PrintFailedToLoadErrorCode               ; Hard Drive
    48     cmp     ah, RET_HD_TIMEOUT
    49     je      SHORT BootSector_LoadFirstSectorFromDriveDL.Return
    50     cmp     ah, RET_HD_NOMEDIA
    51     je      SHORT BootSector_LoadFirstSectorFromDriveDL.Return
     45    call    BootSector_DriveDLIsEmptyFloppydrive
     46    jz      SHORT BootSector_LoadFirstSectorFromDriveDL.Return
    5247.PrintFailedToLoadErrorCode:
    5348    jmp     DetectPrint_FailedToLoadFirstSector
    5449
    5550.FirstSectorLoadedToESBX:
     51    test    dl, dl
    5652    jns     SHORT Int19h_JumpToBootSectorInESBXOrRomBoot    ; Don't check for boot sector signature for floppy booter games
    5753    cmp     WORD [es:bx+510], 0AA55h                        ; Valid boot sector?
     
    9187    jz      SHORT .Return                   ; Loop while retries left
    9288
     89    ; If the boot drive is a floppy drive and it is deemed to be empty then
     90    ; we give up immediately to avoid unnecessarily long delays when booting.
     91    ; This is particularly aggravating when using builds with first-A-then-C
     92    ; boot order (i.e. non-interactive builds such as the Tiny build).
     93    call    BootSector_DriveDLIsEmptyFloppydrive
     94    jz      SHORT .Return                   ; With CF set
     95
    9396    ; Reset drive and retry
    9497    xor     ax, ax                          ; AH=00h, Disk Controller Reset
     
    98101    jmp     SHORT .ReadRetryLoop
    99102
     103
     104;--------------------------------------------------------------------
     105; BootSector_DriveDLIsEmptyFloppydrive
     106;   Parameters:
     107;       AH:     INT 13h error code
     108;       DL:     Drive to boot from (translated, 00h or 80h)
     109;   Returns:
     110;       CF:     Set
     111;       ZF:     Set if DL is a floppy drive with no diskette inserted
     112;               Cleared if not
     113;   Corrupts registers:
     114;       Nothing
     115;--------------------------------------------------------------------
     116BootSector_DriveDLIsEmptyFloppydrive:
     117    test    dl, dl
     118    jnz     SHORT .Return                   ; Hard Drive
     119    cmp     ah, RET_HD_TIMEOUT
     120    je      SHORT .Return
     121    cmp     ah, RET_HD_NOMEDIA
     122.Return:
     123    stc
     124    ret
     125
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm

    r636 r637  
    5959;--------------------------------------------------------------------
    6060.InitializeInt13hAnd40h:
     61%ifdef USE_386
     62    push    eax         ; Save the high WORD of EAX
     63%endif
     64
    6165%ifdef MODULE_MFM_COMPATIBILITY
     66%ifdef USE_386
     67    mov     eax, [es:BIOS_DISK_INTERRUPT_13h*4] ; Load old INT 13h vector
     68    mov     [RAMVARS.fpMFMint13h], eax          ; Store old INT 13h vector
     69%else
    6270    mov     ax, [es:BIOS_DISK_INTERRUPT_13h*4+2]; Load old INT 13h segment
    6371    mov     [RAMVARS.fpMFMint13h+2], ax         ; Store old INT 13h segment
     
    6573    mov     ax, [es:BIOS_DISK_INTERRUPT_13h*4]  ; Load old INT 13h offset
    6674    mov     [RAMVARS.fpMFMint13h], ax           ; Store old INT 13h offset
     75%endif ; USE_386
    6776
    6877    mov     [RAMVARS.fpOldI13h+2], cs
    6978    mov     WORD [RAMVARS.fpOldI13h], Int13hMFMcompatibilityHandler
     79%else ; ~MODULE_MFM_COMPATIBILITY
     80%ifdef USE_386
     81    mov     eax, [es:BIOS_DISK_INTERRUPT_13h*4] ; Load old INT 13h vector
     82    mov     [RAMVARS.fpOldI13h], eax            ; Store old INT 13h vector
    7083%else
    7184    mov     ax, [es:BIOS_DISK_INTERRUPT_13h*4+2]; Load old INT 13h segment
     
    7487    mov     ax, [es:BIOS_DISK_INTERRUPT_13h*4]  ; Load old INT 13h offset
    7588    mov     [RAMVARS.fpOldI13h], ax             ; Store old INT 13h offset
     89%endif ; USE_386
    7690%endif
    7791
     
    8195    call    FloppyDrive_IsInt40hInstalled
    8296    jc      SHORT .Int40hAlreadyInstalled
     97%ifdef USE_386
     98    mov     [es:BIOS_DISKETTE_INTERRUPT_40h*4], eax     ; Store old INT 13h vector
     99%else
    83100    mov     [es:BIOS_DISKETTE_INTERRUPT_40h*4], ax      ; Store old INT 13h offset
    84101    mov     [es:BIOS_DISKETTE_INTERRUPT_40h*4+2], dx    ; Store old INT 13h segment
     102%endif
    85103.Int40hAlreadyInstalled:
     104
     105%ifdef USE_386
     106    pop     eax         ; Restore the high WORD of EAX
     107%endif
    86108
    87109    mov     al, BIOS_DISK_INTERRUPT_13h         ; INT 13h interrupt vector offset
Note: See TracChangeset for help on using the changeset viewer.