Store boot loader image information and close EFI_LOADED_IMAGE_PROTOCOL afterwards
Some checks failed
Builds / ExectOS (amd64) (push) Failing after 15s
Builds / ExectOS (i686) (push) Failing after 15s

This commit is contained in:
Rafal Kupiec 2024-01-22 15:11:56 +01:00
parent 8580557985
commit 22a7676b9b
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
2 changed files with 14 additions and 5 deletions

View File

@ -195,6 +195,8 @@ typedef struct _XTBL_STATUS
PBL_XT_BOOT_MENU BootMenu; PBL_XT_BOOT_MENU BootMenu;
BOOLEAN BootServices; BOOLEAN BootServices;
ULONG DebugPort; ULONG DebugPort;
PVOID LoaderBase;
ULONGLONG LoaderSize;
INT_PTR SecureBoot; INT_PTR SecureBoot;
CPPORT SerialPort; CPPORT SerialPort;
} XTBL_STATUS, *PXTBL_STATUS; } XTBL_STATUS, *PXTBL_STATUS;

View File

@ -42,12 +42,16 @@ BlInitializeBootLoader()
/* Store SecureBoot status */ /* Store SecureBoot status */
BlpStatus.SecureBoot = BlGetSecureBootStatus(); BlpStatus.SecureBoot = BlGetSecureBootStatus();
/* Check if debug is enabled */ /* Attempt to open EFI LoadedImage protocol */
if(DEBUG) Status = BlOpenProtocol(&Handle, (PVOID *)&LoadedImage, &LipGuid);
if(Status == STATUS_EFI_SUCCESS)
{ {
/* Attempt to open EFI LoadedImage protocol */ /* Store boot loader image base and size */
Status = BlOpenProtocol(&Handle, (PVOID *)&LoadedImage, &LipGuid); BlpStatus.LoaderBase = LoadedImage->ImageBase;
if(Status == STATUS_EFI_SUCCESS) BlpStatus.LoaderSize = LoadedImage->ImageSize;
/* Check if debug is enabled */
if(DEBUG)
{ {
/* Protocol opened successfully, print useful debug information */ /* Protocol opened successfully, print useful debug information */
BlConsolePrint(L"\n---------- BOOTLOADER DEBUG ----------\n" BlConsolePrint(L"\n---------- BOOTLOADER DEBUG ----------\n"
@ -62,6 +66,9 @@ BlInitializeBootLoader()
LoadedImage->Revision); LoadedImage->Revision);
BlSleepExecution(3000); BlSleepExecution(3000);
} }
/* Close EFI LoadedImage protocol */
BlCloseProtocol(&Handle, &LipGuid);
} }
} }