On 28-04-08 10:03, Andreas Leppert wrote:
1) Suppose I have a machine with 512 MB RAM. How is the memory node
structured into zones? Is it in this way?
ZONE_DMA: 1-16 MB
ZONE_NORMAL: 17-512 MB
That means, there is no high memory available for those machines with
less than 896 MB RAM ?
Yes. With PAGE_OFFSET settable even through the kernel config these days the
precise thing is replacing "896" by "4G - PAGE_OFFSET - VMALLOC_RESERVE" but
that's it yes.
Note that these zones are a subdivision of _memory_ (see below).
2) Am I right that access to the kernel in memory is as follows:
[ snip ]
So, user-space linear addresses are always below 0xC0000000
Yes, with 0xC0000000 replaced with PAGE_OFFSET (as you did).
and if a user-process addresses something beyond this it is somehow
prohibited.
Yes. The something is page protection flags.
But in the "real" physical memory, the order is turned around: the
kernel resides in the lower regions of the memory and the user-space in
the upper regions. Is this correct?
No, not so much. I believe you're mixing together two concepts in "kernel"
and/or "kernel-space". "The kernel resides" as formulated above would seem
to refer to the kernel image; the code and data which is put into RAM by the
loader from the vmlinuz file. That image can basically be anywhere. The
normal thing on x86 is that it's loaded at 1M physical but you can change
that (through the kernel config even).
Kernel-space is defined as "that bit of the process address-space that only
the kernel can access": on 32-bit architectures, the bit from PAGE_OFFSET to
4G (the last 1G with the normal values).
Note that these spaces are a subdivision of _address-space_ (here is below).
In physical memory, kernel allocations and user allocations are mixed all
over the map -- kernel and user "compete" for the exact same memory when
making allocations (compete between quotes since the kernel wins everything
it itself hasn't allowed the user to lock in to place through mlock...) and
their allocations are physically all over the map.
So, see, user-space and kernel-space are not entities that exist in physical
memory, only in virtual memory, and as such there's no "turned around" or
anything.
Your other points seemed dependent on this issue.
Rene.
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ