-2

Lets say I have a global variable defined in my program. I want to know its physical address (not virtual address). Is there a way to find it in Linux in user space? I know that the physical address might change during execution, but I am OK with just knowing the current physical address.

MetallicPriest
  • 29,191
  • 52
  • 200
  • 356

1 Answers1

0

virt_to_phys is available but can only be used in kernel space and not in user space, specifically when is allocated with kmalloc and only when it is in page tables.

http://mirror.linux.org.au/linux-mandocs/2.6.12.4/virt_to_phys.html

sr01853
  • 6,043
  • 1
  • 19
  • 39