Author: hbelusca Date: Sun Feb 1 17:49:11 2015 New Revision: 66143
URL: http://svn.reactos.org/svn/reactos?rev=66143&view=rev Log: [FREELDR] - Remove an unexisting function declaration. - Move some boot methods back to suitable place. - Whitespace fixes.
Added: trunk/reactos/boot/freeldr/freeldr/custom.c - copied, changed from r66136, trunk/reactos/boot/freeldr/freeldr/arch/i386/custom.c trunk/reactos/boot/freeldr/freeldr/include/custom.h - copied, changed from r66136, trunk/reactos/boot/freeldr/freeldr/include/arch/i386/custom.h trunk/reactos/boot/freeldr/freeldr/include/miscboot.h - copied, changed from r66136, trunk/reactos/boot/freeldr/freeldr/include/arch/i386/miscboot.h trunk/reactos/boot/freeldr/freeldr/miscboot.c - copied, changed from r66136, trunk/reactos/boot/freeldr/freeldr/arch/i386/miscboot.c Removed: trunk/reactos/boot/freeldr/freeldr/arch/i386/custom.c trunk/reactos/boot/freeldr/freeldr/arch/i386/miscboot.c trunk/reactos/boot/freeldr/freeldr/include/arch/i386/custom.h trunk/reactos/boot/freeldr/freeldr/include/arch/i386/miscboot.h Modified: trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt trunk/reactos/boot/freeldr/freeldr/include/arch/pc/hardware.h trunk/reactos/boot/freeldr/freeldr/include/freeldr.h trunk/reactos/boot/freeldr/freeldr/include/linux.h trunk/reactos/boot/freeldr/freeldr/linuxboot.c trunk/reactos/boot/freeldr/freeldr/mm/mm.c
Modified: trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/CMakeL... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] Sun Feb 1 17:49:11 2015 @@ -34,8 +34,10 @@ 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 @@ 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 @@ 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 @@ 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
Removed: trunk/reactos/boot/freeldr/freeldr/arch/i386/custom.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/custom.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/custom.c (removed) @@ -1,450 +0,0 @@ -/* - * 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., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <freeldr.h> - - -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."; -const CHAR BootSectorFilePrompt[] = "Enter the boot sector file path.\n\nExamples:\n\BOOTSECT.DOS\n/boot/bootsect.dos"; -const CHAR LinuxKernelPrompt[] = "Enter the Linux kernel image path.\n\nExamples:\n/vmlinuz\n/boot/vmlinuz-2.4.18"; -const CHAR LinuxInitrdPrompt[] = "Enter the initrd image path.\n\nExamples:\n/initrd.gz\n/boot/root.img.gz\n\nLeave blank for no initial ram disk."; -const CHAR LinuxCommandLinePrompt[] = "Enter the Linux kernel command line.\n\nExamples:\nroot=/dev/hda1\nroot=/dev/fd0 read-only\nroot=/dev/sdb1 init=/sbin/init"; -const CHAR ReactOSSystemPathPrompt[] = "Enter the path to your ReactOS system directory.\n\nExamples:\n\REACTOS\n\ROS"; -const CHAR ReactOSOptionsPrompt[] = "Enter the options you want passed to the kernel.\n\nExamples:\n/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200\n/FASTDETECT /SOS /NOGUIBOOT\n/BASEVIDEO /MAXMEM=64\n/KERNEL=NTKRNLMP.EXE /HAL=HALMPS.DLL"; - -const CHAR CustomBootPrompt[] = "Press ENTER to boot your custom boot setup."; - -VOID OptionMenuCustomBoot(VOID) -{ - PCSTR CustomBootMenuList[] = { - "Disk", - "Partition", - "Boot Sector File", - "ReactOS", - "Linux" - }; - ULONG CustomBootMenuCount = sizeof(CustomBootMenuList) / sizeof(CustomBootMenuList[0]); - ULONG SelectedMenuItem; - - if (!UiDisplayMenu("Please choose a boot method:", "", - FALSE, - CustomBootMenuList, - CustomBootMenuCount, - 0, -1, - &SelectedMenuItem, - TRUE, - NULL)) - { - // The user pressed ESC - return; - } - - switch (SelectedMenuItem) - { - case 0: // Disk - OptionMenuCustomBootDisk(); - break; - case 1: // Partition - OptionMenuCustomBootPartition(); - break; - case 2: // Boot Sector File - OptionMenuCustomBootBootSectorFile(); - break; - case 3: // ReactOS - OptionMenuCustomBootReactOS(); - break; - case 4: // Linux - OptionMenuCustomBootLinux(); - break; - } -} - -VOID OptionMenuCustomBootDisk(VOID) -{ - ULONG_PTR SectionId; - CHAR SectionName[100]; - CHAR BootDriveString[20]; - TIMEINFO* TimeInfo; - OperatingSystemItem OperatingSystem; - - RtlZeroMemory(SectionName, sizeof(SectionName)); - RtlZeroMemory(BootDriveString, sizeof(BootDriveString)); - - if (!UiEditBox(BootDrivePrompt, BootDriveString, 20)) - { - return; - } - - // Generate a unique section name - TimeInfo = ArcGetTime(); - sprintf(SectionName, "CustomBootDisk%u%u%u%u%u%u", TimeInfo->Year, TimeInfo->Day, TimeInfo->Month, TimeInfo->Hour, TimeInfo->Minute, TimeInfo->Second); - - // Add the section - if (!IniAddSection(SectionName, &SectionId)) - { - return; - } - - // Add the BootType - if (!IniAddSettingValueToSection(SectionId, "BootType", "Drive")) - { - return; - } - - // Add the BootDrive - if (!IniAddSettingValueToSection(SectionId, "BootDrive", BootDriveString)) - { - return; - } - - UiMessageBox(CustomBootPrompt); - - OperatingSystem.SystemPartition = SectionName; - OperatingSystem.LoadIdentifier = NULL; - OperatingSystem.OsLoadOptions = NULL; - - // LoadAndBootDrive(&OperatingSystem, 0); - LoadOperatingSystem(&OperatingSystem); -} - -VOID OptionMenuCustomBootPartition(VOID) -{ - ULONG_PTR SectionId; - CHAR SectionName[100]; - CHAR BootDriveString[20]; - CHAR BootPartitionString[20]; - TIMEINFO* TimeInfo; - OperatingSystemItem OperatingSystem; - - RtlZeroMemory(SectionName, sizeof(SectionName)); - RtlZeroMemory(BootDriveString, sizeof(BootDriveString)); - RtlZeroMemory(BootPartitionString, sizeof(BootPartitionString)); - - if (!UiEditBox(BootDrivePrompt, BootDriveString, 20)) - { - return; - } - - if (!UiEditBox(BootPartitionPrompt, BootPartitionString, 20)) - { - return; - } - - // Generate a unique section name - TimeInfo = ArcGetTime(); - sprintf(SectionName, "CustomBootPartition%u%u%u%u%u%u", TimeInfo->Year, TimeInfo->Day, TimeInfo->Month, TimeInfo->Hour, TimeInfo->Minute, TimeInfo->Second); - - // Add the section - if (!IniAddSection(SectionName, &SectionId)) - { - return; - } - - // Add the BootType - if (!IniAddSettingValueToSection(SectionId, "BootType", "Partition")) - { - return; - } - - // Add the BootDrive - if (!IniAddSettingValueToSection(SectionId, "BootDrive", BootDriveString)) - { - return; - } - - // Add the BootPartition - if (!IniAddSettingValueToSection(SectionId, "BootPartition", BootPartitionString)) - { - return; - } - - UiMessageBox(CustomBootPrompt); - - OperatingSystem.SystemPartition = SectionName; - OperatingSystem.LoadIdentifier = NULL; - OperatingSystem.OsLoadOptions = NULL; - - // LoadAndBootPartition(&OperatingSystem, 0); - LoadOperatingSystem(&OperatingSystem); -} - -VOID OptionMenuCustomBootBootSectorFile(VOID) -{ - ULONG_PTR SectionId; - CHAR SectionName[100]; - CHAR BootDriveString[20]; - CHAR BootPartitionString[20]; - CHAR BootSectorFileString[200]; - TIMEINFO* TimeInfo; - OperatingSystemItem OperatingSystem; - - RtlZeroMemory(SectionName, sizeof(SectionName)); - RtlZeroMemory(BootDriveString, sizeof(BootDriveString)); - RtlZeroMemory(BootPartitionString, sizeof(BootPartitionString)); - RtlZeroMemory(BootSectorFileString, sizeof(BootSectorFileString)); - - if (!UiEditBox(BootDrivePrompt, BootDriveString, 20)) - { - return; - } - - if (!UiEditBox(BootPartitionPrompt, BootPartitionString, 20)) - { - return; - } - - if (!UiEditBox(BootSectorFilePrompt, BootSectorFileString, 200)) - { - return; - } - - // Generate a unique section name - TimeInfo = ArcGetTime(); - sprintf(SectionName, "CustomBootSectorFile%u%u%u%u%u%u", TimeInfo->Year, TimeInfo->Day, TimeInfo->Month, TimeInfo->Hour, TimeInfo->Minute, TimeInfo->Second); - - // Add the section - if (!IniAddSection(SectionName, &SectionId)) - { - return; - } - - // Add the BootType - if (!IniAddSettingValueToSection(SectionId, "BootType", "BootSector")) - { - return; - } - - // Add the BootDrive - if (!IniAddSettingValueToSection(SectionId, "BootDrive", BootDriveString)) - { - return; - } - - // Add the BootPartition - if (!IniAddSettingValueToSection(SectionId, "BootPartition", BootPartitionString)) - { - return; - } - - // Add the BootSectorFile - if (!IniAddSettingValueToSection(SectionId, "BootSectorFile", BootSectorFileString)) - { - return; - } - - UiMessageBox(CustomBootPrompt); - - OperatingSystem.SystemPartition = SectionName; - OperatingSystem.LoadIdentifier = NULL; - OperatingSystem.OsLoadOptions = NULL; - - // LoadAndBootBootSector(&OperatingSystem, 0); - LoadOperatingSystem(&OperatingSystem); -} - -VOID OptionMenuCustomBootReactOS(VOID) -{ - ULONG_PTR SectionId; - CHAR SectionName[100]; - CHAR BootDriveString[20]; - CHAR BootPartitionString[20]; - CHAR ReactOSSystemPath[200]; - CHAR ReactOSARCPath[200]; - CHAR ReactOSOptions[200]; - TIMEINFO* TimeInfo; - OperatingSystemItem OperatingSystem; - - RtlZeroMemory(SectionName, sizeof(SectionName)); - RtlZeroMemory(BootDriveString, sizeof(BootDriveString)); - RtlZeroMemory(BootPartitionString, sizeof(BootPartitionString)); - RtlZeroMemory(ReactOSSystemPath, sizeof(ReactOSSystemPath)); - RtlZeroMemory(ReactOSOptions, sizeof(ReactOSOptions)); - - if (!UiEditBox(BootDrivePrompt, BootDriveString, 20)) - { - return; - } - - if (!UiEditBox(BootPartitionPrompt, BootPartitionString, 20)) - { - return; - } - - if (!UiEditBox(ReactOSSystemPathPrompt, ReactOSSystemPath, 200)) - { - return; - } - - if (!UiEditBox(ReactOSOptionsPrompt, ReactOSOptions, 200)) - { - return; - } - - // Generate a unique section name - TimeInfo = ArcGetTime(); - sprintf(SectionName, "CustomReactOS%u%u%u%u%u%u", TimeInfo->Year, TimeInfo->Day, TimeInfo->Month, TimeInfo->Hour, TimeInfo->Minute, TimeInfo->Second); - - // Add the section - if (!IniAddSection(SectionName, &SectionId)) - { - return; - } - - // Add the BootType - if (!IniAddSettingValueToSection(SectionId, "BootType", "Windows2003")) - { - return; - } - - // Construct the ReactOS ARC system path - ConstructArcPath(ReactOSARCPath, ReactOSSystemPath, DriveMapGetBiosDriveNumber(BootDriveString), atoi(BootPartitionString)); - - // Add the system path - if (!IniAddSettingValueToSection(SectionId, "SystemPath", ReactOSARCPath)) - { - return; - } - - // Add the CommandLine - if (!IniAddSettingValueToSection(SectionId, "Options", ReactOSOptions)) - { - return; - } - - UiMessageBox(CustomBootPrompt); - - OperatingSystem.SystemPartition = SectionName; - OperatingSystem.LoadIdentifier = NULL; - OperatingSystem.OsLoadOptions = NULL; // ReactOSOptions - - // LoadAndBootWindows(&OperatingSystem, _WIN32_WINNT_WS03); - LoadOperatingSystem(&OperatingSystem); -} - -VOID OptionMenuCustomBootLinux(VOID) -{ - ULONG_PTR SectionId; - CHAR SectionName[100]; - CHAR BootDriveString[20]; - CHAR BootPartitionString[20]; - CHAR LinuxKernelString[200]; - CHAR LinuxInitrdString[200]; - CHAR LinuxCommandLineString[200]; - TIMEINFO* TimeInfo; - OperatingSystemItem OperatingSystem; - - RtlZeroMemory(SectionName, sizeof(SectionName)); - RtlZeroMemory(BootDriveString, sizeof(BootDriveString)); - RtlZeroMemory(BootPartitionString, sizeof(BootPartitionString)); - RtlZeroMemory(LinuxKernelString, sizeof(LinuxKernelString)); - RtlZeroMemory(LinuxInitrdString, sizeof(LinuxInitrdString)); - RtlZeroMemory(LinuxCommandLineString, sizeof(LinuxCommandLineString)); - - if (!UiEditBox(BootDrivePrompt, BootDriveString, 20)) - { - return; - } - - if (!UiEditBox(BootPartitionPrompt, BootPartitionString, 20)) - { - return; - } - - if (!UiEditBox(LinuxKernelPrompt, LinuxKernelString, 200)) - { - return; - } - - if (!UiEditBox(LinuxInitrdPrompt, LinuxInitrdString, 200)) - { - return; - } - - if (!UiEditBox(LinuxCommandLinePrompt, LinuxCommandLineString, 200)) - { - return; - } - - // Generate a unique section name - TimeInfo = ArcGetTime(); - sprintf(SectionName, "CustomLinux%u%u%u%u%u%u", TimeInfo->Year, TimeInfo->Day, TimeInfo->Month, TimeInfo->Hour, TimeInfo->Minute, TimeInfo->Second); - - // Add the section - if (!IniAddSection(SectionName, &SectionId)) - { - return; - } - - // Add the BootType - if (!IniAddSettingValueToSection(SectionId, "BootType", "Linux")) - { - return; - } - - // Add the BootDrive - if (!IniAddSettingValueToSection(SectionId, "BootDrive", BootDriveString)) - { - return; - } - - // Add the BootPartition - if (!IniAddSettingValueToSection(SectionId, "BootPartition", BootPartitionString)) - { - return; - } - - // Add the Kernel - if (!IniAddSettingValueToSection(SectionId, "Kernel", LinuxKernelString)) - { - return; - } - - // Add the Initrd - if (strlen(LinuxInitrdString) > 0) - { - if (!IniAddSettingValueToSection(SectionId, "Initrd", LinuxInitrdString)) - { - return; - } - } - - // Add the CommandLine - if (!IniAddSettingValueToSection(SectionId, "CommandLine", LinuxCommandLineString)) - { - return; - } - - UiMessageBox(CustomBootPrompt); - - OperatingSystem.SystemPartition = SectionName; - OperatingSystem.LoadIdentifier = "Custom Linux Setup"; - OperatingSystem.OsLoadOptions = NULL; - - // LoadAndBootLinux(&OperatingSystem, 0); - LoadOperatingSystem(&OperatingSystem); -} - -VOID OptionMenuReboot(VOID) -{ - UiMessageBox("The system will now reboot."); - - DiskStopFloppyMotor(); - Reboot(); -}
Removed: trunk/reactos/boot/freeldr/freeldr/arch/i386/miscboot.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/miscboot.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/miscboot.c (removed) @@ -1,217 +0,0 @@ -/* - * 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., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <freeldr.h> - -VOID -LoadAndBootBootSector(IN OperatingSystemItem* OperatingSystem, - IN USHORT OperatingSystemVersion) -{ - ULONG_PTR SectionId; - PCSTR SectionName = OperatingSystem->SystemPartition; - CHAR FileName[260]; - PFILE FilePointer; - ULONG BytesRead; - CHAR SettingName[80]; - - // Find all the message box settings and run them - UiShowMessageBoxesInSection(SectionName); - - // Try to open the operating system section in the .ini file - if (!IniOpenSection(SectionName, &SectionId)) - { - sprintf(SettingName, "Section [%s] not found in freeldr.ini.\n", SectionName); - UiMessageBox(SettingName); - return; - } - - if (!IniReadSettingByName(SectionId, "BootSectorFile", FileName, sizeof(FileName))) - { - UiMessageBox("Boot sector file not specified for selected OS!"); - return; - } - - FilePointer = FsOpenFile(FileName); - if (!FilePointer) - { - strcat(FileName, " not found."); - UiMessageBox(FileName); - return; - } - - // Read boot sector - if (!FsReadFile(FilePointer, 512, &BytesRead, (void*)0x7c00) || (BytesRead != 512)) - { - UiMessageBox("Unable to read boot sector."); - return; - } - - // Check for validity - if (*((USHORT*)(0x7c00 + 0x1fe)) != 0xaa55) - { - UiMessageBox("Invalid boot sector magic (0xaa55)"); - return; - } - - UiUnInitialize("Booting..."); - // 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(); - //DisableA20(); - ChainLoadBiosBootSectorCode(); -} - -VOID -LoadAndBootPartition(IN OperatingSystemItem* OperatingSystem, - IN USHORT OperatingSystemVersion) -{ - ULONG_PTR SectionId; - PCSTR SectionName = OperatingSystem->SystemPartition; - CHAR SettingName[80]; - CHAR SettingValue[80]; - PARTITION_TABLE_ENTRY PartitionTableEntry; - UCHAR DriveNumber; - ULONG PartitionNumber; - - // Find all the message box settings and run them - UiShowMessageBoxesInSection(SectionName); - - // Try to open the operating system section in the .ini file - if (!IniOpenSection(SectionName, &SectionId)) - { - sprintf(SettingName, "Section [%s] not found in freeldr.ini.\n", SectionName); - UiMessageBox(SettingName); - return; - } - - // Read the boot drive - if (!IniReadSettingByName(SectionId, "BootDrive", SettingValue, sizeof(SettingValue))) - { - UiMessageBox("Boot drive not specified for selected OS!"); - return; - } - - DriveNumber = DriveMapGetBiosDriveNumber(SettingValue); - - // Read the boot partition - if (!IniReadSettingByName(SectionId, "BootPartition", SettingValue, sizeof(SettingValue))) - { - UiMessageBox("Boot partition not specified for selected OS!"); - return; - } - - PartitionNumber = atoi(SettingValue); - - // Get the partition table entry - if (!DiskGetPartitionEntry(DriveNumber, PartitionNumber, &PartitionTableEntry)) - { - return; - } - - // Now try to read the partition boot sector - // If this fails then abort - if (!MachDiskReadLogicalSectors(DriveNumber, PartitionTableEntry.SectorCountBeforePartition, 1, (PVOID)0x7C00)) - { - UiMessageBox("Unable to read partition's boot sector."); - return; - } - - // Check for validity - if (*((USHORT*)(0x7c00 + 0x1fe)) != 0xaa55) - { - UiMessageBox("Invalid boot sector magic (0xaa55)"); - return; - } - - UiUnInitialize("Booting..."); - // 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(); - //DisableA20(); - FrldrBootDrive = DriveNumber; - ChainLoadBiosBootSectorCode(); -} - -VOID -LoadAndBootDrive(IN OperatingSystemItem* OperatingSystem, - IN USHORT OperatingSystemVersion) -{ - ULONG_PTR SectionId; - PCSTR SectionName = OperatingSystem->SystemPartition; - CHAR SettingName[80]; - CHAR SettingValue[80]; - UCHAR DriveNumber; - - // Find all the message box settings and run them - UiShowMessageBoxesInSection(SectionName); - - // Try to open the operating system section in the .ini file - if (!IniOpenSection(SectionName, &SectionId)) - { - sprintf(SettingName, "Section [%s] not found in freeldr.ini.\n", SectionName); - UiMessageBox(SettingName); - return; - } - - if (!IniReadSettingByName(SectionId, "BootDrive", SettingValue, sizeof(SettingValue))) - { - UiMessageBox("Boot drive not specified for selected OS!"); - return; - } - - DriveNumber = DriveMapGetBiosDriveNumber(SettingValue); - - // Now try to read the boot sector (or mbr) - // If this fails then abort - if (!MachDiskReadLogicalSectors(DriveNumber, 0, 1, (PVOID)0x7C00)) - { - UiMessageBox("Unable to read boot sector"); - return; - } - - // Check for validity - if (*((USHORT*)(0x7c00 + 0x1fe)) != 0xaa55) - { - UiMessageBox("Invalid boot sector magic (0xaa55)"); - return; - } - - UiUnInitialize("Booting..."); - // 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(); - //DisableA20(); - FrldrBootDrive = DriveNumber; - ChainLoadBiosBootSectorCode(); -}
Copied: trunk/reactos/boot/freeldr/freeldr/custom.c (from r66136, trunk/reactos/boot/freeldr/freeldr/arch/i386/custom.c) URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/custom... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/custom.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/custom.c [iso-8859-1] Sun Feb 1 17:49:11 2015 @@ -19,6 +19,7 @@
#include <freeldr.h>
+#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 @@ DiskStopFloppyMotor(); Reboot(); } + +#endif // _M_IX86
Removed: trunk/reactos/boot/freeldr/freeldr/include/arch/i386/custom.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/i386/custom.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/i386/custom.h (removed) @@ -1,35 +0,0 @@ -/* - * 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. - */ - -#pragma once - -#define TAG_HW_RESOURCE_LIST 'lRwH' -#define TAG_HW_DISK_CONTEXT 'cDwH' - -#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);
Removed: trunk/reactos/boot/freeldr/freeldr/include/arch/i386/miscboot.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/i386/miscboot.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/i386/miscboot.h (removed) @@ -1,30 +0,0 @@ -/* - * 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., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#pragma once - -VOID -LoadAndBootBootSector(IN OperatingSystemItem* OperatingSystem, - IN USHORT OperatingSystemVersion); -VOID -LoadAndBootPartition(IN OperatingSystemItem* OperatingSystem, - IN USHORT OperatingSystemVersion); -VOID -LoadAndBootDrive(IN OperatingSystemItem* OperatingSystem, - IN USHORT OperatingSystemVersion);
Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/pc/hardware.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/pc/hardware.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/pc/hardware.h [iso-8859-1] Sun Feb 1 17:49:11 2015 @@ -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
Copied: trunk/reactos/boot/freeldr/freeldr/include/custom.h (from r66136, trunk/reactos/boot/freeldr/freeldr/include/arch/i386/custom.h) URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/i386/custom.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/custom.h [iso-8859-1] Sun Feb 1 17:49:11 2015 @@ -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 OptionMenuCustomBootBootSectorFile(VOID); VOID OptionMenuCustomBootReactOS(VOID); VOID OptionMenuCustomBootLinux(VOID); + +#endif // _M_IX86
Modified: trunk/reactos/boot/freeldr/freeldr/include/freeldr.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] Sun Feb 1 17:49:11 2015 @@ -66,6 +66,8 @@ #include <inifile.h> #include <keycodes.h> #include <linux.h> +#include <custom.h> +#include <miscboot.h> #include <machine.h> #include <mm.h> #include <multiboot.h> @@ -99,13 +101,11 @@ #include <arch/pc/machpc.h> #include <arch/pc/x86common.h> #include <arch/pc/pxe.h> -#include <arch/i386/custom.h> #include <arch/i386/drivemap.h> #endif #if defined(_M_IX86) #include <arch/i386/i386.h> #include <arch/i386/machxbox.h> -#include <arch/i386/miscboot.h> #include <internal/i386/intrin_i.h> #elif defined(_M_AMD64) #include <arch/amd64/amd64.h>
Modified: trunk/reactos/boot/freeldr/freeldr/include/linux.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/linux.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/linux.h [iso-8859-1] Sun Feb 1 17:49:11 2015 @@ -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 LinuxReadKernel(PFILE LinuxKernelFile); BOOLEAN LinuxCheckKernelVersion(VOID); BOOLEAN LinuxReadInitrd(PFILE LinuxInitrdFile); -#endif /* __i386__ */ + +#endif // _M_IX86
#endif // defined __LINUX_H
Copied: trunk/reactos/boot/freeldr/freeldr/include/miscboot.h (from r66136, trunk/reactos/boot/freeldr/freeldr/include/arch/i386/miscboot.h) URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/i386/miscboot.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/miscboot.h [iso-8859-1] Sun Feb 1 17:49:11 2015 @@ -19,6 +19,8 @@
#pragma once
+#ifdef _M_IX86 + VOID LoadAndBootBootSector(IN OperatingSystemItem* OperatingSystem, IN USHORT OperatingSystemVersion); @@ -28,3 +30,5 @@ VOID LoadAndBootDrive(IN OperatingSystemItem* OperatingSystem, IN USHORT OperatingSystemVersion); + +#endif // _M_IX86
Modified: trunk/reactos/boot/freeldr/freeldr/linuxboot.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/linuxb... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/linuxboot.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/linuxboot.c [iso-8859-1] Sun Feb 1 17:49:11 2015 @@ -21,8 +21,10 @@
#include <freeldr.h> #include <debug.h> -#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 @@ 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 @@ 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 @@
return TRUE; } -#endif /* __i386__ */ + +#endif // _M_IX86 + #endif
Copied: trunk/reactos/boot/freeldr/freeldr/miscboot.c (from r66136, trunk/reactos/boot/freeldr/freeldr/arch/i386/miscboot.c) URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/miscbo... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/miscboot.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/miscboot.c [iso-8859-1] Sun Feb 1 17:49:11 2015 @@ -19,6 +19,8 @@
#include <freeldr.h>
+#ifdef _M_IX86 + VOID LoadAndBootBootSector(IN OperatingSystemItem* OperatingSystem, IN USHORT OperatingSystemVersion) @@ -215,3 +217,5 @@ FrldrBootDrive = DriveNumber; ChainLoadBiosBootSectorCode(); } + +#endif // _M_IX86
Modified: trunk/reactos/boot/freeldr/freeldr/mm/mm.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/mm/mm.... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/mm/mm.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/mm/mm.c [iso-8859-1] Sun Feb 1 17:49:11 2015 @@ -21,8 +21,7 @@ #include <debug.h>
#if DBG -VOID DumpMemoryAllocMap(VOID); -VOID MemAllocTest(VOID); +VOID DumpMemoryAllocMap(VOID); #endif // DBG
DBG_DEFAULT_CHANNEL(MEMORY);