Kernel space, user space, and virtual address

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.