From b5f220a2ae2c8eaa42e1764ec6cafcc79171b38e Mon Sep 17 00:00:00 2001 From: Aiken Harris Date: Fri, 23 Jan 2026 20:52:45 +0100 Subject: [PATCH] Correctly advance virtual address after mapping non-free regions --- boot/xtldr/memory.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/boot/xtldr/memory.cc b/boot/xtldr/memory.cc index 6591833..792330b 100644 --- a/boot/xtldr/memory.cc +++ b/boot/xtldr/memory.cc @@ -422,6 +422,9 @@ Memory::MapEfiMemory(IN OUT PXTBL_PAGE_MAPPING PageMap, /* Add any non-free memory mapping */ Status = MapVirtualMemory(PageMap, VirtualAddress, Descriptor->PhysicalStart, Descriptor->NumberOfPages, MemoryType); + + /* Update virtual address */ + VirtualAddress = VirtualAddress + (Descriptor->NumberOfPages * MM_PAGE_SIZE); } else {