VOID OptionMenuCustomBoot(VOID)
{
PCSTR CustomBootMenuList[] = {
-#ifdef __i386__
"Disk",
"Partition",
"Boot Sector File",
"ReactOS",
"Linux"
-#endif /* __i386__ */
};
ULONG CustomBootMenuCount = sizeof(CustomBootMenuList) / sizeof(CustomBootMenuList[0]);
ULONG SelectedMenuItem;
switch (SelectedMenuItem)
{
-#ifdef __i386__
case 0: // Disk
OptionMenuCustomBootDisk();
break;
case 4: // Linux
OptionMenuCustomBootLinux();
break;
-#endif /* __i386__ */
}
}
-#ifdef __i386__
VOID OptionMenuCustomBootDisk(VOID)
{
CHAR SectionName[100];
LoadAndBootLinux(SectionName, "Custom Linux Setup");
}
-#endif /* __i386__ */
+
+VOID OptionMenuReboot(VOID)
+{
+ UiMessageBox("The system will now reboot.");
+
+ DiskStopFloppyMotor();
+ SoftReboot();
+}
#include <freeldr.h>
#include <debug.h>
-#ifdef __i386__
BOOLEAN DriveMapInstalled = FALSE; // Tells us if we have already installed our drive map int 13h handler code
ULONG OldInt13HandlerAddress = 0; // Address of BIOS int 13h handler
ULONG DriveMapHandlerAddress = 0; // Linear address of our drive map handler
DriveMapInstalled = FALSE;
}
}
-#endif /* __i386__ */
#include <freeldr.h>
-#ifdef __i386__
VOID LoadAndBootBootSector(PCSTR OperatingSystemName)
{
PFILE FilePointer;
//DisableA20();
ChainLoadBiosBootSectorCode();
}
-#endif /* __i386__ */
<if property="ARCH" value="i386">
<file>_alloca.S</file>
<file>archmach.c</file>
+ <file>custom.c</file>
+ <file>drivemap.c</file>
<file>hardware.c</file>
<file>hwacpi.c</file>
<file>hwapm.c</file>
<file>i386vid.c</file>
<file>loader.c</file>
<file>machpc.c</file>
+ <file>miscboot.c</file>
<file>pccons.c</file>
<file>pcdisk.c</file>
<file>pcmem.c</file>
<directory name="include">
<pch>freeldr.h</pch>
</directory>
- <file>drivemap.c</file>
- <file>miscboot.c</file>
<file>options.c</file>
<file>linuxboot.c</file>
<file>oslist.c</file>
- <file>custom.c</file>
</module>
--- /dev/null
+/*
+ * FreeLoader
+ * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __I386_OPTIONS_H
+#define __I386_OPTIONS_H
+
+#define HAS_OPTION_MENU_CUSTOM_BOOT
+#define HAS_OPTION_MENU_REBOOT
+
+VOID OptionMenuReboot(VOID);
+
+VOID OptionMenuCustomBoot(VOID);
+VOID OptionMenuCustomBootDisk(VOID);
+VOID OptionMenuCustomBootPartition(VOID);
+VOID OptionMenuCustomBootBootSectorFile(VOID);
+VOID OptionMenuCustomBootReactOS(VOID);
+VOID OptionMenuCustomBootLinux(VOID);
+
+#endif // #defined __I386_OPTIONS_H
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __DRIVEMAP_H
-#define __DRIVEMAP_H
+#ifndef __I386_DRIVEMAP_H
+#define __I386_DRIVEMAP_H
-#ifdef __i386__
#include <pshpack1.h>
typedef struct
{
extern PVOID DriveMapInt13HandlerEnd;
extern ULONG DriveMapOldInt13HandlerAddress;
extern DRIVE_MAP_LIST DriveMapInt13HandlerMapList;
-#endif /* __i386__ */
-#endif // #defined __DRIVEMAP_H
+#endif // #defined __I386_DRIVEMAP_H
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __BOOT_H
-#define __BOOT_H
+#ifndef __I386_BOOT_H
+#define __I386_BOOT_H
-#ifdef __i386__
VOID LoadAndBootBootSector(PCSTR OperatingSystemName);
VOID LoadAndBootPartition(PCSTR OperatingSystemName);
VOID LoadAndBootDrive(PCSTR OperatingSystemName);
-#endif /* __i386__ */
-#endif // defined __BOOT_H
+#endif // defined __I386_BOOT_H
#include <ui/tui.h>
/* arch files */
#if defined(_M_IX86)
+#include <arch/i386/custom.h>
+#include <arch/i386/drivemap.h>
#include <arch/i386/hardware.h>
#include <arch/i386/i386.h>
#include <arch/i386/machpc.h>
#include <arch/i386/machxbox.h>
+#include <arch/i386/miscboot.h>
#include <internal/i386/intrin_i.h>
#include <internal/i386/ke.h>
#elif defined(_M_PPC)
/* Needed by boot manager */
#include <bootmgr.h>
#include <oslist.h>
-#include <drivemap.h>
-#include <miscboot.h>
#include <options.h>
#include <linux.h>
/* Externals */
VOID DoOptionsMenu(VOID);
-VOID OptionMenuReboot(VOID);
-
-VOID OptionMenuCustomBoot(VOID);
-#ifdef __i386__
-VOID OptionMenuCustomBootDisk(VOID);
-VOID OptionMenuCustomBootPartition(VOID);
-VOID OptionMenuCustomBootBootSectorFile(VOID);
-VOID OptionMenuCustomBootReactOS(VOID);
-VOID OptionMenuCustomBootLinux(VOID);
-#endif /* __i386__ */
-
#endif // #defined __OPTIONS_H
"SEPARATOR",
+#ifdef HAS_OPTION_MENU_CUSTOM_BOOT
"Custom Boot",
+#endif
+#ifdef HAS_OPTION_MENU_REBOOT
"Reboot",
+#endif
};
enum OptionMenuItems
SEPARATOR2 = 9,
+#ifdef HAS_OPTION_MENU_CUSTOM_BOOT
CUSTOM_BOOT = 10,
+#endif
+#ifdef HAS_OPTION_MENU_REBOOT
REBOOT = 11,
+#endif
};
ULONG OptionsMenuItemCount = sizeof(OptionsMenuList) / sizeof(OptionsMenuList[0]);
break;
//case SEPARATOR2:
// break;
+#ifdef HAS_OPTION_MENU_CUSTOM_BOOT
case CUSTOM_BOOT:
OptionMenuCustomBoot();
break;
+#endif
+#ifdef HAS_OPTION_MENU_REBOOT
case REBOOT:
OptionMenuReboot();
break;
}
-}
-
-VOID OptionMenuReboot(VOID)
-{
- UiMessageBox("The system will now reboot.");
-
-#ifdef __i386__
- DiskStopFloppyMotor();
- SoftReboot();
-#else
#endif
}