diff --git a/reactos/boot/freeldr/freeldr/custom.c b/reactos/boot/freeldr/freeldr/arch/i386/custom.c similarity index 98% rename from reactos/boot/freeldr/freeldr/custom.c rename to reactos/boot/freeldr/freeldr/arch/i386/custom.c index b838de91aa0..14e651df785 100644 --- a/reactos/boot/freeldr/freeldr/custom.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/custom.c @@ -34,13 +34,11 @@ const CHAR CustomBootPrompt[] = "Press ENTER to boot your custom boot setup."; 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; @@ -53,7 +51,6 @@ VOID OptionMenuCustomBoot(VOID) switch (SelectedMenuItem) { -#ifdef __i386__ case 0: // Disk OptionMenuCustomBootDisk(); break; @@ -69,11 +66,9 @@ VOID OptionMenuCustomBoot(VOID) case 4: // Linux OptionMenuCustomBootLinux(); break; -#endif /* __i386__ */ } } -#ifdef __i386__ VOID OptionMenuCustomBootDisk(VOID) { CHAR SectionName[100]; @@ -408,4 +403,11 @@ VOID OptionMenuCustomBootLinux(VOID) LoadAndBootLinux(SectionName, "Custom Linux Setup"); } -#endif /* __i386__ */ + +VOID OptionMenuReboot(VOID) +{ + UiMessageBox("The system will now reboot."); + + DiskStopFloppyMotor(); + SoftReboot(); +} diff --git a/reactos/boot/freeldr/freeldr/drivemap.c b/reactos/boot/freeldr/freeldr/arch/i386/drivemap.c similarity index 99% rename from reactos/boot/freeldr/freeldr/drivemap.c rename to reactos/boot/freeldr/freeldr/arch/i386/drivemap.c index 6f4b9160a81..53da896665d 100644 --- a/reactos/boot/freeldr/freeldr/drivemap.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/drivemap.c @@ -20,7 +20,6 @@ #include #include -#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 @@ -221,4 +220,3 @@ VOID DriveMapRemoveInt13Handler(VOID) DriveMapInstalled = FALSE; } } -#endif /* __i386__ */ diff --git a/reactos/boot/freeldr/freeldr/miscboot.c b/reactos/boot/freeldr/freeldr/arch/i386/miscboot.c similarity index 99% rename from reactos/boot/freeldr/freeldr/miscboot.c rename to reactos/boot/freeldr/freeldr/arch/i386/miscboot.c index 65ee52c621f..e0aa98cfd50 100644 --- a/reactos/boot/freeldr/freeldr/miscboot.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/miscboot.c @@ -19,7 +19,6 @@ #include -#ifdef __i386__ VOID LoadAndBootBootSector(PCSTR OperatingSystemName) { PFILE FilePointer; @@ -211,4 +210,3 @@ VOID LoadAndBootDrive(PCSTR OperatingSystemName) //DisableA20(); ChainLoadBiosBootSectorCode(); } -#endif /* __i386__ */ diff --git a/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild b/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild index 805f59fe782..3eaee52f364 100644 --- a/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild +++ b/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild @@ -25,6 +25,8 @@ _alloca.S archmach.c + custom.c + drivemap.c hardware.c hwacpi.c hwapm.c @@ -34,6 +36,7 @@ i386vid.c loader.c machpc.c + miscboot.c pccons.c pcdisk.c pcmem.c diff --git a/reactos/boot/freeldr/freeldr/freeldr_base.rbuild b/reactos/boot/freeldr/freeldr/freeldr_base.rbuild index c13ad4436ad..2607147e067 100644 --- a/reactos/boot/freeldr/freeldr/freeldr_base.rbuild +++ b/reactos/boot/freeldr/freeldr/freeldr_base.rbuild @@ -85,10 +85,7 @@ freeldr.h - drivemap.c - miscboot.c options.c linuxboot.c oslist.c - custom.c diff --git a/reactos/boot/freeldr/freeldr/include/arch/i386/custom.h b/reactos/boot/freeldr/freeldr/include/arch/i386/custom.h new file mode 100644 index 00000000000..3594c4a1ebb --- /dev/null +++ b/reactos/boot/freeldr/freeldr/include/arch/i386/custom.h @@ -0,0 +1,35 @@ +/* + * FreeLoader + * Copyright (C) 1998-2003 Brian Palmer + * + * 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 diff --git a/reactos/boot/freeldr/freeldr/include/drivemap.h b/reactos/boot/freeldr/freeldr/include/arch/i386/drivemap.h similarity index 93% rename from reactos/boot/freeldr/freeldr/include/drivemap.h rename to reactos/boot/freeldr/freeldr/include/arch/i386/drivemap.h index c65acf3ea00..e425fd80d94 100644 --- a/reactos/boot/freeldr/freeldr/include/drivemap.h +++ b/reactos/boot/freeldr/freeldr/include/arch/i386/drivemap.h @@ -17,10 +17,9 @@ * 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 typedef struct { @@ -39,6 +38,5 @@ extern PVOID DriveMapInt13HandlerStart; extern PVOID DriveMapInt13HandlerEnd; extern ULONG DriveMapOldInt13HandlerAddress; extern DRIVE_MAP_LIST DriveMapInt13HandlerMapList; -#endif /* __i386__ */ -#endif // #defined __DRIVEMAP_H +#endif // #defined __I386_DRIVEMAP_H diff --git a/reactos/boot/freeldr/freeldr/include/miscboot.h b/reactos/boot/freeldr/freeldr/include/arch/i386/miscboot.h similarity index 90% rename from reactos/boot/freeldr/freeldr/include/miscboot.h rename to reactos/boot/freeldr/freeldr/include/arch/i386/miscboot.h index 9465af8755e..3ee8ab3dac4 100644 --- a/reactos/boot/freeldr/freeldr/include/miscboot.h +++ b/reactos/boot/freeldr/freeldr/include/arch/i386/miscboot.h @@ -17,13 +17,11 @@ * 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 diff --git a/reactos/boot/freeldr/freeldr/include/freeldr.h b/reactos/boot/freeldr/freeldr/include/freeldr.h index ffdf7da2ec9..406e117876e 100644 --- a/reactos/boot/freeldr/freeldr/include/freeldr.h +++ b/reactos/boot/freeldr/freeldr/include/freeldr.h @@ -71,10 +71,13 @@ #include /* arch files */ #if defined(_M_IX86) +#include +#include #include #include #include #include +#include #include #include #elif defined(_M_PPC) @@ -96,8 +99,6 @@ /* Needed by boot manager */ #include #include -#include -#include #include #include /* Externals */ diff --git a/reactos/boot/freeldr/freeldr/include/options.h b/reactos/boot/freeldr/freeldr/include/options.h index c95705a9514..bfa64798cd3 100644 --- a/reactos/boot/freeldr/freeldr/include/options.h +++ b/reactos/boot/freeldr/freeldr/include/options.h @@ -22,15 +22,4 @@ 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 diff --git a/reactos/boot/freeldr/freeldr/options.c b/reactos/boot/freeldr/freeldr/options.c index ad32798deca..2c1f6c68648 100644 --- a/reactos/boot/freeldr/freeldr/options.c +++ b/reactos/boot/freeldr/freeldr/options.c @@ -35,8 +35,12 @@ PCSTR OptionsMenuList[] = "SEPARATOR", +#ifdef HAS_OPTION_MENU_CUSTOM_BOOT "Custom Boot", +#endif +#ifdef HAS_OPTION_MENU_REBOOT "Reboot", +#endif }; enum OptionMenuItems @@ -55,8 +59,12 @@ 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]); @@ -96,22 +104,15 @@ VOID DoOptionsMenu(VOID) 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 }