Changeset 528 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers
- Timestamp:
- Mar 22, 2013, 5:43:54 PM (12 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Handlers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm
r526 r528 103 103 ; Never returns (loads operating system) 104 104 ;-------------------------------------------------------------------- 105 SelectDriveToBootFrom:106 107 105 ; The following macro could be easily inlined below. Why a macro? Depending on the combination 108 106 ; of MODULE_HOTKEYS or MODULE_BOOT_MENU, this code needs to either come before or after the … … 112 110 push dx ; it's OK if this is left on the stack, if we are 113 111 ; successful, the following call does not return 114 call TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot112 call BootSector_TryToLoadFromDriveDL_AndBoot 115 113 pop dx 116 114 mov dl, dh 117 call TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot115 call BootSector_TryToLoadFromDriveDL_AndBoot 118 116 %endmacro 119 117 120 %ifdef MODULE_HOTKEYS 121 call HotkeyBar_ScanHotkeysFromKeyBufferAndStoreToBootvars 118 119 SelectDriveToBootFrom: ; Function starts here 120 %ifdef MODULE_HOTKEYS 121 call HotkeyBar_UpdateDuringDriveDetection 122 mov al, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bScancode] 122 123 cmp al, ROM_BOOT_HOTKEY_SCANCODE 123 je .RomBoot; CF clear so ROM boot124 je SHORT .RomBoot ; CF clear so ROM boot 124 125 %ifdef MODULE_BOOT_MENU 125 126 cmp al, BOOT_MENU_HOTKEY_SCANCODE 126 je .BootMenu 127 %endif 127 je SHORT .BootMenu 128 %endif ; MODULE_BOOT_MENU 129 130 .TryUsingHotKeysCode: 128 131 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 130 137 TRY_TO_BOOT_DL_AND_DH_DRIVES 131 138 ;; falls through to boot menu, if it is present. If not present, falls through to rom boot. 132 139 %endif ; MODULE_HOTKEYS 133 140 141 134 142 %ifdef MODULE_BOOT_MENU 135 143 .BootMenu: 136 144 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 139 151 mov dh, dl ; Setup for secondary drive 140 152 not dh ; Floppy goes to HD, or vice versa 141 153 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 146 156 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 149 160 %endif ; MODULE_BOOT_MENU 150 161 162 ; No hotkeys and no boot menu means fixed "A then C" boot order 151 163 %ifndef MODULE_HOTKEYS OR MODULE_BOOT_MENU 152 xor dl, dl ; Try to boot from Floppy Drive A153 call TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot154 mov dl, 80h; Try to boot from Hard Drive C155 call TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot164 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 156 168 %endif 157 169 … … 201 213 .romboot: 202 214 int BIOS_BOOT_FAILURE_INTERRUPT_18h ; Never returns 203 204 205 ;--------------------------------------------------------------------206 ; TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot207 ; Parameters208 ; DL: Drive selected as boot device209 ; DS: RAMVARS segment210 ; 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 Boot214 ; Clear for ROM Boot215 ; ES:BX: (if CF set) Ptr to boot sector216 ; Corrupts registers:217 ; AX, CX, DH, SI, DI, (DL if failed to read boot sector)218 ;--------------------------------------------------------------------219 %ifndef MODULE_DRIVEXLATE220 TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot EQU BootSector_TryToLoadFromDriveDL_AndBoot221 222 %else223 TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot:224 call DriveXlate_SetDriveToSwap225 call DriveXlate_ToOrBack226 ; fall through to TryToBoot_FallThroughTo_BootSector_TryToLoadFromDriveDL_AndBoot227 228 TryToBoot_FallThroughTo_BootSector_TryToLoadFromDriveDL_AndBoot:229 ; fall through to BootSector_TryToLoadFromDriveDL_AndBoot230 %endif231 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h/BootSector.asm
r526 r528 73 73 ret 74 74 75 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS76 %ifdef MODULE_DRIVEXLATE77 %if TryToBoot_FallThroughTo_BootSector_TryToLoadFromDriveDL_AndBoot <> BootSector_TryToLoadFromDriveDL_AndBoot78 %error "TryToBoot_FallThroughTo_BootSector_TryToLoadFromDriveDL_AndBoot <> BootSector_TryToLoadFromDriveDL_AndBoot, BootSector must come immediately after int19h.asm"79 %endif80 %endif81 %endif82 75 83 76 ;--------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.