From 789e9d64f4bd5852e3eebbb4089a6876307975ea Mon Sep 17 00:00:00 2001 From: Rafal Kupiec Date: Fri, 16 Feb 2024 22:40:36 +0100 Subject: [PATCH] Properly print PA & VA addresses --- xtldr/arch/amd64/memory.c | 4 ++-- xtldr/arch/i686/memory.c | 4 ++-- xtldr/modules/xtos_o/xtos.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xtldr/arch/amd64/memory.c b/xtldr/arch/amd64/memory.c index 135f8dc..d73748d 100644 --- a/xtldr/arch/amd64/memory.c +++ b/xtldr/arch/amd64/memory.c @@ -102,8 +102,8 @@ BlBuildPageMap(IN PXTBL_PAGE_MAPPING PageMap) if(Mapping->VirtualAddress) { /* Dump memory mapping */ - BlDebugPrint(L" Type=%02lu, PhysicalBase=0x%016lX, VirtualBase=0x%016lX, Pages=%lu\n", Mapping->MemoryType, - Mapping->PhysicalAddress, Mapping->VirtualAddress, Mapping->NumberOfPages); + BlDebugPrint(L" Type=%02lu, PhysicalBase=%.16p, VirtualBase=%.16p, Pages=%lu\n", + Mapping->MemoryType, Mapping->PhysicalAddress, Mapping->VirtualAddress, Mapping->NumberOfPages); /* Map memory */ Status = BlMapPage(PageMap, (UINT_PTR)Mapping->VirtualAddress, diff --git a/xtldr/arch/i686/memory.c b/xtldr/arch/i686/memory.c index 6d07332..d9ddaea 100644 --- a/xtldr/arch/i686/memory.c +++ b/xtldr/arch/i686/memory.c @@ -125,8 +125,8 @@ BlBuildPageMap(IN PXTBL_PAGE_MAPPING PageMap) if(Mapping->VirtualAddress) { /* Dump memory mapping */ - BlDebugPrint(L" Type=%02lu, PhysicalBase=0x%016lX, VirtualBase=0x%016lX, Pages=%lu\n", Mapping->MemoryType, - Mapping->PhysicalAddress, Mapping->VirtualAddress, Mapping->NumberOfPages); + BlDebugPrint(L" Type=%02lu, PhysicalBase=%.8p, VirtualBase=%.8p, Pages=%lu\n", + Mapping->MemoryType, Mapping->PhysicalAddress, Mapping->VirtualAddress, Mapping->NumberOfPages); /* Map memory */ Status = BlMapPage(PageMap, (UINT_PTR)Mapping->VirtualAddress, diff --git a/xtldr/modules/xtos_o/xtos.c b/xtldr/modules/xtos_o/xtos.c index 99d1614..d70ffe4 100644 --- a/xtldr/modules/xtos_o/xtos.c +++ b/xtldr/modules/xtos_o/xtos.c @@ -581,7 +581,7 @@ XtpLoadModule(IN PEFI_FILE_HANDLE SystemDir, } /* Print debug message */ - XtLdrProtocol->Debug.Print(L"Loaded %S at PA: 0x%lX, VA: 0x%lX\n", FileName, + XtLdrProtocol->Debug.Print(L"Loaded %S at PA: %p, VA: %p\n", FileName, (*ImageContext)->PhysicalAddress, (*ImageContext)->VirtualAddress); /* Return success */