Changeset 492 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers
- Timestamp:
- Dec 21, 2012, 1:01:55 AM (12 years ago)
- google:author:
- gregli@hotmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Handlers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm
r417 r492 104 104 ;-------------------------------------------------------------------- 105 105 SelectDriveToBootFrom: 106 %ifdef MODULE_HOTKEYS 107 call HotkeyBar_UpdateDuringDriveDetection 108 106 107 ; The following macro could be easily inlined below. Why a macro? Depending on the combination 108 ; of MODULE_HOTKEYS or MODULE_BOOT_MENU, this code needs to either come before or after the 109 ; call to the boot menu. 110 ; 111 %macro TRY_TO_BOOT_DL_AND_DH_DRIVES 0 112 push dx ; it's OK if this is left on the stack, if we are 113 ; are successful, the following call does not return 114 call TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot 115 pop dx 116 mov dl, dh 117 call TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot 118 %endmacro 119 120 %ifdef MODULE_HOTKEYS 121 call HotkeyBar_ScanHotkeysFromKeyBufferAndStoreToBootvars 122 cmp al, ROM_BOOT_HOTKEY_SCANCODE 123 jz JumpToBootSector_or_RomBoot ; CF clear so ROM boot 109 124 %ifdef MODULE_BOOT_MENU 110 mov di, BOOTVARS.hotkeyVars+HOTKEYVARS.bScancode 111 cmp BYTE [es:di], BOOT_MENU_HOTKEY_SCANCODE 112 jne SHORT .DoNotDisplayBootMenu 113 114 ; Stop blinking the Boot Menu hotkey and display menu 115 mov BYTE [es:di], 0 116 call HotkeyBar_DrawToTopOfScreen 117 call BootMenu_DisplayAndStoreSelectionAsHotkey 118 .DoNotDisplayBootMenu: 119 %endif 120 121 ; Check if ROM boot (INT 18h) wanted 122 cmp BYTE [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bScancode], ROM_BOOT_HOTKEY_SCANCODE 123 je SHORT JumpToBootSector_or_RomBoot ; CF clear so ROM boot 124 125 ; Get Primary boot drive number to DL 126 call HotkeyBar_GetPrimaryBootDriveNumberToDL 125 cmp al, BOOT_MENU_HOTKEY_SCANCODE 126 jz .BootMenu 127 %endif 128 call HotkeyBar_GetBootDriveNumbersToDX 129 .TryUsingHotKeysCode: 130 TRY_TO_BOOT_DL_AND_DH_DRIVES 131 ;; falls through to boot menu, if it is present. If not present, falls through to rom boot. 132 %endif 133 134 %ifdef MODULE_BOOT_MENU 135 .BootMenu: 136 call BootMenu_DisplayAndReturnDriveInDLRomBootClearCF 137 jnc JumpToBootSector_or_RomBoot ; CF clear so ROM boot 138 139 mov dh, dl ; Setup for secondary drive 140 not dh ; Floppy goes to HD, or vice veras 141 and dh, 080h ; Go to first drive of the floppy or HD set 142 143 %ifdef MODULE_HOTKEYS 144 jmp .TryUsingHotKeysCode 127 145 %else 146 TRY_TO_BOOT_DL_AND_DH_DRIVES 147 jmp .BootMenu 148 %endif 149 %endif 150 151 %ifndef MODULE_HOTKEYS 152 %ifndef MODULE_BOOT_MENU 128 153 xor dl, dl ; Try to boot from Floppy Drive A 129 %endif ; MODULE_HOTKEYS 130 131 ; Try to boot from Primary boot drive (00h by default) 132 call TryToBootFromPrimaryOrSecondaryBootDevice 133 jc SHORT JumpToBootSector_or_RomBoot 134 135 ; Try to boot from Secondary boot device (80h by default) 136 %ifdef MODULE_HOTKEYS 137 call HotkeyBar_GetSecondaryBootDriveNumberToDL 138 %else 154 call TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot 139 155 mov dl, 80h ; Try to boot from Hard Drive C 140 %endif 141 call TryToBootFromPrimaryOrSecondaryBootDevice 142 143 %ifdef MODULE_BOOT_MENU 144 ; Force Boot Menu hotkey to display boot menu 145 mov BYTE [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bScancode], BOOT_MENU_HOTKEY_SCANCODE 146 jnc SHORT SelectDriveToBootFrom 147 %endif 148 ; Fall to JumpToBootSector_or_RomBoot 149 156 call TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot 157 %endif 158 %endif 159 160 %ifndef MODULE_BOOT_MENU 161 clc ; fall through with flag for ROM boot. Boot Menu goes back to menu and doesn't fall through. 162 %endif 150 163 151 164 ;-------------------------------------------------------------------- … … 203 216 ; AX, CX, DH, SI, DI, (DL if failed to read boot sector) 204 217 ;-------------------------------------------------------------------- 205 %ifndef MODULE_ HOTKEYS206 TryToBootFromPrimaryOrSecondaryBootDevice EQU BootSector_TryToLoadFromDriveDL218 %ifndef MODULE_DRIVEXLATE 219 TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot EQU BootSector_TryToLoadFromDriveDL_AndBoot 207 220 208 221 %else 209 TryToBootFromPrimaryOrSecondaryBootDevice :222 TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot: 210 223 call DriveXlate_SetDriveToSwap 211 224 call DriveXlate_ToOrBack 212 jmp BootSector_TryToLoadFromDriveDL 213 %endif 225 ; fall through to TryToBoot_FallThroughTo_BootSector_TryToLoadFromDriveDL_AndBoot 226 227 TryToBoot_FallThroughTo_BootSector_TryToLoadFromDriveDL_AndBoot: 228 ; fall through to BootSector_TryToLoadFromDriveDL_AndBoot 229 %endif 230 231 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h/BootSector.asm
r428 r492 33 33 ; AX, CX, DH, SI, DI, (DL if failed to read boot sector) 34 34 ;-------------------------------------------------------------------- 35 BootSector_TryToLoadFromDriveDL :35 BootSector_TryToLoadFromDriveDL_AndBoot: 36 36 call DetectPrint_TryToBootFromDL 37 37 call LoadFirstSectorFromDriveDL … … 44 44 .AlwaysBootFromFloppyDriveForBooterGames: 45 45 stc 46 ret46 jmp SHORT JumpToBootSector_or_RomBoot 47 47 .FailedToLoadFirstSector: 48 48 call DetectPrint_FailedToLoadFirstSector 49 clc50 49 ret 51 50 .FirstHardDiskSectorNotBootable: 52 51 mov si, g_szBootSectorNotFound 53 52 call DetectPrint_NullTerminatedStringFromCSSIandSetCF 54 clc55 53 ret 54 55 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 56 %ifdef MODULE_DRIVEXLATE 57 %if TryToBoot_FallThroughTo_BootSector_TryToLoadFromDriveDL_AndBoot <> BootSector_TryToLoadFromDriveDL_AndBoot 58 %error "TryToBoot_FallThroughTo_BootSector_TryToLoadFromDriveDL_AndBoot <> BootSector_TryToLoadFromDriveDL_AndBoot, BootSector must come immediately after int19h.asm" 59 %endif 60 %endif 61 %endif 56 62 57 63 ;--------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.