diff --git a/include/bcd.h b/include/bcd.h index e526475..15284c4 100644 --- a/include/bcd.h +++ b/include/bcd.h @@ -55,6 +55,7 @@ #define BCDOPT_GFXMODE L"15000052" // graphicsresolution #define BCDOPT_ADVOPT L"16000040" // advanced options #define BCDOPT_OPTEDIT L"16000041" // options edit +#define BCDOPT_TEXT L"16000046" // graphicsmodedisabled #define BCDOPT_TESTMODE L"16000049" // testsigning #define BCDOPT_HIGHRES L"16000054" // highest resolution #define BCDOPT_OSDDEV L"21000001" // os device diff --git a/kern/cmdline.c b/kern/cmdline.c index 6dc1d4d..8de9bcf 100644 --- a/kern/cmdline.c +++ b/kern/cmdline.c @@ -228,10 +228,12 @@ void process_cmdline (char *cmdline) else if (strcmp (key, "f8") == 0) { args.advmenu = NTARG_BOOL_TRUE; + args.textmode = NTARG_BOOL_TRUE; } else if (strcmp (key, "edit") == 0) { args.optedit = NTARG_BOOL_TRUE; + args.textmode = NTARG_BOOL_TRUE; } else if (strcmp (key, "nx") == 0) { diff --git a/kern/efiboot.c b/kern/efiboot.c index f4d2fe0..8541d09 100644 --- a/kern/efiboot.c +++ b/kern/efiboot.c @@ -33,6 +33,8 @@ #include "efiboot.h" #include "efi/Protocol/GraphicsOutput.h" +#ifdef ENABLE_TEXT_DEBUG + /** Original OpenProtocol() method */ static EFI_OPEN_PROTOCOL orig_open_protocol; @@ -94,6 +96,8 @@ efi_open_protocol_wrapper (EFI_HANDLE handle, EFI_GUID *protocol, return 0; } +#endif + /** * Boot from EFI device * @@ -149,11 +153,13 @@ void efi_boot (EFI_DEVICE_PATH_PROTOCOL *path, loaded.image->DeviceHandle = device; } +#ifdef ENABLE_TEXT_DEBUG /* Intercept calls to OpenProtocol() */ orig_open_protocol = loaded.image->SystemTable->BootServices->OpenProtocol; loaded.image->SystemTable->BootServices->OpenProtocol = efi_open_protocol_wrapper; +#endif /* Start image */ if ((efirc = bs->StartImage (handle, NULL, NULL)) != 0) diff --git a/kern/main.c b/kern/main.c index 86b4fe8..b1d73c8 100644 --- a/kern/main.c +++ b/kern/main.c @@ -73,7 +73,6 @@ enum static void call_interrupt_wrapper (struct bootapp_callback_params *params) { struct paging_state state; - uint16_t *attributes; /* Handle/modify/pass-through interrupt as required */ if (params->vector.interrupt == 0x13) @@ -92,8 +91,8 @@ static void call_interrupt_wrapper (struct bootapp_callback_params *params) (nt_cmdline->textmode)) { /* Mark all VESA video modes as unsupported */ - attributes = REAL_PTR ( params->es, params->di ); - call_interrupt ( params ); + uint16_t *attributes = REAL_PTR (params->es, params->di); + call_interrupt (params); *attributes &= ~0x0001; } else diff --git a/libnt/bcd.c b/libnt/bcd.c index 2385d5d..f6495b6 100644 --- a/libnt/bcd.c +++ b/libnt/bcd.c @@ -307,6 +307,8 @@ bcd_patch_data (void) BCDOPT_ADVOPT, nt_cmdline->advmenu); bcd_patch_bool (&hive, objects, GUID_OPTN, BCDOPT_OPTEDIT, nt_cmdline->optedit); + bcd_patch_bool (&hive, objects, GUID_OPTN, + BCDOPT_TEXT, nt_cmdline->textmode); 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 9d60d04..48caa3f 100644 Binary files a/utils/bcd and b/utils/bcd differ diff --git a/utils/bcd.bat b/utils/bcd.bat index c5a713d..784af5d 100644 --- a/utils/bcd.bat +++ b/utils/bcd.bat @@ -54,6 +54,7 @@ bcdedit %bcd% /set %guidopt% safeboot minimal bcdedit %bcd% /set %guidopt% safebootalternateshell yes bcdedit %bcd% /set %guidopt% graphicsresolution 1024x768 bcdedit %bcd% /set %guidopt% highestmode true +bcdedit %bcd% /set %guidopt% graphicsmodedisabled true bcdedit %bcd% /create {ramdiskoptions} bcdedit %bcd% /set {ramdiskoptions} ramdisksdidevice "boot"