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;
143 switch (SelectedMenuItem)
145#if defined(_M_IX86) || defined(_M_AMD64)
147 EditCustomBootSector(&OperatingSystem);
150 EditCustomBootLinux(&OperatingSystem);
178#if defined(_M_IX86) || defined(_M_AMD64)
185 ULONG_PTR SectionId = OperatingSystem->SectionId;
186 CHAR SectionName[100];
199 CHAR BootSectorFile[200];
215 if (!*BootStrings.ArcPath)
219 IniReadSettingByName(SectionId,
"BootPartition", BootStrings.Partition,
sizeof(BootStrings.Partition));
226 if (!*BootStrings.ArcPath)
231 if (*BootStrings.Drive)
237 if (!*BootStrings.Drive)
244 if ((!*BootStrings.ArcPath &&
atoi(BootStrings.Partition) != 0) ||
245 (*BootStrings.ArcPath && !
strstr(BootStrings.ArcPath,
")partition()") &&
246 !
strstr(BootStrings.ArcPath,
")partition(0)")))
248 if (!
UiEditBox(BootSectorFilePrompt, BootSectorFile,
sizeof(BootSectorFile)))
257 if (*BootStrings.ArcPath)
261 else if (*BootStrings.Drive)
286 "CustomBootSector%u%u%u%u%u%u",
299 if (*BootStrings.ArcPath)
304 else if (*BootStrings.Drive)
321 OperatingSystem->SectionId = SectionId;
322 OperatingSystem->LoadIdentifier =
NULL;
330 ULONG_PTR SectionId = OperatingSystem->SectionId;
331 CHAR SectionName[100];
344 CHAR LinuxKernelString[200];
345 CHAR LinuxInitrdString[200];
346 CHAR LinuxCommandLineString[200];
352 RtlZeroMemory(LinuxCommandLineString,
sizeof(LinuxCommandLineString));
364 if (!*BootStrings.ArcPath)
368 IniReadSettingByName(SectionId,
"BootPartition", BootStrings.Partition,
sizeof(BootStrings.Partition));
373 IniReadSettingByName(SectionId,
"CommandLine", LinuxCommandLineString,
sizeof(LinuxCommandLineString));
376 if (!*BootStrings.ArcPath)
381 if (*BootStrings.Drive)
387 if (!*BootStrings.Drive)
393 if (!
UiEditBox(LinuxKernelPrompt, LinuxKernelString,
sizeof(LinuxKernelString)))
396 if (!
UiEditBox(LinuxInitrdPrompt, LinuxInitrdString,
sizeof(LinuxInitrdString)))
399 if (!
UiEditBox(LinuxCommandLinePrompt, LinuxCommandLineString,
sizeof(LinuxCommandLineString)))
406 if (*BootStrings.ArcPath)
410 else if (*BootStrings.Drive)
436 "CustomLinux%u%u%u%u%u%u",
449 if (*BootStrings.ArcPath)
454 else if (*BootStrings.Drive)
469 if (*LinuxInitrdString)
479 OperatingSystem->SectionId = SectionId;
480 OperatingSystem->LoadIdentifier =
"Custom Linux Setup";
491 ULONG_PTR SectionId = OperatingSystem->SectionId;
492 CHAR SectionName[100];
493 CHAR BootDriveString[20];
494 CHAR BootPartitionString[20];
495 CHAR ReactOSSystemPath[200];
496 CHAR ReactOSARCPath[200];
497 CHAR ReactOSOptions[200];
501 RtlZeroMemory(BootPartitionString,
sizeof(BootPartitionString));
544 "CustomReactOS%u%u%u%u%u%u",
559 atoi(BootPartitionString));
569 OperatingSystem->SectionId = SectionId;
570 OperatingSystem->LoadIdentifier =
NULL;
573#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 BOOLEAN ShowBootOptions, 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)