26#if defined(_M_IX86) || defined(_M_AMD64)
28const CHAR BootSectorFilePrompt[] =
"Enter the boot sector file path.\n\nExamples:\n\\BOOTSECT.DOS\n/boot/bootsect.dos";
29const CHAR LinuxKernelPrompt[] =
"Enter the Linux kernel image path.\n\nExamples:\n/vmlinuz\n/boot/vmlinuz-2.4.18";
30const 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.";
31const CHAR LinuxCommandLinePrompt[] =
"Enter the Linux kernel command line.\n\nExamples:\nroot=/dev/hda1\nroot=/dev/fd0 read-only\nroot=/dev/sdb1 init=/sbin/init";
35const 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";
37const CHAR ARCPathPrompt[] =
"Enter the boot ARC path.\n\nExamples:\nmulti(0)disk(0)rdisk(0)partition(1)\nmulti(0)disk(0)fdisk(0)";
39const CHAR ReactOSOptionsPrompt[] =
"Enter the load 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";
40const CHAR ReactOSSetupOptionsPrompt[] =
"Enter additional load options you want passed to the ReactOS Setup.\nThese options will supplement those obtained from the TXTSETUP.SIF\nfile, unless you also specify the /SIFOPTIONSOVERRIDE option switch.\n\nExample:\n/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /NOGUIBOOT";
45#ifdef HAS_OPTION_MENU_CUSTOM_BOOT
49 PCSTR CustomBootMenuList[] = {
50#if defined(_M_IX86) || defined(_M_AMD64)
59 ULONG SelectedMenuItem;
77 switch (SelectedMenuItem)
79#if defined(_M_IX86) || defined(_M_AMD64)
81 EditCustomBootDisk(&OperatingSystem);
84 EditCustomBootPartition(&OperatingSystem);
87 EditCustomBootSectorFile(&OperatingSystem);
90 EditCustomBootLinux(&OperatingSystem);
118#if defined(_M_IX86) || defined(_M_AMD64)
125 ULONG_PTR SectionId = OperatingSystem->SectionId;
126 CHAR SectionName[100];
149 if (!*BootStrings.ArcPath)
156 if (!*BootStrings.ArcPath)
161 if (!*BootStrings.Drive)
171 if (*BootStrings.ArcPath)
175 else if (*BootStrings.Drive)
186 "CustomBootDisk%u%u%u%u%u%u",
199 if (*BootStrings.ArcPath)
204 else if (*BootStrings.Drive)
211 OperatingSystem->SectionId = SectionId;
212 OperatingSystem->LoadIdentifier =
NULL;
216EditCustomBootPartition(
220 ULONG_PTR SectionId = OperatingSystem->SectionId;
221 CHAR SectionName[100];
248 if (!*BootStrings.ArcPath)
252 IniReadSettingByName(SectionId,
"BootPartition", BootStrings.Partition,
sizeof(BootStrings.Partition));
256 if (!*BootStrings.ArcPath)
261 if (*BootStrings.Drive)
267 if (!*BootStrings.Drive)
277 if (*BootStrings.ArcPath)
281 else if (*BootStrings.Drive)
293 "CustomBootPartition%u%u%u%u%u%u",
306 if (*BootStrings.ArcPath)
311 else if (*BootStrings.Drive)
321 OperatingSystem->SectionId = SectionId;
322 OperatingSystem->LoadIdentifier =
NULL;
326EditCustomBootSectorFile(
330 ULONG_PTR SectionId = OperatingSystem->SectionId;
331 CHAR SectionName[100];
344 CHAR BootSectorFileString[200];
348 RtlZeroMemory(BootSectorFileString,
sizeof(BootSectorFileString));
360 if (!*BootStrings.ArcPath)
364 IniReadSettingByName(SectionId,
"BootPartition", BootStrings.Partition,
sizeof(BootStrings.Partition));
367 IniReadSettingByName(SectionId,
"BootSectorFile", BootSectorFileString,
sizeof(BootSectorFileString));
370 if (!*BootStrings.ArcPath)
375 if (*BootStrings.Drive)
381 if (!*BootStrings.Drive)
387 if (!
UiEditBox(BootSectorFilePrompt, BootSectorFileString,
sizeof(BootSectorFileString)))
394 if (*BootStrings.ArcPath)
398 else if (*BootStrings.Drive)
422 "CustomBootSectorFile%u%u%u%u%u%u",
435 if (*BootStrings.ArcPath)
440 else if (*BootStrings.Drive)
454 OperatingSystem->SectionId = SectionId;
455 OperatingSystem->LoadIdentifier =
NULL;
463 ULONG_PTR SectionId = OperatingSystem->SectionId;
464 CHAR SectionName[100];
477 CHAR LinuxKernelString[200];
478 CHAR LinuxInitrdString[200];
479 CHAR LinuxCommandLineString[200];
485 RtlZeroMemory(LinuxCommandLineString,
sizeof(LinuxCommandLineString));
497 if (!*BootStrings.ArcPath)
501 IniReadSettingByName(SectionId,
"BootPartition", BootStrings.Partition,
sizeof(BootStrings.Partition));
506 IniReadSettingByName(SectionId,
"CommandLine", LinuxCommandLineString,
sizeof(LinuxCommandLineString));
509 if (!*BootStrings.ArcPath)
514 if (*BootStrings.Drive)
520 if (!*BootStrings.Drive)
526 if (!
UiEditBox(LinuxKernelPrompt, LinuxKernelString,
sizeof(LinuxKernelString)))
529 if (!
UiEditBox(LinuxInitrdPrompt, LinuxInitrdString,
sizeof(LinuxInitrdString)))
532 if (!
UiEditBox(LinuxCommandLinePrompt, LinuxCommandLineString,
sizeof(LinuxCommandLineString)))
539 if (*BootStrings.ArcPath)
543 else if (*BootStrings.Drive)
569 "CustomLinux%u%u%u%u%u%u",
582 if (*BootStrings.ArcPath)
587 else if (*BootStrings.Drive)
602 if (*LinuxInitrdString)
612 OperatingSystem->SectionId = SectionId;
613 OperatingSystem->LoadIdentifier =
"Custom Linux Setup";
624 ULONG_PTR SectionId = OperatingSystem->SectionId;
625 CHAR SectionName[100];
626 CHAR BootDriveString[20];
627 CHAR BootPartitionString[20];
628 CHAR ReactOSSystemPath[200];
629 CHAR ReactOSARCPath[200];
630 CHAR ReactOSOptions[200];
634 RtlZeroMemory(BootPartitionString,
sizeof(BootPartitionString));
677 "CustomReactOS%u%u%u%u%u%u",
692 atoi(BootPartitionString));
702 OperatingSystem->SectionId = SectionId;
703 OperatingSystem->LoadIdentifier =
NULL;
706#ifdef HAS_OPTION_MENU_REBOOT
TIMEINFO * ArcGetTime(VOID)
VOID ConstructArcPath(PCHAR ArcPath, PCHAR SystemFolder, UCHAR Disk, ULONG Partition)
const CHAR ReactOSSystemPathPrompt[]
const CHAR CustomBootPrompt[]
const CHAR BootDrivePrompt[]
VOID EditCustomBootReactOS(IN OUT OperatingSystemItem *OperatingSystem, IN BOOLEAN IsSetup)
const CHAR ReactOSOptionsPrompt[]
const CHAR ReactOSSetupOptionsPrompt[]
const CHAR BootPartitionPrompt[]
const CHAR ARCPathPrompt[]
#define DriveMapGetBiosDriveNumber(DeviceName)
VOID OptionMenuCustomBoot(VOID)
VOID OptionMenuReboot(VOID)
VOID LoadOperatingSystem(IN OperatingSystemItem *OperatingSystem)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
BOOLEAN IniAddSection(PCSTR SectionName, ULONG_PTR *SectionId)
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)
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(PCSTR Format,...)