The location of the Linux kernel source code is generally in the "/usr/src/linux kernel version" directory in the system; if there is no similar directory in the system, it is because the kernel code has not been installed yet. The kernel is the entire operating system. The soul is responsible for managing disk files, memory, starting and running programs, receiving and sending data packets from the network, etc.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
Generally in /usr/src/linux*.*.* in the Linux system (*.*.* represents the kernel version, such as 2.4.23) The directory is the kernel source code (if there is no similar directory, it is because the kernel code has not been installed yet). It can also be downloaded for free from the Internet.
Expand knowledge
The role and abstract structure of the kernel
The position of the Linux kernel in the entire operating system, the Linux kernel The location in the entire operating system is as shown in the figure below:
The Linux operating system consists of four parts (four layers of dependencies-->The upper layer depends on the lower layer):
User process: User application is a collection of software running at the highest level of the Linux operating system.
System call interface: System call runs in the kernel state, or system state, and generally runs in the user state. System calls are part of the kernel code.
Linux kernel: The kernel is the soul of the entire operating system. It is responsible for managing disk files, memory, starting and running programs, receiving and sending data packets from the network, and so on.
Hardware equipment: Linux installation requires all possible physical equipment, such as: CPU, hard disk, network hardware, etc.
The role of the Linux kernel
From the perspective of a software engineer, the operating system kernel provides an extended or virtual computing platform that is equivalent to computer hardware. Ordinary users think of the operating system as a resource manager. Linux supports multitasking in a unified manner, and this method is transparent to user processes. Each process runs as if it is the only process running on the computer, monopolizing memory and other hardware resources.
Linux kernel abstract structure. It is composed of 5 main subsystems. The specific architecture is shown in the following figure:
a. Process scheduling controls the process’s access to the CPU
b. Memory management allows multiple processes to safely share the main memory area.
c. The virtual file system VFS hides the specific details of different hardware devices and provides a unified interface for all devices.
d. The network interface provides access to various network standard protocols and support for various network hardware.
e. Inter-process communication IPC supports various communication mechanisms between processes.
Recommended learning: Linux video tutorial
The above is the detailed content of Where is the linux kernel source code?. For more information, please follow other related articles on the PHP Chinese website!