diff --git a/docs/cmdline.md b/docs/cmdline.md index 30b2c0d..181c5f8 100644 --- a/docs/cmdline.md +++ b/docs/cmdline.md @@ -49,6 +49,18 @@ text ``` Force the Windows boot manager to display error messages in text mode. +### f8 +``` +f8 +``` +Enable the F8 `Advanced Boot Options` menu. + +### edit +``` +edit +``` +Enable the `Edit Boot Options` menu. + ### testmode ``` testmode=yes|no diff --git a/include/bcd.h b/include/bcd.h index 65250b7..e526475 100644 --- a/include/bcd.h +++ b/include/bcd.h @@ -51,8 +51,10 @@ #define BCDOPT_TITLE L"12000004" #define BCDOPT_LANG L"12000005" #define BCDOPT_CMDLINE L"12000030" -#define BCDOPT_INHERIT L"14000006" // options & safeboot +#define BCDOPT_INHERIT L"14000006" // options #define BCDOPT_GFXMODE L"15000052" // graphicsresolution +#define BCDOPT_ADVOPT L"16000040" // advanced options +#define BCDOPT_OPTEDIT L"16000041" // options edit #define BCDOPT_TESTMODE L"16000049" // testsigning #define BCDOPT_HIGHRES L"16000054" // highest resolution #define BCDOPT_OSDDEV L"21000001" // os device diff --git a/include/cmdline.h b/include/cmdline.h index 0e5bb3c..2fb21fc 100644 --- a/include/cmdline.h +++ b/include/cmdline.h @@ -50,6 +50,8 @@ struct nt_args uint8_t safemode; uint8_t altshell; uint8_t exportcd; + uint8_t advmenu; + uint8_t optedit; uint64_t nx; uint64_t pae; diff --git a/kern/cmdline.c b/kern/cmdline.c index 6fb0ca2..6dc1d4d 100644 --- a/kern/cmdline.c +++ b/kern/cmdline.c @@ -39,6 +39,8 @@ static struct nt_args args = .safemode = NTARG_BOOL_FALSE, .altshell = NTARG_BOOL_FALSE, .exportcd = NTARG_BOOL_FALSE, + .advmenu = NTARG_BOOL_FALSE, + .optedit = NTARG_BOOL_FALSE, .nx = NX_OPTIN, .pae = PAE_DEFAULT, @@ -223,6 +225,14 @@ void process_cmdline (char *cmdline) { args.exportcd = convert_bool (value); } + else if (strcmp (key, "f8") == 0) + { + args.advmenu = NTARG_BOOL_TRUE; + } + else if (strcmp (key, "edit") == 0) + { + args.optedit = NTARG_BOOL_TRUE; + } else if (strcmp (key, "nx") == 0) { if (! value || strcasecmp (value, "OptIn") == 0) diff --git a/libnt/bcd.c b/libnt/bcd.c index 21bb713..2385d5d 100644 --- a/libnt/bcd.c +++ b/libnt/bcd.c @@ -303,6 +303,10 @@ bcd_patch_data (void) BCDOPT_NOVGA, nt_cmdline->novga); bcd_patch_bool (&hive, objects, GUID_OPTN, BCDOPT_NOVESA, nt_cmdline->novesa); + bcd_patch_bool (&hive, objects, GUID_OPTN, + BCDOPT_ADVOPT, nt_cmdline->advmenu); + bcd_patch_bool (&hive, objects, GUID_OPTN, + BCDOPT_OPTEDIT, nt_cmdline->optedit); bcd_patch_u64 (&hive, objects, GUID_OPTN, BCDOPT_NX, nt_cmdline->nx); bcd_patch_u64 (&hive, objects, GUID_OPTN, diff --git a/utils/bcd b/utils/bcd index 2b38e7c..9d60d04 100644 Binary files a/utils/bcd and b/utils/bcd differ diff --git a/utils/bcd.bat b/utils/bcd.bat index e750147..c5a713d 100644 --- a/utils/bcd.bat +++ b/utils/bcd.bat @@ -30,13 +30,13 @@ bcdedit %bcd% /set {bootmgr} timeout 1 bcdedit %bcd% /set {bootmgr} displaybootmenu false bcdedit %bcd% /create {globalsettings} -bcdedit %bcd% /set {globalsettings} optionsedit true -bcdedit %bcd% /set {globalsettings} advancedoptions true bcdedit %bcd% /set {globalsettings} locale en-us bcdedit %bcd% /create {bootloadersettings} bcdedit %bcd% /create %guidopt% /inherit OSLOADER +bcdedit %bcd% /set %guidopt% optionsedit true +bcdedit %bcd% /set %guidopt% advancedoptions true bcdedit %bcd% /set %guidopt% detecthal true bcdedit %bcd% /set %guidopt% winpe true bcdedit %bcd% /set %guidopt% testsigning true