"ReactOS",
"Linux"
};
- ULONG CustomBootMenuCount = sizeof(CustomBootMenuList) / sizeof(CustomBootMenuList[0]);
- ULONG SelectedMenuItem;
+ ULONG CustomBootMenuCount = sizeof(CustomBootMenuList) / sizeof(CustomBootMenuList[0]);
+ ULONG SelectedMenuItem;
- if (!UiDisplayMenu(CustomBootMenuList, CustomBootMenuCount, 0, -1, &SelectedMenuItem, TRUE, NULL))
+ if (!UiDisplayMenu("Please choose a boot method:",
+ CustomBootMenuList,
+ CustomBootMenuCount,
+ 0, -1,
+ &SelectedMenuItem,
+ TRUE,
+ NULL))
{
// The user pressed ESC
return;
case 2: // Boot Sector File
OptionMenuCustomBootBootSectorFile();
break;
- case 3: // ReactOS
- OptionMenuCustomBootReactOS();
- break;
case 4: // Linux
OptionMenuCustomBootLinux();
break;
VOID OptionMenuCustomBootDisk(VOID)
{
- CHAR SectionName[100];
- CHAR BootDriveString[20];
- ULONG SectionId;
+ ULONG_PTR SectionId;
+ CHAR SectionName[100];
+ CHAR BootDriveString[20];
TIMEINFO* TimeInfo;
+ OperatingSystemItem OperatingSystem;
RtlZeroMemory(SectionName, sizeof(SectionName));
RtlZeroMemory(BootDriveString, sizeof(BootDriveString));
UiMessageBox(CustomBootPrompt);
- LoadAndBootDrive(SectionName);
+ OperatingSystem.SystemPartition = SectionName;
+ OperatingSystem.LoadIdentifier = NULL;
+ OperatingSystem.OsLoadOptions = NULL;
+
+ LoadAndBootDrive(&OperatingSystem, 0);
}
VOID OptionMenuCustomBootPartition(VOID)
{
- CHAR SectionName[100];
- CHAR BootDriveString[20];
- CHAR BootPartitionString[20];
- ULONG SectionId;
+ ULONG_PTR SectionId;
+ CHAR SectionName[100];
+ CHAR BootDriveString[20];
+ CHAR BootPartitionString[20];
TIMEINFO* TimeInfo;
+ OperatingSystemItem OperatingSystem;
RtlZeroMemory(SectionName, sizeof(SectionName));
RtlZeroMemory(BootDriveString, sizeof(BootDriveString));
UiMessageBox(CustomBootPrompt);
- LoadAndBootPartition(SectionName);
+ OperatingSystem.SystemPartition = SectionName;
+ OperatingSystem.LoadIdentifier = NULL;
+ OperatingSystem.OsLoadOptions = NULL;
+
+ LoadAndBootPartition(&OperatingSystem, 0);
}
VOID OptionMenuCustomBootBootSectorFile(VOID)
{
- CHAR SectionName[100];
- CHAR BootDriveString[20];
- CHAR BootPartitionString[20];
- CHAR BootSectorFileString[200];
- ULONG SectionId;
+ 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));
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;
- }
+ OperatingSystem.SystemPartition = SectionName;
+ OperatingSystem.LoadIdentifier = NULL;
+ OperatingSystem.OsLoadOptions = NULL;
- UiMessageBox(CustomBootPrompt);
-
- LoadAndBootReactOS(SectionName);
+ LoadAndBootBootSector(&OperatingSystem, 0);
}
VOID OptionMenuCustomBootLinux(VOID)
{
- CHAR SectionName[100];
- CHAR BootDriveString[20];
- CHAR BootPartitionString[20];
- CHAR LinuxKernelString[200];
- CHAR LinuxInitrdString[200];
- CHAR LinuxCommandLineString[200];
- ULONG SectionId;
+ 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));
UiMessageBox(CustomBootPrompt);
- LoadAndBootLinux(SectionName, "Custom Linux Setup");
+ OperatingSystem.SystemPartition = SectionName;
+ OperatingSystem.LoadIdentifier = "Custom Linux Setup";
+ OperatingSystem.OsLoadOptions = NULL;
+
+ LoadAndBootLinux(&OperatingSystem, 0);
}
VOID OptionMenuReboot(VOID)
UiMessageBox("The system will now reboot.");
DiskStopFloppyMotor();
- SoftReboot();
+ Reboot();
}