Re: How to convert virtual address to physical address and revers e?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The Kernel maps the physical address starting from PAGE_OFFSET in
Virtual Address Space that is why we subtract PAGE_OFFSET to get the
physical address from VA. According to my understanding this will be
valid only in Kernel address space and not in user address space.

Again as far as I know, to access the virtual address for a given
physical address, you need to access the rmap structure in the struct
page. This how you can do it,

physical address >> PAGE_SHIFT , this gives you the pfn

node_mem_map + pfn gives the struct page pointer value.

Acess the rmap structure in the page structure. This is a list of all
the virtual addresses where this page is mapped.

Please correct me if I am wrong.

--------------
Raj.


On Wed, 30 Mar 2005 09:37:54 +0800, P.F. Tsai <yeltek@xxxxxxxxx> wrote:
> the first 3GB in VA is left for process itself, and the fourth gigabyte is
> left for kernel......

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux