From ce8c66f93afdda29e776f5860e25ecab4e74839f Mon Sep 17 00:00:00 2001 From: Rafal Kupiec Date: Sun, 24 Mar 2024 22:52:18 +0100 Subject: [PATCH] Always map first page --- xtldr/memory.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xtldr/memory.c b/xtldr/memory.c index 72bf476..bcdeaac 100644 --- a/xtldr/memory.c +++ b/xtldr/memory.c @@ -355,6 +355,14 @@ BlMapEfiMemory(IN OUT PXTBL_PAGE_MAPPING PageMap, } } + /* Always map first page */ + Status = BlMapVirtualMemory(PageMap, NULL, (PVOID)0, 1, LoaderFirmwarePermanent); + if(Status != STATUS_EFI_SUCCESS) + { + /* Mapping failed */ + return Status; + } + /* Map BIOS ROM and VRAM */ Status = BlMapVirtualMemory(PageMap, NULL, (PVOID)0xA0000, 0x60, LoaderFirmwarePermanent); if(Status != STATUS_EFI_SUCCESS)