Friday, December 24, 2010

how to get the physicall address of kernel code

$ cat /boot/System.map-2.6.32-27-generic | grep text
This command will give you virtual address. The first one is the start of kernel code, For example, on my Ubuntu:
$ cat /boot/System.map-2.6.32-27-generic | grep text 
c0100000 T _text
If you change the c to 0, you changed the virtual address to physical address on Linux. 
Why? please see: http://jianggmulab.blogspot.com/2009/09/blog-post.html

$ cat /boot/System.map-2.6.32-27-generic | grep etext
This one will give you the end virtual address of kernel code.

$ cat /proc/iomem
This command will give your general picture of current memory, and all the address are physical address. For example, on my Ubuntu:
  00100000-00592a36 : Kernel code

No comments: