"Linux kernel Design and implementation" Chapter I.
Chapter One introduction to the Linux kernel:
1.3 Introduction to operating systems and kernels
Operating System: The system contains the operating system and all the applications running on it. An operating system is the part of the system that is responsible for completing the most basic functions and systems management. These sections include kernels, device drivers, boot-to-Program, command-line shell, or other kinds of user interfaces, and basic file management system tools.
kernel: If the user interface is an external image of the operating system, then the kernel is the inner core of the operating system.
kernel space: the System State and the protected memory space.
The composition of the kernel:
1. Interrupt Service Program (response interrupted)
2. Scheduler (time to manage multiple processes sharing processors)
3. Memory management Program (management process address space)
4. System service Program (network, interprocess communication)
How the application process communicates with the kernel:
By the way the system is called. The application process calls the library function, then the function library through the system call interface, let the kernel complete various tasks. (The application is trapped in the kernel via the system call interface)
The kernel is responsible for managing the system's hardware devices:
premise: Hardware devices meet the system communication, the first to issue an asynchronous interrupt signal to interrupt the execution of the processor (kernel execution).
Interrupt Service is the responsibility of the kernel. However, it is important to note that the interrupt service runs in a specialized interrupt context that is unrelated to all processes.
1.4Linux comparison between the kernel and the traditional UNIX kernel
Unix Kernel Features: an indivisible static executable library. (The hardware system provides a page mechanism for the MMU to manage memory.) )
Linux kernel design (mainly discusses the system supporting MMU)
Single Core:
The biggest feature is that the kernel can call functions directly, and all processes are in the kernel state. It is completed as a single large process in its entirety and also runs in a separate address space.
Micro-Kernel:
Functions are divided into multiple independent processes, each of which is called a server. There are two types of privileged mode and user mode, which run independently in the respective address space. IPC communication mechanisms are used among processes.
Linux Kernel and Unix the significant difference:
Supports dynamic loading of kernel modules
Supports symmetric multi-processing mechanism SMP
Can preempt
Do not differentiate between threads and general processes
Provides object-oriented device models with device classes, hot-pluggable events, and device file systems for user space
The essence of freedom is to abandon some of Unix's poor features.
1.5Linux Version number
For example 2. 6. 26.1(second, from the version number to determine whether the kernel is stable or development status.) Steady state for even numbers)
2: Major Version number
6: Sub-version number (from version number)
26: Revision number
1: Stable version number
Summarize:
Although the kernel is made up of processes, it differs from ordinary application processes. Kernel (System State, enter kernel space execution, run in process context), application process (user state, go into user space execution, run in kernel space). The processor runs at any time in one of the following three states: Runs in user space, executes user processes, runs in kernel space, is in the process context, executes on kernel processes, runs in kernel space, is in an interrupt context, and handles interrupts. Such as:
The kernel of Linux is a single kernel. (But Linux absorbs the essence of microkernel, which is a modular, multi-threaded, operating system that the kernel itself can dispatch.) )
Linux and Security "Linux kernel Design and implementation" chapter--20135227 Huang