summaryrefslogtreecommitdiffstats
path: root/sys/boot/efi/libefi
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2014-09-18 13:59:36 +0000
committeremaste <emaste@FreeBSD.org>2014-09-18 13:59:36 +0000
commitb79dbe705a8ae358c689a56563ac3d3dde3a9374 (patch)
treec60a6eb8145b1db58e23acabae211972b8cdca4b /sys/boot/efi/libefi
parentbdff18c23aaf2f5edb9fde9d27152c9f0f35f171 (diff)
downloadFreeBSD-src-b79dbe705a8ae358c689a56563ac3d3dde3a9374.zip
FreeBSD-src-b79dbe705a8ae358c689a56563ac3d3dde3a9374.tar.gz
Switch to text mode in UEFI boot
The loader previously failed to display on MacBooks and other systems where the UEFI firmware remained in graphics mode. Submitted by: Rafael EspĂ­ndola
Diffstat (limited to 'sys/boot/efi/libefi')
-rw-r--r--sys/boot/efi/libefi/libefi.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/boot/efi/libefi/libefi.c b/sys/boot/efi/libefi/libefi.c
index 45a48dc..c6c01d3 100644
--- a/sys/boot/efi/libefi/libefi.c
+++ b/sys/boot/efi/libefi/libefi.c
@@ -28,6 +28,7 @@
__FBSDID("$FreeBSD$");
#include <efi.h>
+#include <eficonsctl.h>
#include <efilib.h>
#include <stand.h>
@@ -82,6 +83,9 @@ void
efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table)
{
static EFI_GUID image_protocol = LOADED_IMAGE_PROTOCOL;
+ static EFI_GUID console_control_protocol =
+ EFI_CONSOLE_CONTROL_PROTOCOL_GUID;
+ EFI_CONSOLE_CONTROL_PROTOCOL *console_control = NULL;
EFI_LOADED_IMAGE *img;
CHAR16 *argp, *args, **argv;
EFI_STATUS status;
@@ -92,6 +96,12 @@ efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table)
BS = ST->BootServices;
RS = ST->RuntimeServices;
+ status = BS->LocateProtocol(&console_control_protocol, NULL,
+ (VOID **)&console_control);
+ if (status == EFI_SUCCESS)
+ (void)console_control->SetMode(console_control,
+ EfiConsoleControlScreenText);
+
heapsize = 2 * 1024 * 1024;
status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData,
EFI_SIZE_TO_PAGES(heapsize), &heap);
OpenPOWER on IntegriCloud