From b3bf613e1b7584b8dbddeec0e64434315864319a Mon Sep 17 00:00:00 2001 From: belliash Date: Wed, 25 Jan 2023 16:39:15 +0100 Subject: [PATCH] Make sure paging has been successfully enabled --- xtldr/modules/xtos/xtos.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xtldr/modules/xtos/xtos.c b/xtldr/modules/xtos/xtos.c index bc19033..477f9f7 100644 --- a/xtldr/modules/xtos/xtos.c +++ b/xtldr/modules/xtos/xtos.c @@ -178,8 +178,8 @@ EFI_STATUS XtpBootSequence(IN PEFI_FILE_HANDLE BootDir, IN PXT_BOOT_PROTOCOL_PARAMETERS Parameters) { - PKERNEL_INITIALIZATION_BLOCK KernelParameters; EFI_GUID LoadedImageGuid = EFI_LOADED_IMAGE_PROTOCOL_GUID; + PKERNEL_INITIALIZATION_BLOCK KernelParameters; PPECOFF_IMAGE_CONTEXT ImageContext = NULL; PEFI_LOADED_IMAGE_PROTOCOL ImageProtocol; PVOID VirtualAddress, VirtualMemoryArea; @@ -241,6 +241,8 @@ XtpBootSequence(IN PEFI_FILE_HANDLE BootDir, Status = XtLdrProtocol->EnablePaging(&MemoryMappings, VirtualAddress, ImageProtocol, &XtPageMap); if(Status != STATUS_EFI_SUCCESS) { + /* Failed to enable paging */ + XtLdrProtocol->DbgPrint(L"Failed to enable paging (Status Code: %lx)\n", Status); return Status; }