0

I am told that I can find the physical address corresponding to a virtual address using /proc/[pid]/pagemap.

I read that this pagemap file is an array of 64-bit entries, with bits 0-54 corresponding to the page frame number. I don't know how to make the leap from this to translating virtual to physical. Partially, I don't know how to find the entry I want in this file; nobody seems to specify how they are indexed.

Also, I don't know if the PFN is virtual or physical. And I don't know what to do with the PFN, regardless. How can I proceed?

Thanks

Incognito
  • 2,964
  • 2
  • 27
  • 40

1 Answers1

0

Divide the VA by the page size (4096 normally), use that as an offset into /proc/self/pagemap. Then take that number (the page), multiply by the pagesize (4096), and offset that by your VA%4094.

Larry

Larry_C
  • 316
  • 1
  • 9