add f8 & f10 menu

This commit is contained in:
a1ive 2025-02-20 21:32:38 +09:00
parent cb6364666e
commit dc5f3c614b
No known key found for this signature in database
GPG Key ID: DA9BACF4F462B55D
7 changed files with 33 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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)

View File

@ -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,

BIN
utils/bcd

Binary file not shown.

View File

@ -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