Original: http://www.cnblogs.com/yanhaidong/archive/2011/02/11/2339050.html
IO is based on the buffer, so-called input and output is to move from the buffer and move out of the data. As an example of IO input, the user space process first requests a disk space data from the kernel, and then the kernel reads the disk data into the kernel
Buffer in the space, and then the process of the user space reads the data in the buffer of the kernel space into its own buffer, and the process can access the data using it.
Kernel space is the space that the operating system kernel runs, which is to ensure that the kernel of the operating system can run safely and stably, and that the user space is the space that the user program runs. User-space programs cannot be directly
access to the disk space to read the data, must pass through the kernel space this intermediary .
The current operating system, user space and kernel space are the logical addresses used. The use of logical addresses is simply because of its two main advantages: one is that it can make multiple logical addresses point to the same physical memory; Second, the logical address space can be large
To the physical memory space.
the The buffer zone of the user space and the buffer zone of the kernel space can be pointed to the same physical memory at the 1th IO operation, eliminating the overhead of copying data from the kernel space to the user space, and also saving memory
For the 2nd, when the user program accesses the memory address, the general operation is as follows: first the virtual memory system will go to physical memory to find out if the virtual address exists. If present, such as a, is read directly from the physical memory;
In, such as D will throw a signal. At this point the virtual memory system will go to the disk space to find, and then after a certain policy, put it into memory, such as the C and D exchange. The data in D can then be used by the user program. This will protect
The user program can read some large files.
Kernel space, user space, and virtual address (RPM)