Author: hpoussin
Date: Fri Oct 30 22:48:21 2009
New Revision: 43854
URL:
http://svn.reactos.org/svn/reactos?rev=43854&view=rev
Log:
[freeldr] Move custom.c, drivemap.c/h, miscboot.c/h to i386 directories
Added:
trunk/reactos/boot/freeldr/freeldr/arch/i386/custom.c
- copied, changed from r43657, trunk/reactos/boot/freeldr/freeldr/custom.c
trunk/reactos/boot/freeldr/freeldr/arch/i386/drivemap.c
- copied, changed from r43657, trunk/reactos/boot/freeldr/freeldr/drivemap.c
trunk/reactos/boot/freeldr/freeldr/arch/i386/miscboot.c
- copied, changed from r43657, trunk/reactos/boot/freeldr/freeldr/miscboot.c
trunk/reactos/boot/freeldr/freeldr/include/arch/i386/custom.h
- copied, changed from r43657, trunk/reactos/boot/freeldr/freeldr/include/options.h
trunk/reactos/boot/freeldr/freeldr/include/arch/i386/drivemap.h
- copied, changed from r43657,
trunk/reactos/boot/freeldr/freeldr/include/drivemap.h
trunk/reactos/boot/freeldr/freeldr/include/arch/i386/miscboot.h
- copied, changed from r43657,
trunk/reactos/boot/freeldr/freeldr/include/miscboot.h
Removed:
trunk/reactos/boot/freeldr/freeldr/custom.c
trunk/reactos/boot/freeldr/freeldr/drivemap.c
trunk/reactos/boot/freeldr/freeldr/include/drivemap.h
trunk/reactos/boot/freeldr/freeldr/include/miscboot.h
trunk/reactos/boot/freeldr/freeldr/miscboot.c
Modified:
trunk/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild
trunk/reactos/boot/freeldr/freeldr/freeldr_base.rbuild
trunk/reactos/boot/freeldr/freeldr/include/freeldr.h
trunk/reactos/boot/freeldr/freeldr/include/options.h
trunk/reactos/boot/freeldr/freeldr/options.c
Copied: trunk/reactos/boot/freeldr/freeldr/arch/i386/custom.c (from r43657,
trunk/reactos/boot/freeldr/freeldr/custom.c)
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/custom.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/custom.c [iso-8859-1] Fri Oct 30 22:48:21
2009
@@ -12,9 +12,9 @@
* 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.
+ * 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>
@@ -34,13 +34,11 @@
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 @@
switch (SelectedMenuItem)
{
-#ifdef __i386__
case 0: // Disk
OptionMenuCustomBootDisk();
break;
@@ -69,11 +66,9 @@
case 4: // Linux
OptionMenuCustomBootLinux();
break;
-#endif /* __i386__ */
- }
-}
-
-#ifdef __i386__
+ }
+}
+
VOID OptionMenuCustomBootDisk(VOID)
{
CHAR SectionName[100];
@@ -408,4 +403,11 @@
LoadAndBootLinux(SectionName, "Custom Linux Setup");
}
-#endif /* __i386__ */
+
+VOID OptionMenuReboot(VOID)
+{
+ UiMessageBox("The system will now reboot.");
+
+ DiskStopFloppyMotor();
+ SoftReboot();
+}
Copied: trunk/reactos/boot/freeldr/freeldr/arch/i386/drivemap.c (from r43657,
trunk/reactos/boot/freeldr/freeldr/drivemap.c)
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/drivemap.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/drivemap.c [iso-8859-1] Fri Oct 30
22:48:21 2009
@@ -12,15 +12,14 @@
* 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.
+ * 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>
#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
@@ -221,4 +220,3 @@
DriveMapInstalled = FALSE;
}
}
-#endif /* __i386__ */
Copied: trunk/reactos/boot/freeldr/freeldr/arch/i386/miscboot.c (from r43657,
trunk/reactos/boot/freeldr/freeldr/miscboot.c)
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/miscboot.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/miscboot.c [iso-8859-1] Fri Oct 30
22:48:21 2009
@@ -12,14 +12,13 @@
* 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.
+ * 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>
-#ifdef __i386__
VOID LoadAndBootBootSector(PCSTR OperatingSystemName)
{
PFILE FilePointer;
@@ -211,4 +210,3 @@
//DisableA20();
ChainLoadBiosBootSectorCode();
}
-#endif /* __i386__ */
Removed: trunk/reactos/boot/freeldr/freeldr/custom.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/custo…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/custom.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/custom.c (removed)
@@ -1,411 +1,0 @@
-/*
- * FreeLoader
- * Copyright (C) 1998-2003 Brian Palmer <brianp(a)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[] = {
-#ifdef __i386__
- "Disk",
- "Partition",
- "Boot Sector File",
- "ReactOS",
- "Linux"
-#endif /* __i386__ */
- };
- ULONG CustomBootMenuCount = sizeof(CustomBootMenuList) /
sizeof(CustomBootMenuList[0]);
- ULONG SelectedMenuItem;
-
- if (!UiDisplayMenu(CustomBootMenuList, CustomBootMenuCount, 0, -1,
&SelectedMenuItem, TRUE, NULL))
- {
- // The user pressed ESC
- return;
- }
-
- switch (SelectedMenuItem)
- {
-#ifdef __i386__
- 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;
-#endif /* __i386__ */
- }
-}
-
-#ifdef __i386__
-VOID OptionMenuCustomBootDisk(VOID)
-{
- CHAR SectionName[100];
- CHAR BootDriveString[20];
- ULONG SectionId;
- TIMEINFO* TimeInfo;
-
- 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);
-
- LoadAndBootDrive(SectionName);
-}
-
-VOID OptionMenuCustomBootPartition(VOID)
-{
- CHAR SectionName[100];
- CHAR BootDriveString[20];
- CHAR BootPartitionString[20];
- ULONG SectionId;
- TIMEINFO* TimeInfo;
-
- 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);
-
- LoadAndBootPartition(SectionName);
-}
-
-VOID OptionMenuCustomBootBootSectorFile(VOID)
-{
- CHAR SectionName[100];
- CHAR BootDriveString[20];
- CHAR BootPartitionString[20];
- CHAR BootSectorFileString[200];
- ULONG SectionId;
- TIMEINFO* TimeInfo;
-
- 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);
-
- LoadAndBootBootSector(SectionName);
-}
-
-VOID OptionMenuCustomBootReactOS(VOID)
-{
- CHAR SectionName[100];
- CHAR BootDriveString[20];
- CHAR BootPartitionString[20];
- CHAR ReactOSSystemPath[200];
- CHAR ReactOSARCPath[200];
- CHAR ReactOSOptions[200];
- ULONG SectionId;
- TIMEINFO* TimeInfo;
-
- 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", "ReactOS"))
- {
- 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);
-
- LoadAndBootReactOS(SectionName);
-}
-
-VOID OptionMenuCustomBootLinux(VOID)
-{
- CHAR SectionName[100];
- CHAR BootDriveString[20];
- CHAR BootPartitionString[20];
- CHAR LinuxKernelString[200];
- CHAR LinuxInitrdString[200];
- CHAR LinuxCommandLineString[200];
- ULONG SectionId;
- TIMEINFO* TimeInfo;
-
- 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);
-
- LoadAndBootLinux(SectionName, "Custom Linux Setup");
-}
-#endif /* __i386__ */
Removed: trunk/reactos/boot/freeldr/freeldr/drivemap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/drive…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/drivemap.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/drivemap.c (removed)
@@ -1,224 +1,0 @@
-/*
- * FreeLoader
- * Copyright (C) 1998-2003 Brian Palmer <brianp(a)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>
-#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
-ULONG DriveMapHandlerSegOff = 0; // Segment:offset style address of our drive map
handler
-
-VOID DriveMapMapDrivesInSection(PCSTR SectionName)
-{
- CHAR SettingName[80];
- CHAR SettingValue[80];
- CHAR ErrorText[260];
- CHAR Drive1[80];
- CHAR Drive2[80];
- ULONG SectionId;
- ULONG SectionItemCount;
- ULONG Index;
- ULONG Index2;
- DRIVE_MAP_LIST DriveMapList;
-
- RtlZeroMemory(&DriveMapList, sizeof(DRIVE_MAP_LIST));
-
- if (!IniOpenSection(SectionName, &SectionId))
- {
- return;
- }
-
- // Get the number of items in this section
- SectionItemCount = IniGetNumSectionItems(SectionId);
-
- // Loop through each one and check if its a DriveMap= setting
- for (Index=0; Index<SectionItemCount; Index++)
- {
- // Get the next setting from the .ini file section
- if (IniReadSettingByNumber(SectionId, Index, SettingName, sizeof(SettingName),
SettingValue, sizeof(SettingValue)))
- {
- if (_stricmp(SettingName, "DriveMap") == 0)
- {
- // Make sure we haven't exceeded the drive map max count
- if (DriveMapList.DriveMapCount >= 4)
- {
- sprintf(ErrorText, "Max DriveMap count exceeded in section
[%s]:\n\n%s=%s", SectionName, SettingName, SettingValue);
- UiMessageBox(ErrorText);
- continue;
- }
-
- RtlZeroMemory(Drive1, 80);
- RtlZeroMemory(Drive2, 80);
-
- strcpy(Drive1, SettingValue);
-
- // Parse the setting value and separate a string "hd0,hd1"
- // into two strings "hd0" and "hd1"
- for (Index2=0; Index2<strlen(Drive1); Index2++)
- {
- // Check if this character is the separater character (comma - ',')
- if (Drive1[Index2] == ',')
- {
- Drive1[Index2] = '\0';
- strcpy(Drive2, &Drive1[Index2+1]);
- break;
- }
- }
-
- // Make sure we got good values before we add them to the map
- if (!DriveMapIsValidDriveString(Drive1) || !DriveMapIsValidDriveString(Drive2))
- {
- sprintf(ErrorText, "Error in DriveMap setting in section [%s]:\n\n%s=%s",
SectionName, SettingName, SettingValue);
- UiMessageBox(ErrorText);
- continue;
- }
-
- // Add them to the map
- DriveMapList.DriveMap[(DriveMapList.DriveMapCount * 2)] =
DriveMapGetBiosDriveNumber(Drive1);
- DriveMapList.DriveMap[(DriveMapList.DriveMapCount * 2)+1] =
DriveMapGetBiosDriveNumber(Drive2);
- DriveMapList.DriveMapCount++;
-
- DPRINTM(DPRINT_WARNING, "Mapping BIOS drive 0x%x to drive 0x%x\n",
DriveMapGetBiosDriveNumber(Drive1), DriveMapGetBiosDriveNumber(Drive2));
- }
- }
- }
-
- if (DriveMapList.DriveMapCount)
- {
- DPRINTM(DPRINT_WARNING, "Installing Int13 drive map for %d drives.\n",
DriveMapList.DriveMapCount);
- DriveMapInstallInt13Handler(&DriveMapList);
- }
- else
- {
- DPRINTM(DPRINT_WARNING, "Removing any previously installed Int13 drive
map.\n");
- DriveMapRemoveInt13Handler();
- }
-}
-
-BOOLEAN DriveMapIsValidDriveString(PCSTR DriveString)
-{
- ULONG Index;
-
- // Now verify that the user has given us appropriate strings
- if ((strlen(DriveString) < 3) ||
- ((DriveString[0] != 'f') && (DriveString[0] != 'F') &&
(DriveString[0] != 'h') && (DriveString[0] != 'H')) ||
- ((DriveString[1] != 'd') && (DriveString[1] != 'D')))
- {
- return FALSE;
- }
-
- // Now verify that the user has given us appropriate numbers
- // Make sure that only numeric characters were given
- for (Index=2; Index<strlen(DriveString); Index++)
- {
- if (DriveString[Index] < '0' || DriveString[Index] > '9')
- {
- return FALSE;
- }
- }
- // Now make sure that they are not outrageous values (i.e. hd90874)
- if ((atoi(&DriveString[2]) < 0) || (atoi(&DriveString[2]) > 0xff))
- {
- return FALSE;
- }
-
- return TRUE;
-}
-
-ULONG DriveMapGetBiosDriveNumber(PCSTR DeviceName)
-{
- ULONG BiosDriveNumber = 0;
-
- // If they passed in a number string then just
- // convert it to decimal and return it
- if (DeviceName[0] >= '0' && DeviceName[0] <= '9')
- {
- return atoi(DeviceName);
- }
-
- // Convert the drive number string into a number
- // 'hd1' = 1
- BiosDriveNumber = atoi(&DeviceName[2]);
-
- // If it's a hard disk then set the high bit
- if ((DeviceName[0] == 'h' || DeviceName[0] == 'H') &&
- (DeviceName[1] == 'd' || DeviceName[1] == 'D'))
- {
- BiosDriveNumber |= 0x80;
- }
-
- return BiosDriveNumber;
-}
-
-VOID DriveMapInstallInt13Handler(PDRIVE_MAP_LIST DriveMap)
-{
- ULONG* RealModeIVT = (ULONG*)0x00000000;
- USHORT* BiosLowMemorySize = (USHORT*)0x00000413;
-
- if (!DriveMapInstalled)
- {
- // Get the old INT 13h handler address from the vector table
- OldInt13HandlerAddress = RealModeIVT[0x13];
-
- // Decrease the size of low memory
- (*BiosLowMemorySize)--;
-
- // Get linear address for drive map handler
- DriveMapHandlerAddress = (ULONG)(*BiosLowMemorySize) << 10;
-
- // Convert to segment:offset style address
- DriveMapHandlerSegOff = (DriveMapHandlerAddress << 12) & 0xffff0000;
- }
-
- // Copy the drive map structure to the proper place
- RtlCopyMemory(&DriveMapInt13HandlerMapList, DriveMap, sizeof(DRIVE_MAP_LIST));
-
- // Set the address of the BIOS INT 13h handler
- DriveMapOldInt13HandlerAddress = OldInt13HandlerAddress;
-
- // Copy the code to our reserved area
- RtlCopyMemory((PVOID)DriveMapHandlerAddress, &DriveMapInt13HandlerStart,
((ULONG)&DriveMapInt13HandlerEnd - (ULONG)&DriveMapInt13HandlerStart));
-
- // Update the IVT
- RealModeIVT[0x13] = DriveMapHandlerSegOff;
-
- CacheInvalidateCacheData();
- DriveMapInstalled = TRUE;
-}
-
-VOID DriveMapRemoveInt13Handler(VOID)
-{
- ULONG* RealModeIVT = (ULONG*)0x00000000;
- USHORT* BiosLowMemorySize = (USHORT*)0x00000413;
-
- if (DriveMapInstalled)
- {
- // Get the old INT 13h handler address from the vector table
- RealModeIVT[0x13] = OldInt13HandlerAddress;
-
- // Increase the size of low memory
- (*BiosLowMemorySize)++;
-
- CacheInvalidateCacheData();
- DriveMapInstalled = FALSE;
- }
-}
-#endif /* __i386__ */
Modified: trunk/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/freel…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild [iso-8859-1] Fri Oct 30
22:48:21 2009
@@ -25,6 +25,8 @@
<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>
@@ -34,6 +36,7 @@
<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>
Modified: trunk/reactos/boot/freeldr/freeldr/freeldr_base.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/freel…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/freeldr_base.rbuild [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/freeldr_base.rbuild [iso-8859-1] Fri Oct 30
22:48:21 2009
@@ -85,10 +85,7 @@
<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>
Copied: trunk/reactos/boot/freeldr/freeldr/include/arch/i386/custom.h (from r43657,
trunk/reactos/boot/freeldr/freeldr/include/options.h)
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/options.h [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/arch/i386/custom.h [iso-8859-1] Fri Oct 30
22:48:21 2009
@@ -17,20 +17,19 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#ifndef __OPTIONS_H
-#define __OPTIONS_H
+#ifndef __I386_OPTIONS_H
+#define __I386_OPTIONS_H
-VOID DoOptionsMenu(VOID);
+#define HAS_OPTION_MENU_CUSTOM_BOOT
+#define HAS_OPTION_MENU_REBOOT
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
+#endif // #defined __I386_OPTIONS_H
Copied: trunk/reactos/boot/freeldr/freeldr/include/arch/i386/drivemap.h (from r43657,
trunk/reactos/boot/freeldr/freeldr/include/drivemap.h)
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/drivemap.h [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/arch/i386/drivemap.h [iso-8859-1] Fri Oct
30 22:48:21 2009
@@ -12,15 +12,14 @@
* 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.
+ * 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.
*/
-#ifndef __DRIVEMAP_H
-#define __DRIVEMAP_H
+#ifndef __I386_DRIVEMAP_H
+#define __I386_DRIVEMAP_H
-#ifdef __i386__
#include <pshpack1.h>
typedef struct
{
@@ -39,6 +38,5 @@
extern PVOID DriveMapInt13HandlerEnd;
extern ULONG DriveMapOldInt13HandlerAddress;
extern DRIVE_MAP_LIST DriveMapInt13HandlerMapList;
-#endif /* __i386__ */
-#endif // #defined __DRIVEMAP_H
+#endif // #defined __I386_DRIVEMAP_H
Copied: trunk/reactos/boot/freeldr/freeldr/include/arch/i386/miscboot.h (from r43657,
trunk/reactos/boot/freeldr/freeldr/include/miscboot.h)
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/miscboot.h [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/arch/i386/miscboot.h [iso-8859-1] Fri Oct
30 22:48:21 2009
@@ -12,18 +12,16 @@
* 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.
+ * 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.
*/
-#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
Removed: trunk/reactos/boot/freeldr/freeldr/include/drivemap.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/drivemap.h [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/drivemap.h (removed)
@@ -1,44 +1,0 @@
-/*
- * FreeLoader
- * Copyright (C) 1998-2003 Brian Palmer <brianp(a)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.
- */
-
-#ifndef __DRIVEMAP_H
-#define __DRIVEMAP_H
-
-#ifdef __i386__
-#include <pshpack1.h>
-typedef struct
-{
- UCHAR DriveMapCount; // Count of drives currently mapped
- CHAR DriveMap[8]; // Map of BIOS drives
-} DRIVE_MAP_LIST, *PDRIVE_MAP_LIST;
-#include <poppack.h>
-
-VOID DriveMapMapDrivesInSection(PCSTR SectionName);
-BOOLEAN DriveMapIsValidDriveString(PCSTR DriveString); // Checks the drive string
("hd0") for validity
-ULONG DriveMapGetBiosDriveNumber(PCSTR DeviceName); // Returns a BIOS drive number for
any given device name (e.g. 0x80 for 'hd0')
-VOID DriveMapInstallInt13Handler(PDRIVE_MAP_LIST DriveMap); // Installs the int 13h
handler for the drive mapper
-VOID DriveMapRemoveInt13Handler(VOID); // Removes a previously installed int 13h
drive map handler
-
-extern PVOID DriveMapInt13HandlerStart;
-extern PVOID DriveMapInt13HandlerEnd;
-extern ULONG DriveMapOldInt13HandlerAddress;
-extern DRIVE_MAP_LIST DriveMapInt13HandlerMapList;
-#endif /* __i386__ */
-
-#endif // #defined __DRIVEMAP_H
Modified: trunk/reactos/boot/freeldr/freeldr/include/freeldr.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] Fri Oct 30 22:48:21
2009
@@ -71,10 +71,13 @@
#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)
@@ -96,8 +99,6 @@
/* Needed by boot manager */
#include <bootmgr.h>
#include <oslist.h>
-#include <drivemap.h>
-#include <miscboot.h>
#include <options.h>
#include <linux.h>
/* Externals */
Removed: trunk/reactos/boot/freeldr/freeldr/include/miscboot.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/miscboot.h [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/miscboot.h (removed)
@@ -1,29 +1,0 @@
-/*
- * FreeLoader
- * Copyright (C) 1998-2003 Brian Palmer <brianp(a)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.
- */
-
-#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
Modified: trunk/reactos/boot/freeldr/freeldr/include/options.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/options.h [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/options.h [iso-8859-1] Fri Oct 30 22:48:21
2009
@@ -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
Removed: trunk/reactos/boot/freeldr/freeldr/miscboot.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/miscb…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/miscboot.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/miscboot.c (removed)
@@ -1,214 +1,0 @@
-/*
- * FreeLoader
- * Copyright (C) 1998-2003 Brian Palmer <brianp(a)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>
-
-#ifdef __i386__
-VOID LoadAndBootBootSector(PCSTR OperatingSystemName)
-{
- PFILE FilePointer;
- CHAR SettingName[80];
- ULONG SectionId;
- CHAR FileName[260];
- ULONG BytesRead;
-
- // Find all the message box settings and run them
- UiShowMessageBoxesInSection(OperatingSystemName);
-
- // Try to open the operating system section in the .ini file
- if (!IniOpenSection(OperatingSystemName, &SectionId))
- {
- sprintf(SettingName, "Section [%s] not found in freeldr.ini.\n",
OperatingSystemName);
- UiMessageBox(SettingName);
- return;
- }
-
- if (!IniReadSettingByName(SectionId, "BootSectorFile", FileName,
sizeof(FileName)))
- {
- UiMessageBox("Boot sector file not specified for selected OS!");
- return;
- }
-
- if (!MachDiskNormalizeSystemPath(FileName, sizeof(FileName)))
- {
- UiMessageBox("Invalid path to boot sector file");
- 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(PCSTR OperatingSystemName)
-{
- CHAR SettingName[80];
- CHAR SettingValue[80];
- ULONG SectionId;
- PARTITION_TABLE_ENTRY PartitionTableEntry;
- ULONG DriveNumber;
- ULONG PartitionNumber;
-
- // Find all the message box settings and run them
- UiShowMessageBoxesInSection(OperatingSystemName);
-
- // Try to open the operating system section in the .ini file
- if (!IniOpenSection(OperatingSystemName, &SectionId))
- {
- sprintf(SettingName, "Section [%s] not found in freeldr.ini.\n",
OperatingSystemName);
- 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();
- ChainLoadBiosBootSectorCode();
-}
-
-VOID LoadAndBootDrive(PCSTR OperatingSystemName)
-{
- CHAR SettingName[80];
- CHAR SettingValue[80];
- ULONG SectionId;
- ULONG DriveNumber;
-
- // Find all the message box settings and run them
- UiShowMessageBoxesInSection(OperatingSystemName);
-
- // Try to open the operating system section in the .ini file
- if (!IniOpenSection(OperatingSystemName, &SectionId))
- {
- sprintf(SettingName, "Section [%s] not found in freeldr.ini.\n",
OperatingSystemName);
- 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();
- ChainLoadBiosBootSectorCode();
-}
-#endif /* __i386__ */
Modified: trunk/reactos/boot/freeldr/freeldr/options.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/optio…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/options.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/options.c [iso-8859-1] Fri Oct 30 22:48:21 2009
@@ -35,8 +35,12 @@
"SEPARATOR",
+#ifdef HAS_OPTION_MENU_CUSTOM_BOOT
"Custom Boot",
+#endif
+#ifdef HAS_OPTION_MENU_REBOOT
"Reboot",
+#endif
};
enum OptionMenuItems
@@ -55,8 +59,12 @@
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 @@
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
}