LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Converting virtual address to physical address in the kernel (https://www.linuxquestions.org/questions/programming-9/converting-virtual-address-to-physical-address-in-the-kernel-787656/)

DBQ 02-07-2010 06:30 PM

Converting virtual address to physical address in the kernel
 
Hi everybody. I am trying to convert a virtual address to physical address in the linux kernel. I use this approach: first get the page struct which corresponds to the virtual address and then use page_address() to get the physical address.

I did an experiment where I used the above method to convert the starting address of the process heap and the ending address of the process heap (start_brk and brk from mm_struct) for the process which uses lots of memory. Resulting physical addresses are the same as virtual addresses, and the ending address exceeds the total physical memory of the system. How can this be? Am I doing something wrong? Any suggestions?


All times are GMT -5. The time now is 07:14 AM.