Linux architecture and kernel structure diagram

1. When asked about the Linux architecture (that is, how the Linux system is composed), we can answer this with reference to the following figure: From a broad perspective, the Linux architecture can be divided into two parts:
(1 ) User space: The user space also contains, the user's application, the C library
(2 ) Kernel space: The kernel space includes system calls, kernels, and code related to the platform architecture
 2. Reasons why the Linux architecture is divided into user space and kernel space:
    1) Modern CPUs usually implement different working modes,
     Take ARM as an example: ARM implements 7 working modes, and the instructions that the CPU can execute or the registers that can be accessed are different in different modes:
(1) user mode usr (2) system mode sys (3) management mode svc (4) fast interrupt fiq (5) external interrupt irq (6) data access termination abt (7) undefined instruction exception with (2) x86 as Example: X86 implements 4 different levels of permissions, Ring0—Ring3; Ring0 can execute privileged instructions and access IO devices; Ring3 has many restrictions    
    2) Therefore, from the perspective of CPU, in order to protect the security of the kernel, Linux divides the system into two parts;
    3. User space and kernel space are two different states of program execution. We can complete the transfer from user space to kernel space through "system calls" and "hardware interrupts"
    4. Linux kernel structure (note the distinction between the LINux architecture and the Linux kernel structure)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324693163&siteId=291194637