Skip to content

Commit dc5f3c6

Browse files
committed
add f8 & f10 menu
1 parent cb63646 commit dc5f3c6

File tree

7 files changed

+33
-3
lines changed

7 files changed

+33
-3
lines changed

docs/cmdline.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@ text
4949
```
5050
Force the Windows boot manager to display error messages in text mode.
5151

52+
### f8
53+
```
54+
f8
55+
```
56+
Enable the F8 `Advanced Boot Options` menu.
57+
58+
### edit
59+
```
60+
edit
61+
```
62+
Enable the `Edit Boot Options` menu.
63+
5264
### testmode
5365
```
5466
testmode=yes|no

include/bcd.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@
5151
#define BCDOPT_TITLE L"12000004"
5252
#define BCDOPT_LANG L"12000005"
5353
#define BCDOPT_CMDLINE L"12000030"
54-
#define BCDOPT_INHERIT L"14000006" // options & safeboot
54+
#define BCDOPT_INHERIT L"14000006" // options
5555
#define BCDOPT_GFXMODE L"15000052" // graphicsresolution
56+
#define BCDOPT_ADVOPT L"16000040" // advanced options
57+
#define BCDOPT_OPTEDIT L"16000041" // options edit
5658
#define BCDOPT_TESTMODE L"16000049" // testsigning
5759
#define BCDOPT_HIGHRES L"16000054" // highest resolution
5860
#define BCDOPT_OSDDEV L"21000001" // os device

include/cmdline.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ struct nt_args
5050
uint8_t safemode;
5151
uint8_t altshell;
5252
uint8_t exportcd;
53+
uint8_t advmenu;
54+
uint8_t optedit;
5355

5456
uint64_t nx;
5557
uint64_t pae;

kern/cmdline.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ static struct nt_args args =
3939
.safemode = NTARG_BOOL_FALSE,
4040
.altshell = NTARG_BOOL_FALSE,
4141
.exportcd = NTARG_BOOL_FALSE,
42+
.advmenu = NTARG_BOOL_FALSE,
43+
.optedit = NTARG_BOOL_FALSE,
4244

4345
.nx = NX_OPTIN,
4446
.pae = PAE_DEFAULT,
@@ -223,6 +225,14 @@ void process_cmdline (char *cmdline)
223225
{
224226
args.exportcd = convert_bool (value);
225227
}
228+
else if (strcmp (key, "f8") == 0)
229+
{
230+
args.advmenu = NTARG_BOOL_TRUE;
231+
}
232+
else if (strcmp (key, "edit") == 0)
233+
{
234+
args.optedit = NTARG_BOOL_TRUE;
235+
}
226236
else if (strcmp (key, "nx") == 0)
227237
{
228238
if (! value || strcasecmp (value, "OptIn") == 0)

libnt/bcd.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,10 @@ bcd_patch_data (void)
303303
BCDOPT_NOVGA, nt_cmdline->novga);
304304
bcd_patch_bool (&hive, objects, GUID_OPTN,
305305
BCDOPT_NOVESA, nt_cmdline->novesa);
306+
bcd_patch_bool (&hive, objects, GUID_OPTN,
307+
BCDOPT_ADVOPT, nt_cmdline->advmenu);
308+
bcd_patch_bool (&hive, objects, GUID_OPTN,
309+
BCDOPT_OPTEDIT, nt_cmdline->optedit);
306310
bcd_patch_u64 (&hive, objects, GUID_OPTN,
307311
BCDOPT_NX, nt_cmdline->nx);
308312
bcd_patch_u64 (&hive, objects, GUID_OPTN,

utils/bcd

0 Bytes
Binary file not shown.

utils/bcd.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ bcdedit %bcd% /set {bootmgr} timeout 1
3030
bcdedit %bcd% /set {bootmgr} displaybootmenu false
3131

3232
bcdedit %bcd% /create {globalsettings}
33-
bcdedit %bcd% /set {globalsettings} optionsedit true
34-
bcdedit %bcd% /set {globalsettings} advancedoptions true
3533
bcdedit %bcd% /set {globalsettings} locale en-us
3634

3735
bcdedit %bcd% /create {bootloadersettings}
3836

3937
bcdedit %bcd% /create %guidopt% /inherit OSLOADER
38+
bcdedit %bcd% /set %guidopt% optionsedit true
39+
bcdedit %bcd% /set %guidopt% advancedoptions true
4040
bcdedit %bcd% /set %guidopt% detecthal true
4141
bcdedit %bcd% /set %guidopt% winpe true
4242
bcdedit %bcd% /set %guidopt% testsigning true

0 commit comments

Comments
 (0)