Hi all,
I have an embedded system running Linux. I would like to translate the virtual addresses to the physical address accessed by the processor.
What I tried:
When in the kernel space (in a kernel module), I used the virt_to_phys function. However, I later found out that this function only translates the virtual address created by kmalloc to physical address. I do have some virtual address created using ioremap that do not work with this function. I found this post:
http://stackoverflow.com/questions/6...-kernel-module that states that you need to traverse the page table to reconstruct the physical address.
End goal:
I would like to pass any virtual address to a module and get the physical address translation. I would like virtual address created from kernel space (ioremap and kmalloc) or user space (malloc) to be translated.
I presume there is a function that the kernel uses to make its translation. I would like to hook into this function. I'm looking for guidance and help on this issue.
I am also available for a one-on-one chat if a discussion is needed since the topic is too complex to explain on a forum post.
Thank you in advance.