Understanding the mapping of physical memory to kernel address space

Sunny Shah shahsunny715 at gmail.com
Thu Mar 12 13:02:49 EDT 2015


Hello,

This is my first mail on this list, so please let me know if I'm erring.

I'm reading Bovet and Cesati's "Understanding the Linux Kernel",
specifically the chapter "Memory Addressing", sub-section "Kernel Page
Tables". Here they describe how Linux initializes its page tables for
various RAM sizes and how much of the physical address space is mapped onto
the kernel virtual address space.

I have several questions from my reading:

   -

   My understanding is that the 32 bit virtual address space of a process
   is split into 2 parts - the first 3 GiB for the user space and the
   remaining 1GiB for the kernel (with the same kernel mapping being used for
   all processes. However, although the kernel is mapped into the higher
   portion of the address space, it resides in the lower 1 GiB of RAM. Is this
   correct?
   -

   There is a frequent mention of "mapping RAM to the kernel address
   space". Is the whole RAM mapped to the kernel space? What would happen in
   the case of a machine having only 1 GiB of RAM?
   -

   Related to the above, what exactly is max_low_pfn? It is mentioned it is
   the "Page frame number of the last page frame directly mapped by the kernel
   (low memory)". What would it's value be for a machine with 1 GiB RAM? For a
   machine with 4 GiB RAM, would it be the number of the frame covering the
   last portion of kernel space (896 MiB)?

Sorry if my questions are a bit vague. I'm still new to this and having
difficulty relating everything.

Thanks,
Sunny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150312/cc862ba7/attachment.html 


More information about the Kernelnewbies mailing list