Translation of a 64 bits virtual address

Julien Matthey 26 Reputation points
2021-03-08T00:50:29.833+00:00

I read this tutorial on msdn on translating a 32 bits virtual address to it's physical address "by hand". I want to do the same but for a 64 bits address.

From this article I found that a 64 bits virt. address bits are :

[47-39] Page Directory Pointer
[38-30] Page Directory (Index?)
[29-21] Page Table (Index?)
[20-12] Page Table Entry (Index?)
[11-0] Byte offset of the data in the page

In the article the PTE is found using a GUI but I want to do it in code.

From the tutorial for a 32 bits virt. address we have :

PTE address = PTE_BASE
+ (page directory index) * PAGE_SIZE
+ (page table index) * sizeof(MMPTE)
= 0xc0000000
+ 0x0 * 0x1000
+ 0x12F * 4
= 0xC00004BC

How do I do the same for a 64 bits virt. address using PDP/PD/PT/PTE ?

Thank you.

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,617 questions
{count} votes