Linux kernel basics

Source: Internet
Author: User
Linux kernel Basics 1. how does linux constitute? A: linux consists of a user space and a kernel space. the user space consists of the user application space and the C library. the kernel space is composed of the kernel) system call interface and system structure-related code. 2. Why does Linux system... linux kernel Basics 1. how does Linux constitute? A: linux consists of a user space and a kernel space. the user space consists of the user application space and the C library. the kernel space is composed of the kernel) system call interface and system structure-related code. 2. Why is Linux divided into user space and kernel space? A: modern CPUs usually implement different working modes. taking | ARM as an example, seven working modes are implemented: User mode (usr) and fast interruption mode (fiq), External Interrupt mode (irq), management mode (svc), System Mode (sys), data access termination mode (abt), undefined command exception mode (und ). X86 implements four different levels: Ring0 ~ Ring3; the user code runs in Ring3, and the kernel code runs in Ring0. in order to fully protect the operating system itself, misoperation and other problems may cause damage to the linux system itself. 3. two different states of the kernel space and the user space can be transferred from the user space to the kernel space through system calls and hardware interruptions. 4. what is the composition of the Linux kernel? A: The Linux kernel consists of five subsystems: Process Scheduling, memory management, virtual file system, network interface, and inter-process communication. Process Scheduling (SCHED): controls the use of CPU resources by a process. The scheduler adopts appropriate scheduling policies to ensure that each process can access the CPU fairly and reasonably, and that the internal nuclear energy can respond to hardware operations in a timely manner. Memory Management (MM): allows multiple processes to securely share the primary memory area. Supports virtual memory. the operating system only keeps the currently used block in the memory, and the remaining block in the disk. If necessary, the operating system is responsible for switching program blocks in disk and memory space. The hardware-independent part provides process ING and logical memory swap; the hardware-related part provides virtual interfaces for the memory management hardware. Virtual File System (VFS): used to support drivers and storage of external devices. it hides the details of various hardware and provides unified excuses for all devices. Network Interface (NET): provides access to various network standards and supports various network hardware. network interfaces can be divided into network protocols and network drivers. Process scheduling in the center, because each subsystem needs to rely on the process scheduling program to suspend or resume the process. Process Scheduling and memory management are mutually dependent. in a multi-program environment, a program must create a process to run. The first thing to create a process is to load the program and data into the memory. Relationship between inter-process communication and memory: the inter-process communication subsystem must rely on memory management to support the shared memory communication mechanism to access the common memory area. Relationship between virtual file systems and network interfaces: the virtual file system uses network interfaces to support network file systems (NFS), and also uses memory management to support RAMDISK devices. The relationship between memory management and virtual file system: Memory Management uses the virtual file system to support switching, and the exchange process is scheduled by the scheduling program on a regular basis. this is the only reason that memory management depends on process scheduling.
Related Article

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.