Is there any suitable way to get the physical address by the logical one except to walk through page directory entries by hand? I\'ve looked for this functionality in kernel
I think you can achieve virtual->physical translation through an indirect method by a combination of /proc/[pid]/maps
( gives the virtual mapping for a process ) and /proc/[pid]/pagemap
( Gives Virtual Page to Physical Page mapping for every addressable page ). First, find out the mapping of virtual addresses of your process from maps
( This is done so that you don't search every byte in pagemap
) Then check for the physical mapping of the desired virtual address in pagemap ( pagemap is not in text format. Here is a detailed explantion of the format Pagemap )
This should give you the exact virtual-->physical mapping