The organizational structure of the Linux kernel source code-general Linux technology-Linux programming and kernel information. The following is a detailed description. As a special program, the Linux kernel also needs to be compiled and linked before it can run. It only has special permissions during execution and is located in a specific space, and won't and won't trust other software.
Since the development of Linux, the organizational structure and hierarchy of its kernel have become increasingly clear. Once the basic system is installed, users with system administrator permissions can compile the kernel. Generally, the source code of the Linux kernel is stored in the/usr/src/linux directory, it separates the code dependent on the architecture from the code independent from the architecture (the former accounts for only 5% of the Code, usually some assembly code and local processing details for different architectures, such as clock timer frequency ).
To help readers better understand the kernel structure, the following lists several important source code directories:
Arch directory the directory depends on the Code implemented by the architecture. In this directory, the versions transplanted for different architectures have three subdirectories: kernel, lib, and mm. The kernel subdirectory contains general kernel functions that depend on the architecture, such as signal processing and clock processing. The lib sub-directory contains the local implementation of the library function. If the library function is compiled from the source code dependent on the architecture, it runs faster. The mm sub-directory contains the storage management implementation code.
The drivers directory contains more than 50% of the kernel source code. All driver source codes are located under this directory.
The fs directory stores the implementation code of all file systems supported by the system.
Include some important header files in the directory.
All the Code required to process inter-process communication in the ipc directory is stored in the ipc directory.
The init directory stores the initialization code of all systems. Many important files, such as main. c, are located in this directory. This file also contains many core code, such as the fork () implementation code and the most frequently executed code-cpuidle () loop.
Lib directory this directory places the code that is frequently needed for other parts of the kernel. For example, inflate. c is put here. It can decompress the kernel and load it into the memory during boot, and it also knows how to decompress the standard PKZIP 8-bit compression algorithm.
The kernel directory contains many kernel functions that are most commonly called. Here are the schedulers fork () and timer. c. You can also find printk. c In this directory.
Mm directory this directory contains the source code for all Linux virtual memory management.
The. net directory contains all the code that provides network support.
The Document directory contains a large number of kernel code related documents and user development and maintenance manuals.
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