EXTERN BootMain:PROC
// EXTERN cmdline:DWORD
+EXTERN DiskStopFloppyMotor:PROC
+
#ifdef _USE_ML
EXTERN __bss_start__:FWORD
EXTERN __bss_end__:FWORD
PUBLIC Reboot
Reboot:
+ /* Stop the floppy drive motor */
+ call DiskStopFloppyMotor
+
/* Set the function ID */
mov bx, FNID_Reboot
/* Store the 1-byte truncated partition number in DH */
mov dh, al
+ /*
+ * Don't stop the floppy drive motor when we are just booting a bootsector,
+ * a drive, or a partition. If we were to stop the floppy motor, the BIOS
+ * wouldn't be informed and if the next read is to a floppy then the BIOS
+ * will still think the motor is on and this will result in a read error.
+ */
+ // call DiskStopFloppyMotor
+
/* Set the function ID */
mov bx, FNID_ChainLoadBiosBootSectorCode
jmp SwitchToReal
+/*
+ * U16 PxeCallApi(U16 Segment, U16 Offset, U16 Service, VOID *Parameter);
+ *
+ * RETURNS:
+ */
PUBLIC PxeCallApi
PxeCallApi:
xor eax, eax
/* FUNCTIONS ******************************************************************/
-VOID DiskStopFloppyMotor(VOID)
-{
-}
-
VOID
FrLdrCheckCpuCompatibility(VOID)
{
//EXTERN _i386idtptr:FWORD
EXTERN cmdline:DWORD
+EXTERN _DiskStopFloppyMotor:PROC
+
#ifdef _USE_ML
EXTERN __bss_start__:DWORD
EXTERN __bss_end__:DWORD
PUBLIC _Reboot
_Reboot:
+ /* Stop the floppy drive motor */
+ call _DiskStopFloppyMotor
+
/* Set the function ID */
mov bx, FNID_Reboot
/* Store the 1-byte truncated partition number in DH */
mov dh, al
+ /*
+ * Don't stop the floppy drive motor when we are just booting a bootsector,
+ * a drive, or a partition. If we were to stop the floppy motor, the BIOS
+ * wouldn't be informed and if the next read is to a floppy then the BIOS
+ * will still think the motor is on and this will result in a read error.
+ */
+ // call _DiskStopFloppyMotor
+
/* Set the function ID */
mov bx, FNID_ChainLoadBiosBootSectorCode
#include <asm.inc>
#include <arch/pc/x86common.h>
+EXTERN _DiskStopFloppyMotor:PROC
EXTERN i386CallRealMode:PROC
.code32
PUBLIC _BootNewLinuxKernel
_BootNewLinuxKernel:
+ /* Stop the floppy drive motor */
+ call _DiskStopFloppyMotor
mov bx, FNID_BootLinuxKernel
call i386CallRealMode
return TRUE;
}
-VOID DiskStopFloppyMotor(VOID)
+#if defined(__i386__) || defined(_M_AMD64)
+VOID __cdecl DiskStopFloppyMotor(VOID)
{
- WRITE_PORT_UCHAR((PUCHAR)0x3F2, 0);
+ WRITE_PORT_UCHAR((PUCHAR)0x3F2, 0x0C); // DOR_FDC_ENABLE | DOR_DMA_IO_INTERFACE_ENABLE
}
+#endif // defined __i386__ || defined(_M_AMD64)
BOOLEAN DiskGetExtendedDriveParameters(UCHAR DriveNumber, PVOID Buffer, USHORT BufferSize)
{
SetPhysByte(((ULONG)Address)+0x80000000, Value);
}
-void DiskStopFloppyMotor() {
-}
-
void BootOldLinuxKernel( unsigned long size ) {
ofw_exit();
}
#include "int386.inc"
+#include "helpers.inc"
#include "pxe.inc"
#include "pnp.inc"
-#include "helpers.inc"
.org (FREELDR_PE_BASE - FREELDR_BASE - 1)
.byte 0
.long 0 /* Base Address */
#include "int386.inc"
+#include "helpers.inc"
#include "pxe.inc"
#include "pnp.inc"
#include "linux.inc"
-#include "helpers.inc"
.org (FREELDR_PE_BASE - FREELDR_BASE - 1)
.byte 0
VOID OptionMenuReboot(VOID)
{
UiMessageBox("The system will now reboot.");
-
-#if defined(__i386__) || defined(_M_AMD64)
- DiskStopFloppyMotor();
-#endif
Reboot();
}
Quit:
/* If we reach this point, something went wrong before, therefore reboot */
-#if defined(__i386__) || defined(_M_AMD64)
- DiskStopFloppyMotor();
-#endif
Reboot();
}
//
///////////////////////////////////////////////////////////////////////////////////////
#if defined(__i386__) || defined(_M_AMD64)
-VOID DiskStopFloppyMotor(VOID);
+VOID __cdecl DiskStopFloppyMotor(VOID);
#endif // defined __i386__ || defined(_M_AMD64)
/* Buffer for disk reads (hwdisk.c) */
UiUnInitialize("Booting Linux...");
IniCleanup();
- DiskStopFloppyMotor();
-
if (LinuxSetupSector->LoadFlags & LINUX_FLAG_LOAD_HIGH)
BootNewLinuxKernel();
else
UiUnInitialize("Booting...");
IniCleanup();
- /*
- * Don't stop the floppy drive motor when we
- * are just booting a bootsector, or drive, or partition.
- * If we were to stop the floppy motor then
- * the BIOS wouldn't be informed and if the
- * next read is to a floppy then the BIOS will
- * still think the motor is on and this will
- * result in a read error.
- */
- // DiskStopFloppyMotor();
ChainLoadBiosBootSectorCode(0 /*DriveNumber*/, 0 /*PartitionNumber*/);
/* Must not return! */
return ESUCCESS;
UiUnInitialize("Booting...");
IniCleanup();
- /*
- * Don't stop the floppy drive motor when we
- * are just booting a bootsector, or drive, or partition.
- * If we were to stop the floppy motor then
- * the BIOS wouldn't be informed and if the
- * next read is to a floppy then the BIOS will
- * still think the motor is on and this will
- * result in a read error.
- */
- // DiskStopFloppyMotor();
ChainLoadBiosBootSectorCode(DriveNumber, PartitionNumber);
/* Must not return! */
return ESUCCESS;