26#if defined(_M_IX86) || defined(_M_AMD64)
27static const PCSTR BootSectorFilePrompt =
28 "Enter the boot sector file path.\n"
29 "Leave blank for booting a disk or partition.\n"
34static const PCSTR LinuxKernelPrompt =
35 "Enter the Linux kernel image path.\n"
39 "/boot/vmlinuz-2.4.18";
40static const PCSTR LinuxInitrdPrompt =
41 "Enter the initrd image path.\n"
42 "Leave blank for no initial ramdisk.\n"
47static const PCSTR LinuxCommandLinePrompt =
48 "Enter the Linux kernel command line.\n"
52 "root=/dev/fd0 read-only\n"
53 "root=/dev/sdb1 init=/sbin/init";
57 "Enter the boot drive.\n"
60 "fd0 - first floppy drive\n"
61 "hd0 - first hard drive\n"
62 "hd1 - second hard drive\n"
63 "cd0 - first CD-ROM drive.\n"
65 "BIOS drive numbers may also be used:\n"
66 "0 - first floppy drive\n"
67 "0x80 - first hard drive\n"
68 "0x81 - second hard drive";
70 "Enter the boot partition.\n";
80 "Enter the boot ARC path.\n"
83 "multi(0)disk(0)rdisk(0)partition(1)\n"
84 "multi(0)disk(0)fdisk(0)";
87 "Enter the path to your ReactOS system directory.\n"
93 "Enter the load options you want passed to the kernel.\n"
96 "/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200\n"
97 "/FASTDETECT /SOS /NOGUIBOOT\n"
98 "/BASEVIDEO /MAXMEM=64\n"
99 "/KERNEL=NTKRNLMP.EXE /HAL=HALMPS.DLL";
101 "Enter additional load options you want passed to the ReactOS Setup.\n"
102 "These options will supplement those obtained from the TXTSETUP.SIF\n"
103 "file, unless you also specify the /SIFOPTIONSOVERRIDE option switch.\n"
106 "/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /NOGUIBOOT";
109 "Press ENTER to boot your custom boot setup.";
113#ifdef HAS_OPTION_MENU_CUSTOM_BOOT
117 PCSTR CustomBootMenuList[] = {
118#if defined(_M_IX86) || defined(_M_AMD64)
119 "Boot Sector (Disk/Partition/File)",
125 ULONG SelectedMenuItem;
142 switch (SelectedMenuItem)
144#if defined(_M_IX86) || defined(_M_AMD64)
146 EditCustomBootSector(&OperatingSystem);
149 EditCustomBootLinux(&OperatingSystem);
177#if defined(_M_IX86) || defined(_M_AMD64)
184 ULONG_PTR SectionId = OperatingSystem->SectionId;
185 CHAR SectionName[100];
198 CHAR BootSectorFile[200];
214 if (!*BootStrings.ArcPath)
218 IniReadSettingByName(SectionId,
"BootPartition", BootStrings.Partition,
sizeof(BootStrings.Partition));
225 if (!*BootStrings.ArcPath)
230 if (*BootStrings.Drive)
236 if (!*BootStrings.Drive)
243 if ((!*BootStrings.ArcPath &&
atoi(BootStrings.Partition) != 0) ||
244 (*BootStrings.ArcPath && !
strstr(BootStrings.ArcPath,
")partition()") &&
245 !
strstr(BootStrings.ArcPath,
")partition(0)")))
247 if (!
UiEditBox(BootSectorFilePrompt, BootSectorFile,
sizeof(BootSectorFile)))
256 if (*BootStrings.ArcPath)
260 else if (*BootStrings.Drive)
285 "CustomBootSector%u%u%u%u%u%u",
298 if (*BootStrings.ArcPath)
303 else if (*BootStrings.Drive)
320 OperatingSystem->SectionId = SectionId;
321 OperatingSystem->LoadIdentifier =
NULL;
329 ULONG_PTR SectionId = OperatingSystem->SectionId;
330 CHAR SectionName[100];
343 CHAR LinuxKernelString[200];
344 CHAR LinuxInitrdString[200];
345 CHAR LinuxCommandLineString[200];
351 RtlZeroMemory(LinuxCommandLineString,
sizeof(LinuxCommandLineString));
363 if (!*BootStrings.ArcPath)
367 IniReadSettingByName(SectionId,
"BootPartition", BootStrings.Partition,
sizeof(BootStrings.Partition));
372 IniReadSettingByName(SectionId,
"CommandLine", LinuxCommandLineString,
sizeof(LinuxCommandLineString));
375 if (!*BootStrings.ArcPath)
380 if (*BootStrings.Drive)
386 if (!*BootStrings.Drive)
392 if (!
UiEditBox(LinuxKernelPrompt, LinuxKernelString,
sizeof(LinuxKernelString)))
395 if (!
UiEditBox(LinuxInitrdPrompt, LinuxInitrdString,
sizeof(LinuxInitrdString)))
398 if (!
UiEditBox(LinuxCommandLinePrompt, LinuxCommandLineString,
sizeof(LinuxCommandLineString)))
405 if (*BootStrings.ArcPath)
409 else if (*BootStrings.Drive)
435 "CustomLinux%u%u%u%u%u%u",
448 if (*BootStrings.ArcPath)
453 else if (*BootStrings.Drive)
468 if (*LinuxInitrdString)
478 OperatingSystem->SectionId = SectionId;
479 OperatingSystem->LoadIdentifier =
"Custom Linux Setup";
490 ULONG_PTR SectionId = OperatingSystem->SectionId;
491 CHAR SectionName[100];
492 CHAR BootDriveString[20];
493 CHAR BootPartitionString[20];
494 CHAR ReactOSSystemPath[200];
495 CHAR ReactOSARCPath[200];
496 CHAR ReactOSOptions[200];
500 RtlZeroMemory(BootPartitionString,
sizeof(BootPartitionString));
543 "CustomReactOS%u%u%u%u%u%u",
558 atoi(BootPartitionString));
568 OperatingSystem->SectionId = SectionId;
569 OperatingSystem->LoadIdentifier =
NULL;
572#ifdef HAS_OPTION_MENU_REBOOT
char * strstr(char *String1, char *String2)
TIMEINFO * ArcGetTime(VOID)
VOID ConstructArcPath(PCHAR ArcPath, PCHAR SystemFolder, UCHAR Disk, ULONG Partition)
static const PCSTR BootPartitionPrompt
VOID EditCustomBootReactOS(IN OUT OperatingSystemItem *OperatingSystem, IN BOOLEAN IsSetup)
static const PCSTR ARCPathPrompt
static const PCSTR ReactOSSetupOptionsPrompt
static const PCSTR ReactOSSystemPathPrompt
static const PCSTR BootDrivePrompt
static const PCSTR CustomBootPrompt
static const PCSTR ReactOSOptionsPrompt
#define DriveMapGetBiosDriveNumber(DeviceName)
BOOLEAN UiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
BOOLEAN UiDisplayMenu(IN PCSTR MenuHeader, IN PCSTR MenuFooter OPTIONAL, IN PCSTR MenuItemList[], IN ULONG MenuItemCount, IN ULONG DefaultMenuItem, IN LONG MenuTimeOut, OUT PULONG SelectedMenuItem, IN BOOLEAN CanEscape, IN UiMenuKeyPressFilterCallback KeyPressFilter OPTIONAL, IN PVOID Context OPTIONAL)
VOID UiMessageBox(_In_ PCSTR Format,...)
VOID OptionMenuCustomBoot(VOID)
VOID OptionMenuReboot(VOID)
VOID LoadOperatingSystem(_In_ OperatingSystemItem *OperatingSystem)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
PINI_SECTION IniAddSection(_In_ PINICACHE Cache, _In_ PCWSTR Name)
BOOLEAN IniAddSettingValueToSection(ULONG_PTR SectionId, PCSTR SettingName, PCSTR SettingValue)
BOOLEAN IniModifySettingValue(ULONG_PTR SectionId, PCSTR SettingName, PCSTR SettingValue)
BOOLEAN IniReadSettingByName(ULONG_PTR SectionId, PCSTR SettingName, PCHAR Buffer, ULONG BufferSize)
NTSTRSAFEVAPI RtlStringCbPrintfA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat,...)
#define RtlZeroMemory(Destination, Length)