diff --git a/xtldr/amd64/memory.c b/xtldr/amd64/memory.c index 436daf1..b9d946f 100644 --- a/xtldr/amd64/memory.c +++ b/xtldr/amd64/memory.c @@ -137,7 +137,8 @@ BlEnablePaging(IN PLIST_ENTRY MemoryMappings, return Status; } - /* Iterate through all mappings */ + /* Iterate through and map all the mappings*/ + BlDbgPrint(L"Mapping and dumping EFI memory:\n"); ListEntry = MemoryMappings->Flink; while(ListEntry != MemoryMappings) { @@ -147,6 +148,10 @@ BlEnablePaging(IN PLIST_ENTRY MemoryMappings, /* Check if virtual address is set */ if(Mapping->VirtualAddress) { + /* Dump memory mapping */ + BlDbgPrint(L" Type=%02lu, PhysicalBase=0x%016lx, VirtualBase=0x%016lx, Pages=%lu\n", Mapping->MemoryType, + Mapping->PhysicalAddress, Mapping->VirtualAddress, Mapping->NumberOfPages); + /* Map memory */ Status = BlMapVirtualMemory(MemoryMappings, (UINT_PTR)Mapping->VirtualAddress, (UINT_PTR)Mapping->PhysicalAddress, Mapping->NumberOfPages, PtePointer); diff --git a/xtldr/i686/memory.c b/xtldr/i686/memory.c index f44119a..742822b 100644 --- a/xtldr/i686/memory.c +++ b/xtldr/i686/memory.c @@ -223,7 +223,8 @@ BlEnablePaging(IN PLIST_ENTRY MemoryMappings, return Status; } - /* Iterate through all mappings */ + /* Iterate through and map all the mappings*/ + BlDbgPrint(L"Mapping and dumping EFI memory:\n"); ListEntry = MemoryMappings->Flink; while(ListEntry != MemoryMappings) { @@ -233,6 +234,10 @@ BlEnablePaging(IN PLIST_ENTRY MemoryMappings, /* Check if virtual address is set */ if(Mapping->VirtualAddress) { + /* Dump memory mapping */ + BlDbgPrint(L" Type=%02lu, PhysicalBase=0x%08lx, VirtualBase=0x%08lx, Pages=%lu\n", Mapping->MemoryType, + Mapping->PhysicalAddress, Mapping->VirtualAddress, Mapping->NumberOfPages); + /* Map memory */ Status = BlMapVirtualMemory(MemoryMappings, (UINT_PTR)Mapping->VirtualAddress, (UINT_PTR)Mapping->PhysicalAddress, Mapping->NumberOfPages, PtePointer);