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