Linux Kernel Source Directory description

Source: Internet
Author: User

The Linux kernel source code is located in the/usr/src/linux directory, its structure distribution 1.3, each directory or subdirectory can be regarded as a module, the connection between its directories represents a "subdirectory or sub-module" relationship. The following is a brief description of each directory.

Arch

The directory includes all the core code related to the architecture. Each of the subdirectories below represents a Linux-supported architecture, such as X86, a subdirectory of the Intel CPU and its compatible architecture. Subdirectories under the Arch directory include:/arch/kernel,/arch/mm,/arch/include,/arch/boot,/arch/configs. Where the/arch/kernel directory contains information such as CPU-related interrupts and SMP,/arch/boot contains information about system startup and the boot image file Bzimage generated after make.

Copying

Under the catalogue is the GPL copyright statement. Any program created by the modification of the source code with the GPL's copyright, or a program generated using the GPL, has the obligation to use the GPL, such as public source.

Credits

Under the catalogue is the Hall of Fame. Information about some of the people who have made a big contribution to Linux.

Documentation

Directory is a number of documents, the linux-3.0.4 version of the directory has 217 files, file 00-index all the files in this directory are briefly described, and other files on the Linux operating system are described in various parts. IRQ.txt describes what is an enumeration definition of interrupts and interrupts in the system and the location of the header files; changes describes the requirements of the current version of the system for each software version, and the Linux 3.0.4 requires that the version of Make is 3.8.0,grub version 0.93.

Drivers

All device drivers in the system are in the directory. It is further divided into several types of device drivers, each with a corresponding sub-directory, such as the driver of the sound card corresponding to the Drivers/sound; Block device drivers, such as the IDE (IDE.C). If you want to see how all the devices that might contain the file system are initialized, you can look at the Device_setup () in DRIVERS/BLOCK/GENHD.C. It not only initializes the hard disk, but also initializes it because the NFS file system needs to be installed on the network other: for example, lib to place the core library code; NET, core and network-related code; IPC, this directory contains the code for the core interprocess communication; Fs, all file system code and various types of file operation code, each of its subdirectories supports a file system, such as fat and ext2.

Fs

The directory holds Linux-supported file system code and various types of file manipulation codes. Each subdirectory supports a file system, including the types of file systems we use: EXT2, Ext3, EXT4, Proc, fat, and NFS. Where the Ext3 file system corresponds to the/FS/EXT3 directory.

Include

The directory includes most of the header files needed to compile the core, such as platform-independent header files under the Include/linux subdirectory, Intel CPU-related header files under the Include/asm-i386 subdirectory, and include/ The SCSI directory is the header file directory for the SCSI device.

Init

The directory contains the core initialization code (not the system's boot code), with MAIN.C and version.c two files. This is a good starting point for studying how the core works.

Ipc

The directory contains the communication code between the core processes.

Kernel

Kernel Management Core code, the file in this directory implements the kernel functions of most Linux systems, the most important of which is SCHED.C, and the processor structure-related code is placed in the Arch/*/kernel directory.

Lib

The directory contains the core library code, but the library code associated with the processor structure is placed in the arch/*/lib/directory.

Maintainers

The catalog holds a list of maintenance personnel who are responsible for each part of the current version of the kernel.

Makefile

The first makefile file of the directory. Used to organize the kernel of the various modules, recorded a module of the relationship between each other and rely on relationships, compile-time use; it is helpful to read the makefile files in each sub-directory to understand the relationship and reliance of each document.

Mm

The directory contains all the memory management code that is independent of the CPU architecture, such as the allocation and deallocation of page storage management memory. The memory management code associated with the specific hardware architecture is located in the arch/*/mm directory, such as ARCH/I386/MM/FAULT.C.

Net

The directory is the core of the network part of the code, each of its subdirectories corresponds to one aspect of the network.

Readme

The file provides various methods of compiling the kernel; How to view the generated file, such as NM Vmlinux | Sort | Less

Reporting-bugs

There are some things about reporting bugs in the catalog.

Rules.make

In the catalogue are some common rules used by various Makefilemake

Scripts

The directory contains script files for configuring the core, and so on.

In general, there is a. depend file and a makefile file in each directory. These two files are the secondary files that are used at compile time. A careful reading of these two documents is helpful in figuring out the links and dependencies of each document. The other directory also has a readme file, which is a description of the file in the directory, the same is conducive to the understanding of the kernel source code.

Hidden files:

. Config

Made oldconfig and make Defconfig will place the generated default configuration in the file. config. After you perform make, the entire system is compiled according to the makefile hierarchy dependency. config is the basis for compiling each module.

Below is the kernel simple directory structure of linux0.11:

Linux Kernel Source Directory description

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.