Changeset 528 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers


Ignore:
Timestamp:
Mar 22, 2013, 5:43:54 PM (12 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Swapping Floppy and Hard Drives at the same time work again (broke in r492).
  • Hotkeys again work in boot menu (broke in r492).
Location:
trunk/XTIDE_Universal_BIOS/Src/Handlers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm

    r526 r528  
    103103;       Never returns (loads operating system)
    104104;--------------------------------------------------------------------
    105 SelectDriveToBootFrom:
    106 
    107105; The following macro could be easily inlined below.  Why a macro?  Depending on the combination
    108106; of MODULE_HOTKEYS or MODULE_BOOT_MENU, this code needs to either come before or after the
     
    112110    push    dx                                  ; it's OK if this is left on the stack, if we are
    113111                                                ; successful, the following call does not return
    114     call    TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot
     112    call    BootSector_TryToLoadFromDriveDL_AndBoot
    115113    pop     dx
    116114    mov     dl, dh
    117     call    TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot
     115    call    BootSector_TryToLoadFromDriveDL_AndBoot
    118116%endmacro
    119117
    120 %ifdef MODULE_HOTKEYS
    121     call    HotkeyBar_ScanHotkeysFromKeyBufferAndStoreToBootvars
     118
     119SelectDriveToBootFrom:      ; Function starts here
     120%ifdef MODULE_HOTKEYS
     121    call    HotkeyBar_UpdateDuringDriveDetection
     122    mov     al, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bScancode]
    122123    cmp     al, ROM_BOOT_HOTKEY_SCANCODE
    123     je      .RomBoot                            ; CF clear so ROM boot
     124    je      SHORT .RomBoot                      ; CF clear so ROM boot
    124125%ifdef MODULE_BOOT_MENU
    125126    cmp     al, BOOT_MENU_HOTKEY_SCANCODE
    126     je      .BootMenu
    127 %endif
     127    je      SHORT .BootMenu
     128%endif ; MODULE_BOOT_MENU
     129
     130.TryUsingHotKeysCode:
    128131    call    HotkeyBar_GetBootDriveNumbersToDX
    129 .TryUsingHotKeysCode:
     132    call    DriveXlate_SetDriveToSwap           ; Enable primary boot device translation
     133    xchg    dl, dh
     134    call    DriveXlate_SetDriveToSwap           ; Enable secondary boot device translation
     135    xchg    dl, dh
     136    call    DriveXlate_ToOrBack                 ; Tranlate now so boot device will appear as 00h or 80h to OS
    130137    TRY_TO_BOOT_DL_AND_DH_DRIVES
    131138    ;; falls through to boot menu, if it is present.  If not present, falls through to rom boot.
    132139%endif ; MODULE_HOTKEYS
    133140
     141
    134142%ifdef MODULE_BOOT_MENU
    135143.BootMenu:
    136144    call    BootMenu_DisplayAndReturnDriveInDLRomBootClearCF
    137     jnc     .RomBoot                            ; CF clear so ROM boot
    138 
     145    jnc     SHORT .RomBoot                      ; CF clear so ROM boot
     146
     147    call    DriveXlate_Reset
     148%ifdef MODULE_HOTKEYS
     149    jmp     SHORT .TryUsingHotKeysCode          ; Selected drive stored as hotkey
     150%else ; Boot menu without hotkeys, secondary boot drive is always 00h or 80h
    139151    mov     dh, dl                              ; Setup for secondary drive
    140152    not     dh                                  ; Floppy goes to HD, or vice versa
    141153    and     dh, 80h                             ; Go to first drive of the floppy or HD set
    142 
    143 %ifdef MODULE_HOTKEYS
    144     jmp     .TryUsingHotKeysCode
    145 %else
     154    call    DriveXlate_SetDriveToSwap
     155    call    DriveXlate_ToOrBack
    146156    TRY_TO_BOOT_DL_AND_DH_DRIVES
    147     jmp     .BootMenu
    148 %endif
     157    jmp     SHORT .BootMenu                     ; Show boot menu again
     158%endif ; MODULE_HOTKEYS
     159
    149160%endif ; MODULE_BOOT_MENU
    150161
     162; No hotkeys and no boot menu means fixed "A then C" boot order
    151163%ifndef MODULE_HOTKEYS OR MODULE_BOOT_MENU
    152     xor     dl, dl          ; Try to boot from Floppy Drive A
    153     call    TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot
    154     mov     dl, 80h         ; Try to boot from Hard Drive C
    155     call    TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot
     164    xor     dl, dl                          ; Try to boot from Floppy Drive A
     165    call    BootSector_TryToLoadFromDriveDL_AndBoot
     166    mov     dl, DEFAULT_HARD_DRIVE_LETTER   ; Try to boot from Hard Drive C
     167    call    BootSector_TryToLoadFromDriveDL_AndBoot
    156168%endif
    157169
     
    201213.romboot:
    202214    int     BIOS_BOOT_FAILURE_INTERRUPT_18h ; Never returns
    203 
    204 
    205 ;--------------------------------------------------------------------
    206 ; TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot
    207 ;   Parameters
    208 ;       DL:     Drive selected as boot device
    209 ;       DS:     RAMVARS segment
    210 ;       ES:     BDA and interrupt vector segment (zero)
    211 ;   Returns:
    212 ;       DL:     Drive to boot from (translated, 00h or 80h)
    213 ;       CF:     Set for Boot Sector Boot
    214 ;               Clear for ROM Boot
    215 ;       ES:BX:  (if CF set) Ptr to boot sector
    216 ;   Corrupts registers:
    217 ;       AX, CX, DH, SI, DI, (DL if failed to read boot sector)
    218 ;--------------------------------------------------------------------
    219 %ifndef MODULE_DRIVEXLATE
    220 TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot   EQU     BootSector_TryToLoadFromDriveDL_AndBoot
    221 
    222 %else
    223 TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot:
    224     call    DriveXlate_SetDriveToSwap
    225     call    DriveXlate_ToOrBack
    226     ; fall through to TryToBoot_FallThroughTo_BootSector_TryToLoadFromDriveDL_AndBoot
    227 
    228 TryToBoot_FallThroughTo_BootSector_TryToLoadFromDriveDL_AndBoot:
    229 ; fall through to BootSector_TryToLoadFromDriveDL_AndBoot
    230 %endif
    231 
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h/BootSector.asm

    r526 r528  
    7373    ret
    7474
    75 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
    76   %ifdef MODULE_DRIVEXLATE
    77     %if TryToBoot_FallThroughTo_BootSector_TryToLoadFromDriveDL_AndBoot <> BootSector_TryToLoadFromDriveDL_AndBoot
    78       %error "TryToBoot_FallThroughTo_BootSector_TryToLoadFromDriveDL_AndBoot <> BootSector_TryToLoadFromDriveDL_AndBoot, BootSector must come immediately after int19h.asm"
    79     %endif
    80   %endif
    81 %endif
    8275
    8376;--------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.