From eea61d9895b3a2e22fe972baf7a3a58019879503 Mon Sep 17 00:00:00 2001 From: redrabbyte Date: Wed, 23 Oct 2024 14:25:16 +0200 Subject: [PATCH] Fix virt2phys.c demo 2MB translation --- demos/virt2phys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/virt2phys.c b/demos/virt2phys.c index 4668b6d..d5c3079 100644 --- a/demos/virt2phys.c +++ b/demos/virt2phys.c @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) { } else { printf(TAG_PROGRESS "Page is 2MB\n"); ptedit_print_entry(entry.pd); - phys = (ptedit_get_pfn(entry.pd) << 21) | (((size_t)&target) & 0x1fffff); + phys = (ptedit_get_pfn(entry.pd) << 12) | (((size_t)&target) & 0x1fffff); } printf(TAG_OK "Virtual address: %p\n", &target);