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?