Analysis of kernel and user States in Linux

Source: Internet
Author: User

Linux uses Ring3 to run the user State. Ring0 is used as the kernel state, but Ring1 and Ring2 are not used. Ring3 status cannot access the address space of Ring0, including code and data. The 4 GB address space for Linux processes. The 3g-4g address space is shared by all users. It is the kernel-state address space, which is stored in the entire kernel code and all kernel modules, and the data maintained by the kernel. The user www.2cto.com runs a program, and the process created by the program starts to run in the user State. If you want to perform file operations, network data transmission, and other operations, you must use write, send and other system calls. These system calls will call the code in the kernel to complete the operation. At this time, you must switch to Ring0 and then enter the kernel address space in 3GB-4GB to execute the code to complete the operation, switch back to Ring3 and return to the user State. In this way, user-state programs cannot operate on the kernel address space at will, thus providing security protection. The protection mode ensures that the address space between processes does not conflict with each other through memory page table operations and other mechanisms. Operations of one process do not modify the data in the address space of another process.
Author: Tommy_wxie

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.