The files of the Linux core source program are organized in a tree structure. Such directories and files exist in the top layer of the source program tree, that is, the directory/usr/src/linux.
◆ COPYING: GPL copyright statement.
It has the obligation to use GPL for published programs, such as those generated by using GPL tools, due to source code changes with GPL copyrights.
◆ CREDITS: honor list. Some people who have made great contributions to Linux.
◆ MAINTAINERS: maintenance personnel list, responsible for all parts of the current version of the kernel.
◆ Makefile: The first Makefile. It is used to organize the modules of the kernel, record the relationship and dependency between modules, and is used during compilation; carefully reading The Makefile files under each subdirectory is helpful for figuring out the relationship and dependency between each file.
◆ ReadMe: A Brief Introduction to the core and its compilation and configuration methods.
◆ Rules. make: common Rules used by Makefilemake.
◆ REPORTING-BUGS: Report BUGS.
● Arch/: the arch sub-directory contains all core Code related to the architecture. Each of its subdirectories represents a supported architecture. For example, i386 is a subdirectory about intel cpu and its compatible architecture. Generally, PCs are based on this directory;
● Include/: The include sub-Directory includes most of the header files required for compiling the core. Platform-independent header files are in the include/linux subdirectory, intel cpu-related header files are in the include/asm-i386 subdirectory, And the include/scsi directory is the header file directory for the scsi device.
● Init/: This directory contains the core initialization code (Note: it is not the System Boot Code) and contains two files main. c and Version. c. This is one of the good starting points for studying how the core works.
● Mm/: This Directory includes all memory management code independent of the cpu architecture, such as page-based storage management memory allocation and release; the Memory Management Code related to the architecture is located at arch/*/mm/, for example, arch/i386/mm/Fault. c.
● Kernel/: the main core code. The files in this directory implement the Kernel functions of most linux systems. The most important file is sched. c; similarly, the architecture-related code is in arch/*/kernel.
● Drivers/: Place all the device Drivers in the system. Each driver occupies a sub-directory, for example, block device Drivers under/block, such as ide. c ). If you want to check how all devices that may contain a file system are initialized, you can check device_setup () in drivers/block/genhd. c (). It not only initializes the hard disk, but also the network, because the network is required when installing the nfs file system.
● Documentation/: The document directory, without kernel code, is just a set of useful documents. Unfortunately, they are all in English and should be useful.
● Fs/: All File System Code and various types of file operation code. Each subdirectory of Fs supports one file system, such as fat and ext2.
● Ipc/: This directory contains the code for inter-process communication between core processes.
● Lib/: place the core library code.
● Net/: core network-related code.
● Modules/: module File directory, which is an empty directory used to store the module target file generated during compilation.
● Scripts/: description file and script for core configuration.
Generally, each sub-directory contains a Makefile and a Readme file. Read these two files carefully to understand the kernel source code.