Changeset 212 in xtideuniversalbios
- Timestamp:
- Jan 16, 2012, 8:50:39 PM (13 years ago)
- google:author:
- gregli@hotmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuEvent.asm
r202 r212 128 128 cmp ah, ROM_BOOT_HOTKEY_SCANCODE 129 129 jne SHORT .CheckDriveHotkeys 130 jmp Int19hMenu_RomBoot 130 ;; NOTE: carry flag will be clear after compare above that resulted in zero 131 jmp Int19hMenu_JumpToBootSector_or_RomBoot 131 132 ALIGN JUMP_ALIGN 132 133 .CheckDriveHotkeys: -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19hMenu.asm
r152 r212 55 55 call BootSector_TryToLoadFromDriveDL 56 56 jnc SHORT .ProcessMenuSelectionsUntilBootable ; Boot failure, show menu again 57 SWITCH_BACK_TO_POST_STACK58 ; Fall to JumpToBootSector57 ; Fall to Int19hMenu_JumpToBootSector_or_RomBoot 58 ; (CF is set or we wouldn't be here, see "jnc" immediately above) 59 59 60 60 ;-------------------------------------------------------------------- 61 ; JumpToBootSector 61 ; Int19hMenu_JumpToBootSector_or_RomBoot 62 ; 63 ; Switches back to the POST stack, clears the DS and ES registers, 64 ; and either jumps to the MBR (Master Boot Record) that was just read, 65 ; or calls the ROM's boot routine on interrupt 18. 66 ; 62 67 ; Parameters: 63 68 ; DL: Drive to boot from (translated, 00h or 80h) 64 ; ES:BX: Ptr to boot sector 69 ; CF: Set for Boot Sector Boot 70 ; Clear for Rom Boot 71 ; ES:BX: (if CF set) Ptr to boot sector 72 ; 65 73 ; Returns: 66 74 ; Never returns 67 75 ;-------------------------------------------------------------------- 68 76 ALIGN JUMP_ALIGN 69 JumpToBootSector: 70 push es ; Push boot sector segment 71 push bx ; Push boot sector offset 72 call ClearSegmentsForBoot 73 retf 77 Int19hMenu_JumpToBootSector_or_RomBoot: 78 mov cx,es ; preserve MBR segment 79 ; 80 ; inline of SWITCH_BACK_TO_POST_STACK macro, so that we can preserve CF 81 ; and reuse zero value in ax for clearing segment registers 82 ; 83 mov ax,0 ; NOTE: can't use XOR as it impacts CF 84 %ifndef USE_386 85 cli 86 mov ss,ax 87 mov sp,[ss:BOOTVARS.dwPostStack] 88 mov ss,[ss:BOOTVARS.dwPostStack+2] 89 sti 90 %else 91 mov ss,ax 92 lss sp,[ss:BOOTVARS.dwPostStack] 93 %endif 94 ; 95 ; end inline of SWITCH_BACK_TO_POST_STACK 96 ; 74 97 98 ; clear segment registers before boot sector or rom call 99 ; (old ClearSegmentsForBoot routine) 100 ; 101 mov ds,ax 102 mov es,ax 75 103 76 ;-------------------------------------------------------------------- 77 ; Int19hMenu_RomBoot 78 ; Parameters: 79 ; DS: RAMVARS segment 80 ; Returns: 81 ; Never returns 82 ;-------------------------------------------------------------------- 83 ALIGN JUMP_ALIGN 84 Int19hMenu_RomBoot: 85 SWITCH_BACK_TO_POST_STACK 86 call ClearSegmentsForBoot 87 int BIOS_BOOT_FAILURE_INTERRUPT_18h ; Never returns 104 jnc .romboot 88 105 106 ; jump to boot sector 107 ; (old JumpToBootSector routine) 108 ; 109 push cx ; sgment address for MBR 110 push bx ; offset address for MBR 111 retf ; NOTE: DL is set to the drive number 89 112 90 ;-------------------------------------------------------------------- 91 ; ClearSegmentsForBoot 92 ; Parameters: 93 ; Nothing 94 ; Returns: 95 ; DX: Zero 96 ; DS=ES: Zero 97 ; Corrupts registers: 98 ; Nothing 99 ;-------------------------------------------------------------------- 100 ALIGN JUMP_ALIGN 101 ClearSegmentsForBoot: 102 xor dx, dx ; Device supported by INT 13h 103 mov ds, dx 104 mov es, dx 105 ret 113 ; (old Int19hMenu_RomBoot routine) 114 ; 115 .romboot: 116 int BIOS_BOOT_FAILURE_INTERRUPT_18h ; Never returns
Note:
See TracChangeset
for help on using the changeset viewer.