From 2682e03820b5f34040a1e5e39f91c4b695869427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 1 Feb 2015 17:49:11 +0000 Subject: [PATCH] [FREELDR] - Remove an unexisting function declaration. - Move some boot methods back to suitable place. - Whitespace fixes. svn path=/trunk/; revision=66143 --- reactos/boot/freeldr/freeldr/CMakeLists.txt | 5 ++-- .../freeldr/freeldr/{arch/i386 => }/custom.c | 3 +++ .../freeldr/include/arch/pc/hardware.h | 2 ++ .../freeldr/include/{arch/i386 => }/custom.h | 5 ++-- .../boot/freeldr/freeldr/include/freeldr.h | 4 ++-- reactos/boot/freeldr/freeldr/include/linux.h | 24 ++++++++++--------- .../include/{arch/i386 => }/miscboot.h | 4 ++++ reactos/boot/freeldr/freeldr/linuxboot.c | 14 +++++++---- .../freeldr/{arch/i386 => }/miscboot.c | 4 ++++ reactos/boot/freeldr/freeldr/mm/mm.c | 3 +-- 10 files changed, 43 insertions(+), 25 deletions(-) rename reactos/boot/freeldr/freeldr/{arch/i386 => }/custom.c (99%) rename reactos/boot/freeldr/freeldr/include/{arch/i386 => }/custom.h (94%) rename reactos/boot/freeldr/freeldr/include/{arch/i386 => }/miscboot.h (97%) rename reactos/boot/freeldr/freeldr/{arch/i386 => }/miscboot.c (99%) diff --git a/reactos/boot/freeldr/freeldr/CMakeLists.txt b/reactos/boot/freeldr/freeldr/CMakeLists.txt index eaadca0a7bb..1a128dfd525 100644 --- a/reactos/boot/freeldr/freeldr/CMakeLists.txt +++ b/reactos/boot/freeldr/freeldr/CMakeLists.txt @@ -34,8 +34,10 @@ endif() list(APPEND FREELDR_COMMON_SOURCE include/freeldr.h cmdline.c + custom.c debug.c linuxboot.c + miscboot.c machine.c options.c oslist.c @@ -87,7 +89,6 @@ if(ARCH STREQUAL "i386") list(APPEND FREELDR_COMMON_SOURCE fs/pxe.c arch/i386/archmach.c - arch/i386/custom.c arch/i386/drivemap.c arch/i386/halstub.c arch/i386/hardware.c @@ -101,7 +102,6 @@ if(ARCH STREQUAL "i386") arch/i386/i386rtl.c arch/i386/i386vid.c arch/i386/machpc.c - arch/i386/miscboot.c arch/i386/ntoskrnl.c arch/i386/pccons.c arch/i386/pcdisk.c @@ -130,7 +130,6 @@ elseif(ARCH STREQUAL "amd64") arch/amd64/pnpbios.S) list(APPEND FREELDR_COMMON_SOURCE fs/pxe.c - arch/i386/custom.c arch/i386/drivemap.c arch/i386/hardware.c arch/i386/hwacpi.c diff --git a/reactos/boot/freeldr/freeldr/arch/i386/custom.c b/reactos/boot/freeldr/freeldr/custom.c similarity index 99% rename from reactos/boot/freeldr/freeldr/arch/i386/custom.c rename to reactos/boot/freeldr/freeldr/custom.c index fc1d657f7cd..730e15a2707 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/custom.c +++ b/reactos/boot/freeldr/freeldr/custom.c @@ -19,6 +19,7 @@ #include +#ifdef _M_IX86 const CHAR BootDrivePrompt[] = "Enter the boot drive.\n\nExamples:\nfd0 - first floppy drive\nhd0 - first hard drive\nhd1 - second hard drive\ncd0 - first CD-ROM drive.\n\nBIOS drive numbers may also be used:\n0 - first floppy drive\n0x80 - first hard drive\n0x81 - second hard drive"; const CHAR BootPartitionPrompt[] = "Enter the boot partition.\n\nEnter 0 for the active (bootable) partition."; @@ -448,3 +449,5 @@ VOID OptionMenuReboot(VOID) DiskStopFloppyMotor(); Reboot(); } + +#endif // _M_IX86 diff --git a/reactos/boot/freeldr/freeldr/include/arch/pc/hardware.h b/reactos/boot/freeldr/freeldr/include/arch/pc/hardware.h index 4a7b9bc51c7..3b54c55c95c 100644 --- a/reactos/boot/freeldr/freeldr/include/arch/pc/hardware.h +++ b/reactos/boot/freeldr/freeldr/include/arch/pc/hardware.h @@ -23,6 +23,8 @@ #define CONFIG_CMD(bus, dev_fn, where) \ (0x80000000 | (((ULONG)(bus)) << 16) | (((dev_fn) & 0x1F) << 11) | (((dev_fn) & 0xE0) << 3) | ((where) & ~3)) +#define TAG_HW_RESOURCE_LIST 'lRwH' +#define TAG_HW_DISK_CONTEXT 'cDwH' // // ARC Component Configuration Routines diff --git a/reactos/boot/freeldr/freeldr/include/arch/i386/custom.h b/reactos/boot/freeldr/freeldr/include/custom.h similarity index 94% rename from reactos/boot/freeldr/freeldr/include/arch/i386/custom.h rename to reactos/boot/freeldr/freeldr/include/custom.h index 39aff9640d5..0450568b5df 100644 --- a/reactos/boot/freeldr/freeldr/include/arch/i386/custom.h +++ b/reactos/boot/freeldr/freeldr/include/custom.h @@ -19,8 +19,7 @@ #pragma once -#define TAG_HW_RESOURCE_LIST 'lRwH' -#define TAG_HW_DISK_CONTEXT 'cDwH' +#ifdef _M_IX86 #define HAS_OPTION_MENU_CUSTOM_BOOT #define HAS_OPTION_MENU_REBOOT @@ -33,3 +32,5 @@ VOID OptionMenuCustomBootPartition(VOID); VOID OptionMenuCustomBootBootSectorFile(VOID); VOID OptionMenuCustomBootReactOS(VOID); VOID OptionMenuCustomBootLinux(VOID); + +#endif // _M_IX86 diff --git a/reactos/boot/freeldr/freeldr/include/freeldr.h b/reactos/boot/freeldr/freeldr/include/freeldr.h index 12f26cbf360..3f7377a0a12 100644 --- a/reactos/boot/freeldr/freeldr/include/freeldr.h +++ b/reactos/boot/freeldr/freeldr/include/freeldr.h @@ -66,6 +66,8 @@ #include #include #include +#include +#include #include #include #include @@ -99,13 +101,11 @@ #include #include #include -#include #include #endif #if defined(_M_IX86) #include #include -#include #include #elif defined(_M_AMD64) #include diff --git a/reactos/boot/freeldr/freeldr/include/linux.h b/reactos/boot/freeldr/freeldr/include/linux.h index 38928f97a4e..f0f5cc95382 100644 --- a/reactos/boot/freeldr/freeldr/include/linux.h +++ b/reactos/boot/freeldr/freeldr/include/linux.h @@ -23,24 +23,25 @@ #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 -#define LINUX_LOADER_TYPE_SYSLINUX 0x31 -#define LINUX_LOADER_TYPE_ETHERBOOT 0x41 +#ifdef _M_IX86 + +#define LINUX_LOADER_TYPE_LILO 0x01 +#define LINUX_LOADER_TYPE_LOADLIN 0x11 +#define LINUX_LOADER_TYPE_BOOTSECT 0x21 +#define LINUX_LOADER_TYPE_SYSLINUX 0x31 +#define LINUX_LOADER_TYPE_ETHERBOOT 0x41 #define LINUX_LOADER_TYPE_FREELOADER 0x81 #define LINUX_COMMAND_LINE_MAGIC 0xA33F -#define LINUX_SETUP_HEADER_ID 0x53726448 // 'HdrS' +#define LINUX_SETUP_HEADER_ID 0x53726448 // 'HdrS' -#define LINUX_BOOT_SECTOR_MAGIC 0xAA55 +#define LINUX_BOOT_SECTOR_MAGIC 0xAA55 -#define LINUX_KERNEL_LOAD_ADDRESS 0x100000 +#define LINUX_KERNEL_LOAD_ADDRESS 0x100000 #define LINUX_FLAG_LOAD_HIGH 0x01 -#define LINUX_FLAG_CAN_USE_HEAP 0x80 +#define LINUX_FLAG_CAN_USE_HEAP 0x80 #define LINUX_MAX_INITRD_ADDRESS 0x38000000 @@ -140,6 +141,7 @@ BOOLEAN LinuxReadSetupSector(PFILE LinuxKernelFile); BOOLEAN LinuxReadKernel(PFILE LinuxKernelFile); BOOLEAN LinuxCheckKernelVersion(VOID); BOOLEAN LinuxReadInitrd(PFILE LinuxInitrdFile); -#endif /* __i386__ */ + +#endif // _M_IX86 #endif // defined __LINUX_H diff --git a/reactos/boot/freeldr/freeldr/include/arch/i386/miscboot.h b/reactos/boot/freeldr/freeldr/include/miscboot.h similarity index 97% rename from reactos/boot/freeldr/freeldr/include/arch/i386/miscboot.h rename to reactos/boot/freeldr/freeldr/include/miscboot.h index 42d31fdbbb9..d7634963ae0 100644 --- a/reactos/boot/freeldr/freeldr/include/arch/i386/miscboot.h +++ b/reactos/boot/freeldr/freeldr/include/miscboot.h @@ -19,6 +19,8 @@ #pragma once +#ifdef _M_IX86 + VOID LoadAndBootBootSector(IN OperatingSystemItem* OperatingSystem, IN USHORT OperatingSystemVersion); @@ -28,3 +30,5 @@ LoadAndBootPartition(IN OperatingSystemItem* OperatingSystem, VOID LoadAndBootDrive(IN OperatingSystemItem* OperatingSystem, IN USHORT OperatingSystemVersion); + +#endif // _M_IX86 diff --git a/reactos/boot/freeldr/freeldr/linuxboot.c b/reactos/boot/freeldr/freeldr/linuxboot.c index 7d431d5ae10..f3b1d520a3d 100644 --- a/reactos/boot/freeldr/freeldr/linuxboot.c +++ b/reactos/boot/freeldr/freeldr/linuxboot.c @@ -21,8 +21,10 @@ #include #include -#ifdef __i386__ -#define LINUX_READ_CHUNK_SIZE 0x20000 // Read 128k at a time + +#ifdef _M_IX86 + +#define LINUX_READ_CHUNK_SIZE 0x20000 // Read 128k at a time DBG_DEFAULT_CHANNEL(LINUX); @@ -307,7 +309,7 @@ BOOLEAN LinuxReadBootSector(PFILE LinuxKernelFile) return FALSE; } - DbgDumpBuffer(DPRINT_LINUX, LinuxBootSector, 512); + // DbgDumpBuffer(DPRINT_LINUX, LinuxBootSector, 512); TRACE("SetupSectors: %d\n", LinuxBootSector->SetupSectors); TRACE("RootFlags: 0x%x\n", LinuxBootSector->RootFlags); @@ -366,7 +368,7 @@ BOOLEAN LinuxReadSetupSector(PFILE LinuxKernelFile) return FALSE; } - DbgDumpBuffer(DPRINT_LINUX, LinuxSetupSector, SetupSectorSize); + // DbgDumpBuffer(DPRINT_LINUX, LinuxSetupSector, SetupSectorSize); TRACE("SetupHeaderSignature: 0x%x (HdrS)\n", LinuxSetupSector->SetupHeaderSignature); TRACE("Version: 0x%x\n", LinuxSetupSector->Version); @@ -513,5 +515,7 @@ BOOLEAN LinuxReadInitrd(PFILE LinuxInitrdFile) return TRUE; } -#endif /* __i386__ */ + +#endif // _M_IX86 + #endif diff --git a/reactos/boot/freeldr/freeldr/arch/i386/miscboot.c b/reactos/boot/freeldr/freeldr/miscboot.c similarity index 99% rename from reactos/boot/freeldr/freeldr/arch/i386/miscboot.c rename to reactos/boot/freeldr/freeldr/miscboot.c index 328c065b0c3..18618b14c08 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/miscboot.c +++ b/reactos/boot/freeldr/freeldr/miscboot.c @@ -19,6 +19,8 @@ #include +#ifdef _M_IX86 + VOID LoadAndBootBootSector(IN OperatingSystemItem* OperatingSystem, IN USHORT OperatingSystemVersion) @@ -215,3 +217,5 @@ LoadAndBootDrive(IN OperatingSystemItem* OperatingSystem, FrldrBootDrive = DriveNumber; ChainLoadBiosBootSectorCode(); } + +#endif // _M_IX86 diff --git a/reactos/boot/freeldr/freeldr/mm/mm.c b/reactos/boot/freeldr/freeldr/mm/mm.c index 410d794702a..a2b49b3f9f0 100644 --- a/reactos/boot/freeldr/freeldr/mm/mm.c +++ b/reactos/boot/freeldr/freeldr/mm/mm.c @@ -21,8 +21,7 @@ #include #if DBG -VOID DumpMemoryAllocMap(VOID); -VOID MemAllocTest(VOID); +VOID DumpMemoryAllocMap(VOID); #endif // DBG DBG_DEFAULT_CHANNEL(MEMORY);