Skip to content

Commit b10ef2e

Browse files
committed
enable text mode in f8/f10 menu
1 parent dc5f3c6 commit b10ef2e

File tree

7 files changed

+14
-3
lines changed

7 files changed

+14
-3
lines changed

include/bcd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
#define BCDOPT_GFXMODE L"15000052" // graphicsresolution
5656
#define BCDOPT_ADVOPT L"16000040" // advanced options
5757
#define BCDOPT_OPTEDIT L"16000041" // options edit
58+
#define BCDOPT_TEXT L"16000046" // graphicsmodedisabled
5859
#define BCDOPT_TESTMODE L"16000049" // testsigning
5960
#define BCDOPT_HIGHRES L"16000054" // highest resolution
6061
#define BCDOPT_OSDDEV L"21000001" // os device

kern/cmdline.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,12 @@ void process_cmdline (char *cmdline)
228228
else if (strcmp (key, "f8") == 0)
229229
{
230230
args.advmenu = NTARG_BOOL_TRUE;
231+
args.textmode = NTARG_BOOL_TRUE;
231232
}
232233
else if (strcmp (key, "edit") == 0)
233234
{
234235
args.optedit = NTARG_BOOL_TRUE;
236+
args.textmode = NTARG_BOOL_TRUE;
235237
}
236238
else if (strcmp (key, "nx") == 0)
237239
{

kern/efiboot.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
#include "efiboot.h"
3434
#include "efi/Protocol/GraphicsOutput.h"
3535

36+
#ifdef ENABLE_TEXT_DEBUG
37+
3638
/** Original OpenProtocol() method */
3739
static EFI_OPEN_PROTOCOL orig_open_protocol;
3840

@@ -94,6 +96,8 @@ efi_open_protocol_wrapper (EFI_HANDLE handle, EFI_GUID *protocol,
9496
return 0;
9597
}
9698

99+
#endif
100+
97101
/**
98102
* Boot from EFI device
99103
*
@@ -149,11 +153,13 @@ void efi_boot (EFI_DEVICE_PATH_PROTOCOL *path,
149153
loaded.image->DeviceHandle = device;
150154
}
151155

156+
#ifdef ENABLE_TEXT_DEBUG
152157
/* Intercept calls to OpenProtocol() */
153158
orig_open_protocol =
154159
loaded.image->SystemTable->BootServices->OpenProtocol;
155160
loaded.image->SystemTable->BootServices->OpenProtocol =
156161
efi_open_protocol_wrapper;
162+
#endif
157163

158164
/* Start image */
159165
if ((efirc = bs->StartImage (handle, NULL, NULL)) != 0)

kern/main.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ enum
7373
static void call_interrupt_wrapper (struct bootapp_callback_params *params)
7474
{
7575
struct paging_state state;
76-
uint16_t *attributes;
7776

7877
/* Handle/modify/pass-through interrupt as required */
7978
if (params->vector.interrupt == 0x13)
@@ -92,8 +91,8 @@ static void call_interrupt_wrapper (struct bootapp_callback_params *params)
9291
(nt_cmdline->textmode))
9392
{
9493
/* Mark all VESA video modes as unsupported */
95-
attributes = REAL_PTR ( params->es, params->di );
96-
call_interrupt ( params );
94+
uint16_t *attributes = REAL_PTR (params->es, params->di);
95+
call_interrupt (params);
9796
*attributes &= ~0x0001;
9897
}
9998
else

libnt/bcd.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,8 @@ bcd_patch_data (void)
307307
BCDOPT_ADVOPT, nt_cmdline->advmenu);
308308
bcd_patch_bool (&hive, objects, GUID_OPTN,
309309
BCDOPT_OPTEDIT, nt_cmdline->optedit);
310+
bcd_patch_bool (&hive, objects, GUID_OPTN,
311+
BCDOPT_TEXT, nt_cmdline->textmode);
310312
bcd_patch_u64 (&hive, objects, GUID_OPTN,
311313
BCDOPT_NX, nt_cmdline->nx);
312314
bcd_patch_u64 (&hive, objects, GUID_OPTN,

utils/bcd

0 Bytes
Binary file not shown.

utils/bcd.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ bcdedit %bcd% /set %guidopt% safeboot minimal
5454
bcdedit %bcd% /set %guidopt% safebootalternateshell yes
5555
bcdedit %bcd% /set %guidopt% graphicsresolution 1024x768
5656
bcdedit %bcd% /set %guidopt% highestmode true
57+
bcdedit %bcd% /set %guidopt% graphicsmodedisabled true
5758

5859
bcdedit %bcd% /create {ramdiskoptions}
5960
bcdedit %bcd% /set {ramdiskoptions} ramdisksdidevice "boot"

0 commit comments

Comments
 (0)