From 98a4ebbe3c2d4bd14f215cd676d4af8000d70bbd Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sat, 9 Jun 2018 14:40:02 -0400 Subject: [PATCH] efi: Actually add items to safemode menu. The call to smp_... is not working since it relies on gKernelArgs being fully initialized, which it isn't at this stage in the EFI loader. Jessica says that in order to have that happen, the heap would also need to be initialized early, which it also is not. At least you can now force a safe videomode, which is enough for me to be able to test video drivers. --- src/system/boot/platform/efi/menu.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/system/boot/platform/efi/menu.cpp b/src/system/boot/platform/efi/menu.cpp index b4f6e6a254..4d17781802 100644 --- a/src/system/boot/platform/efi/menu.cpp +++ b/src/system/boot/platform/efi/menu.cpp @@ -6,9 +6,11 @@ #include #include +#include #include "efi_platform.h" #include "video.h" +#include "smp.h" void @@ -26,6 +28,30 @@ platform_add_menus(Menu *menu) } break; + + case SAFE_MODE_MENU: + item = new(std::nothrow) MenuItem("Use fail-safe graphics driver"); + if (item != NULL) { + menu->AddItem(item); + item->SetType(MENU_ITEM_MARKABLE); + item->SetData(B_SAFEMODE_FAIL_SAFE_VIDEO_MODE); + item->SetHelpText("The system will use VESA mode " + "and won't try to use any video graphics drivers."); + } + + smp_add_safemode_menus(menu); + + item = new(std::nothrow) MenuItem("Disable ACPI"); + if (item != NULL) { + menu->AddItem(item); + item->SetType(MENU_ITEM_MARKABLE); + item->SetData(B_SAFEMODE_DISABLE_ACPI); + item->SetHelpText("Disables Advanced Configuration and Power " + "Interface hardware support, overriding the ACPI setting " + "in the kernel settings file."); + } + break; + default: break; }