Re: calculating physical memory address

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

 



Hello,

I am re-forwarding this to kernelnewbies only as previous forward
failed (I can't understand whats happening now-a-days with my account,
it mostly fails in first attempt :( )

On 11/9/05, Mulyadi Santosa <a_mulyadi@xxxxxxxxxx> wrote:
>
> > can somebody tell me, which function translates the real physical
> > memory address to the linear logical address.
>
> I think what you are looking for is phys_to_virt, which defined in
> include/asm-i386/io.h for x86 32 bit platform.
>
> remember that the linear address below PAGE_OFFSET actually refer to
> different set of physical memory range because they are specific for
> each distinct process (for CLONE_VM-ed task, they are same), so you
> better you use it only an address that is predicted to be translated at
> above PAGE_OFFSET. Fawaad, CMIIW....
>

You are right Mulyadi, me adding some more detail ...

Actually the virutal/linear address below PAGE_OFFSET is for user
space and they are managed by the VMM and their corresponding physical
address (I think, as till now I havn't got into the details of user
space memory mananagement) won't remain same after each page-fault for
bringing the content back to main memory from the swap memory. But for
the linear/virtual address above PAGE_OFFSET are for kernel space and
till the ZONE_NORMAL (0MB to 896MB) there is a direct mapping of
PAGE_OFFSET to 0MB physical address and so on till (PAGE_OFFSET +
896MB) to 896MB of physical memory and above 896MB of physical memory
there isn't any direct relation of virtual/linear and physical address
(the relation/mapping here is exactly depends on the page-table)

> NB: Sorry, I am replying for non subscribed account of kernelnewbies.
> Please forward this e-mail to the list along with your conclusion
> whether this is indeed satisfy your need or not...
>

I am forwarding it to kernelnewbies, no problem. But still not sure
whether __pkirsch__ is got the answer what he really wants or not,
because pkirsch question is not so clear !


--
Fawad Lateef

--
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