Detailed analysis of Linux kernel initialization process

Source: Internet
Author: User
Article title: detailed analysis of Linux kernel initialization process. 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.

Overview

System guidance and initialization are the first step to control the operating system and an important part to reflect the advantages and disadvantages of the system. LINUX, as a free quasi-UNIX operating system, has become another mainstream in the WINDOWS series because of its outstanding performance in many amateurs and small business processing markets. Understanding about LINUX system initialization is very helpful for further understanding of UNIX systems.

Generally, the LINUX system initialization can be divided into two parts: the kernel part and the init Program part. The kernel mainly performs system hardware detection and initialization, while the init Program mainly performs system configuration.

Kernel initialization details

Generally, the computer first uses the LILO program to boot a portion of the kernel (which is not compressed) to boot other parts of the kernel. The LILO program is the most commonly used and well-developed LINUX system boot tool. the PC usually reads this program from the boot sector of the hard disk. For details about the LILO program, refer to other materials.

After the kernel is decompressed and loaded into the memory, initialize the hardware and device drivers. The following are the specific steps for kernel initialization system (there will be some differences between different versions. The following is an example of version 2.2.16-22 ):

(1) Check the CPU clock speed and console display type, and estimate the CPU speed using the Bogo MIPS program.

(2) the kernel then displays the system memory information through peripherals, for example, 131072 KB (128 MB) and 127820kb remaining. the actual usage is: KB kernel code, KB reserved, and 1728kb data. It is the information of various hash tables.

(3) the kernel supports loading limited disk space, and completes CPU detection (including checking the mathematical coprocessor) and POSIX adaptive detection.

(4) initialize the pci bios, check the system's PCI devices, and load TCP/IP network support.

(5) The Kernel starts to detect other hardware devices, such as PS/2 ports, serial port devices, hard disks, floppy disks, and SCSI.

Then, the kernel starts the init Program to form the first process of the system. The following is the kernel initialization information recorded by dmesg (partial ):

Detected 499845 kHz processor.

Console: color VGA + 80x25

Calibrating delay loop ...... 996.15 BogoMIPS

Memory: 127820 k/131072 k available (1048 k kernel code, 412 k reserved, 1728 k data, 64 k init, 0 k bigmem)

Dentry hash table entries: 262144 (order 9, 2048 k)

Buffer cache hash table entries: 131072 (order 7,512 k)

Page cache hash table entries: 32768 (order 5,128 k)

VFS: Diskquotas version dquot_6.4.0 initialized

CPU: Intel Celon (Mendocino) stepping 05

Checking 386/387 coupling ...... OK, FPU using exception 16 error reporting.

Checking 'hlt 'instruction ...... OK.

POSIX conformance testing by uniix

Mtrr: v1.35a (19990819) Richard Gooch (rgooch@atnf.csiro.au)

PCI: pci bios r

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.