From e6f6ed291d18789e77dd28d6f6564e97bb4d7dca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Wed, 10 Jan 2007 19:48:35 +0000 Subject: [PATCH] Disable some boot options on non-x86 platforms. You can enable them again for specific platforms if needed. svn path=/trunk/; revision=25417 --- reactos/boot/freeldr/freeldr/bootmgr.c | 4 ++++ reactos/boot/freeldr/freeldr/custom.c | 14 +++++++++++++- reactos/boot/freeldr/freeldr/drivemap.c | 2 ++ reactos/boot/freeldr/freeldr/include/drivemap.h | 3 ++- reactos/boot/freeldr/freeldr/include/linux.h | 3 ++- reactos/boot/freeldr/freeldr/include/miscboot.h | 2 ++ reactos/boot/freeldr/freeldr/include/options.h | 2 ++ reactos/boot/freeldr/freeldr/linuxboot.c | 2 ++ reactos/boot/freeldr/freeldr/miscboot.c | 2 ++ 9 files changed, 31 insertions(+), 3 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/bootmgr.c b/reactos/boot/freeldr/freeldr/bootmgr.c index 43b1ef6c18b..ac0dd3fee5c 100644 --- a/reactos/boot/freeldr/freeldr/bootmgr.c +++ b/reactos/boot/freeldr/freeldr/bootmgr.c @@ -119,11 +119,14 @@ NoGui: } // Install the drive mapper according to this sections drive mappings +#ifdef __i386__ DriveMapMapDrivesInSection(OperatingSystemSectionNames[SelectedOperatingSystem]); +#endif if (_stricmp(SettingValue, "ReactOS") == 0) { LoadAndBootReactOS(OperatingSystemSectionNames[SelectedOperatingSystem]); } +#ifdef __i386__ else if (_stricmp(SettingValue, "WindowsNT40") == 0) { LoadAndBootWindows(OperatingSystemSectionNames[SelectedOperatingSystem], _WIN32_WINNT_NT4); @@ -156,6 +159,7 @@ NoGui: { LoadAndBootDrive(OperatingSystemSectionNames[SelectedOperatingSystem]); } +#endif } diff --git a/reactos/boot/freeldr/freeldr/custom.c b/reactos/boot/freeldr/freeldr/custom.c index 38b61dd0620..e4d9de58f91 100644 --- a/reactos/boot/freeldr/freeldr/custom.c +++ b/reactos/boot/freeldr/freeldr/custom.c @@ -33,7 +33,15 @@ const CHAR CustomBootPrompt[] = "Press ENTER to boot your custom boot setup."; VOID OptionMenuCustomBoot(VOID) { - PCSTR CustomBootMenuList[] = { "Disk", "Partition", "Boot Sector File", "ReactOS", "Linux" }; + PCSTR CustomBootMenuList[] = { +#ifdef __i386__ + "Disk", + "Partition", + "Boot Sector File", + "ReactOS", + "Linux" +#endif /* __i386__ */ + }; ULONG CustomBootMenuCount = sizeof(CustomBootMenuList) / sizeof(CustomBootMenuList[0]); ULONG SelectedMenuItem; @@ -45,6 +53,7 @@ VOID OptionMenuCustomBoot(VOID) switch (SelectedMenuItem) { +#ifdef __i386__ case 0: // Disk OptionMenuCustomBootDisk(); break; @@ -60,9 +69,11 @@ VOID OptionMenuCustomBoot(VOID) case 4: // Linux OptionMenuCustomBootLinux(); break; +#endif /* __i386__ */ } } +#ifdef __i386__ VOID OptionMenuCustomBootDisk(VOID) { CHAR SectionName[100]; @@ -397,3 +408,4 @@ VOID OptionMenuCustomBootLinux(VOID) LoadAndBootLinux(SectionName, "Custom Linux Setup"); } +#endif /* __i386__ */ diff --git a/reactos/boot/freeldr/freeldr/drivemap.c b/reactos/boot/freeldr/freeldr/drivemap.c index 31ecab7a37b..7e82f13eea5 100644 --- a/reactos/boot/freeldr/freeldr/drivemap.c +++ b/reactos/boot/freeldr/freeldr/drivemap.c @@ -22,6 +22,7 @@ #define NDEBUG #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 @@ -222,3 +223,4 @@ VOID DriveMapRemoveInt13Handler(VOID) DriveMapInstalled = FALSE; } } +#endif /* __i386__ */ diff --git a/reactos/boot/freeldr/freeldr/include/drivemap.h b/reactos/boot/freeldr/freeldr/include/drivemap.h index 1d25f1f29f7..29a3d2cc5c2 100644 --- a/reactos/boot/freeldr/freeldr/include/drivemap.h +++ b/reactos/boot/freeldr/freeldr/include/drivemap.h @@ -20,7 +20,7 @@ #ifndef __DRIVEMAP_H #define __DRIVEMAP_H - +#ifdef __i386__ typedef struct { UCHAR DriveMapCount; // Count of drives currently mapped @@ -39,5 +39,6 @@ extern PVOID DriveMapInt13HandlerStart; extern PVOID DriveMapInt13HandlerEnd; extern ULONG DriveMapOldInt13HandlerAddress; extern DRIVE_MAP_LIST DriveMapInt13HandlerMapList; +#endif /* __i386__ */ #endif // #defined __DRIVEMAP_H diff --git a/reactos/boot/freeldr/freeldr/include/linux.h b/reactos/boot/freeldr/freeldr/include/linux.h index 90c6a8aea9c..14d3bf0d8be 100644 --- a/reactos/boot/freeldr/freeldr/include/linux.h +++ b/reactos/boot/freeldr/freeldr/include/linux.h @@ -22,7 +22,7 @@ #ifndef __LINUX_H #define __LINUX_H - +#ifdef __i386__ #define LINUX_LOADER_TYPE_LILO 0x01 #define LINUX_LOADER_TYPE_LOADLIN 0x11 #define LINUX_LOADER_TYPE_BOOTSECT 0x21 @@ -135,5 +135,6 @@ BOOLEAN LinuxReadSetupSector(PFILE LinuxKernelFile); BOOLEAN LinuxReadKernel(PFILE LinuxKernelFile); BOOLEAN LinuxCheckKernelVersion(VOID); BOOLEAN LinuxReadInitrd(PFILE LinuxInitrdFile); +#endif /* __i386__ */ #endif // defined __LINUX_H diff --git a/reactos/boot/freeldr/freeldr/include/miscboot.h b/reactos/boot/freeldr/freeldr/include/miscboot.h index e274c9ae2af..c0aea8381c2 100644 --- a/reactos/boot/freeldr/freeldr/include/miscboot.h +++ b/reactos/boot/freeldr/freeldr/include/miscboot.h @@ -20,8 +20,10 @@ #ifndef __BOOT_H #define __BOOT_H +#ifdef __i386__ VOID LoadAndBootBootSector(PCSTR OperatingSystemName); VOID LoadAndBootPartition(PCSTR OperatingSystemName); VOID LoadAndBootDrive(PCSTR OperatingSystemName); +#endif /* __i386__ */ #endif // defined __BOOT_H diff --git a/reactos/boot/freeldr/freeldr/include/options.h b/reactos/boot/freeldr/freeldr/include/options.h index 82ac6150e69..72cfa53aaea 100644 --- a/reactos/boot/freeldr/freeldr/include/options.h +++ b/reactos/boot/freeldr/freeldr/include/options.h @@ -25,10 +25,12 @@ 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/linuxboot.c b/reactos/boot/freeldr/freeldr/linuxboot.c index 27589bd6a26..5c086ef00fa 100644 --- a/reactos/boot/freeldr/freeldr/linuxboot.c +++ b/reactos/boot/freeldr/freeldr/linuxboot.c @@ -23,6 +23,7 @@ #define NDEBUG #include +#ifdef __i386__ #define LINUX_READ_CHUNK_SIZE 0x20000 // Read 128k at a time @@ -491,3 +492,4 @@ BOOLEAN LinuxReadInitrd(PFILE LinuxInitrdFile) return TRUE; } +#endif /* __i386__ */ diff --git a/reactos/boot/freeldr/freeldr/miscboot.c b/reactos/boot/freeldr/freeldr/miscboot.c index bbbf34f9ac2..a96bbd5cd28 100644 --- a/reactos/boot/freeldr/freeldr/miscboot.c +++ b/reactos/boot/freeldr/freeldr/miscboot.c @@ -19,6 +19,7 @@ #include +#ifdef __i386__ VOID LoadAndBootBootSector(PCSTR OperatingSystemName) { PFILE FilePointer; @@ -213,3 +214,4 @@ VOID LoadAndBootDrive(PCSTR OperatingSystemName) //DisableA20(); ChainLoadBiosBootSectorCode(); } +#endif /* __i386__ */