Topic
2 replies Latest Post - ‏2011-08-02T10:46:09Z by jscheel
corone
corone
4 Posts
ACCEPTED ANSWER

Pinned topic a question about the physical memory

‏2011-07-14T04:44:34Z |
Hi,
I have been studying memory management with the books, "Understanding the Linux Kernel(O'Reilly)" and "Linux Kernel Development(Novell Press)".

And then, I tested the below code.


unsigned 

long offset = vma->vm_start; pgd = pgd_offset(vma->vm_mm, offset); ... (omitted) ... pte = pte_offset(pmd, offset);   

if(!pte_none(*pte) && pte_present(*pte)) 
{ printk(
"pte : %08lu \n", pte->pte); 
}

the result is...

pte : 1efeb025


The above address, 1efeb025, in the variable pte is a physical address??
So that means '1efeb025'th space in the physical main memory??

and 1 more question,
The offset variable for pgd_offset(), pmd_offset(), pte_offset() are...
always vma->vm_start, vma->vm_start + PAGE_SIZE, vma->vm_start + (PAGE_SIZE * 2), vma->vm_start + (PAGE_SIZE * n)???

hardware information

Intel, core 2 duo, i386, 32bit


Thank you.
Updated on 2011-08-02T10:46:09Z at 2011-08-02T10:46:09Z by jscheel
  • corone
    corone
    4 Posts
    ACCEPTED ANSWER

    the Intel Architectures Software Developer's Manual.

    ‏2011-08-02T07:45:41Z  in response to corone
    I figured it out from the Intel Architectures Software Developer's Manual.

    pte->pte value has Page Frame Number(31:12) and the properties(11:0) of the page.

    For more details, refer to the Intel Architectures Software Developer's Manual.

    Thank you.
    • jscheel
      jscheel
      31 Posts
      ACCEPTED ANSWER

      Re: the Intel Architectures Software Developer's Manual.

      ‏2011-08-02T10:46:09Z  in response to corone
      I'm happy you figured this out.

      I hope you understand that because you posted an Intel Linux question to a Power forum, our ability to help was limited.

      Thanks for posting the answer as well!!! Good luck with future programming.