- Effectively reboot instead of exiting the bootloader and hanging.
- Do a cold reboot instead of a (soft) warm reboot, to let the user be able to choose another boot support or do anything else, instead of directly rebooting to the bootloader. Rename the concerned function accordingly.
svn path=/trunk/; revision=57935
UiMessageBox("The system will now reboot.");
DiskStopFloppyMotor();
- SoftReboot();
+ Reboot();
}
ret
-PUBLIC _SoftReboot
-_SoftReboot:
+PUBLIC _Reboot
+_Reboot:
/* Set the function ID */
- mov bx, FNID_SoftReboot
+ mov bx, FNID_Reboot
/*Switch to real mode (We don't return) */
jmp SwitchToReal
/* Wait for a keypress */
int HEX(16)
- jmp SoftReboot
+ jmp Reboot
Msg_Unsupported:
.ascii "This CPU is not supported.", CR, LF
.long 0, 0
int HEX(16)
- jmp SoftReboot
+ jmp Reboot
CallbackTable:
.word Int386
- .word SoftReboot
+ .word Reboot
.word ChainLoadBiosBootSectorCode
.word PxeCallApi
.word PnpBiosGetDeviceNodeCount
popfd\r
ret\r
\r
-SoftReboot:\r
- mov ax, HEX(40)\r
- mov ds, ax\r
- mov si, HEX(72)\r
+Reboot:\r
+ cli\r
\r
- /* Set the word at location 40:72 to 1234h */\r
- mov word ptr [si], HEX(1234)\r
+ /* Set the word at location 40h:72h to 0 (cold reboot) */\r
+ mov word ptr ds:[HEX(0472)], HEX(0)\r
\r
- /* and jump to location FFFF:0 in ROM */\r
- ljmp16 HEX(0FFFF), HEX(0000)\r
+ /* and jump to location F000h:FFF0h in ROM */\r
+ ljmp16 HEX(0F000), HEX(0FFF0)\r
\r
\r
ChainLoadBiosBootSectorCode:\r
-\r
/* Load segment registers */\r
cli\r
xor ax, ax\r
mov esp, HEX(7C00)\r
\r
/* Jump to the bootsector code */\r
- ljmp16 HEX(0000), HEX(7C00)\r
+ ljmp16 HEX(0000), HEX(7C00)\r
callback_table:
.word Int386
- .word SoftReboot
+ .word Reboot
.word ChainLoadBiosBootSectorCode
.word PxeCallApi
.word PnpBiosGetDeviceNodeCount
if (!UiInitialize(FALSE))
{
UiMessageBoxCritical("Unable to initialize UI.\n");
- return;
+ goto quit;
}
if (!MmInitializeMemoryManager())
{
UiMessageBoxCritical("Unable to initialize memory manager");
- return;
+ goto quit;
}
#ifdef _M_IX86
HalpInitBusHandler();
#endif
RunLoader();
+
+quit:
+ /* If we reach this point, something went wrong before, therefore reboot */
+ DiskStopFloppyMotor();
+ Reboot();
}
// We need to emulate these, because the original ones don't work in freeldr
void EnableA20(void);
VOID ChainLoadBiosBootSectorCode(VOID); // Implemented in boot.S
-VOID SoftReboot(VOID); // Implemented in boot.S
+VOID Reboot(VOID); // Implemented in boot.S
VOID DetectHardware(VOID); // Implemented in hardware.c
#endif /* ! __ASM__ */
/* Realmode function IDs */
#define FNID_Int386 0
-#define FNID_SoftReboot 1
+#define FNID_Reboot 1
#define FNID_ChainLoadBiosBootSectorCode 2
#define FNID_PxeCallApi 3
#define FNID_PnpBiosGetDeviceNodeCount 4
BOOLEAN TuiInitialize(VOID)
{
- MachVideoClearScreen(ATTR(COLOR_WHITE, COLOR_BLACK));
MachVideoHideShowTextCursor(FALSE);
+ MachVideoClearScreen(ATTR(COLOR_GRAY, COLOR_BLACK));
TextVideoBuffer = VideoAllocateOffScreenBuffer();
if (TextVideoBuffer == NULL)
MachVideoSetDisplayMode(NULL, FALSE);
}
- //VideoClearScreen();
+ MachVideoClearScreen(ATTR(COLOR_GRAY, COLOR_BLACK));
MachVideoHideShowTextCursor(TRUE);
}
VOID UiUnInitialize(PCSTR BootText)
{
UiDrawBackdrop();
- UiDrawStatusText("Booting...");
+ UiDrawStatusText(BootText);
UiInfoBox(BootText);
UiVtbl.UnInitialize();