Virtual Memory
The Intel port of Linux reached a mature view of virtual memory with version 2.1 of the kernel. Earlier versions stuck to a ``segmented'' approach to memory management, derived from the beginning of the kernel’s lifetime. The change doesn’t affect driver code, but is worth outlining anyway.
The new convention matches the behavior of other Linux ports. The virtual address space is built up so that the kernel lives at very high addresses (from 3GB upwards), while user addresses are in the range 0-3GB. When a process is running in ``supervisor mode,'' it can access both spaces. When it runs in user mode, on the other hand, it can’t access kernel space because memory pages belonging to the kernel are marked as ``supervisor'' pages, and the processor inhibits access to them.
This kind of memory layout helped to remove the old
memcpy_to_fs kind of functions, as there’s no
longer an FS
segment.
Kernel space and user space now use the same ``segments'' and
differ only in the priority level the CPU is in.
Get Linux Device Drivers now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.