Linux 0.12 kernel's memory management is simple and crude, the kernel only used a page directory, only map 4G linear space, virtual space (logical space) each process can only give to 64M, up to 64 process; each process has a corresponding number nr task, a process when the process needs to allocate space, just nr multiplied 64M can be drawn on the starting linear address space of the process. Then the code segment of the process, the data descriptor inside the base address field will be set (nr x 64M), while for the process to allocate the page directory and page table of contents for carrying mappings.
After the process if you want to access an address space of their own will be the first with a base address and 32-bit offset within the program address (logical address) synthesis of linear address, the address must be synthesized in a linear (segment base) ~ between (segment base address + segment limit long), which is (nr x 64M ~ nr x 64M + 64M) between. Then use this linear address follow: "page directory entries - page table - page table entry" in this order to find the corresponding page table entry, will find a physical address, you can actually access the data.
But in the modern kernel, memory management, there are many different.
First, the linear address space will not change, 32-bit CPU can address 4G linear space. This is unique.
But each process has its own separate 4G virtual space, then this is how to do it? In fact, each process is given its own page directory, so that each process can have 4G virtual space (logical space) a.
Note: 0.12 Kernel two processes each synthesized linear address is not necessarily the same, because each process occupy different regions of linear space. But modern kernel, A, B two processes may be synthesized in the same linear address because each process has 4G virtual space, that virtual space and linear space to wait. However, due to the page directory and page tables two processes are different, so each of these two processes will synthesize equal numerical linear addresses are mapped to different physical addresses. Both linear space that is mapped to the physical space is different. In other words, modern kernel, virtual space (logical space) and become almost a linear space concept, the following does not distinguish.
For example, if A and B processes simultaneously access their 0x0804800 linear address space, segmented paging address translation mechanism will put 0x0804800 this linear address mapped to different physical addresses up. And this process, the process that they are invisible, A and B both consider themselves successful visit 0x0804800 this address, but in fact, they visit is "equal value" of each linear linear address space, the final two " equal "linear address value will be mapped to different physical memory address. This enables the process isolation.
Each process has 4G linear space (virtual space), linear spatial isolation between processes, mutual non-interference in each process are working in their own world.
The above said are from the operating system point of view of principle, put on the specific Linux operating system will be a little different. Because the Linux kernel which provides that although each process their own 4G linear space, but they are not free to use it all 4 G. 0-3G user space is indeed free to use, but the kernel space between 3G-4G, can not be free to use. Therefore, the above theory can improve, for each process has a size of 4G linear space, 4G linear space is divided into two parts:
Size of the 3G user space, each process can be used in a free and independent "privileged class 3", this space of each process is completely independent from each other, pointing to different physical memory locations.
1G size of the kernel space, the processes in the "privilege level 0" under before you can use this space, this space are not independent of each process, pointing to the same physical memory location. That is shared by all processes.