Introduction to the organization structure of core source program files in Linux

Source: Internet
Author: User
Article title: Linux system core source program file organization structure introduction. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

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.

Related Article

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.