Linux Kernel Basics

Source: Internet
Author: User
Linux Kernel basics-general Linux technology-Linux programming and kernel information. For more information, see the following section. Linux is an operating system with a single kernel (Monolithic kernel), that is, the entire system is a large module, including processor management, memory management, device management and file management logic modules.

The Linux kernel is stored in/boot and represented in a vmlinuz-2.4.20. Use the number format of major. minor. patch. For example, the meanings of the numbers 2.4.20 are as follows:

The first digit (2) indicates the second major version;
The second digit (4) has two meanings: The first minor version of the major version; the even number indicates the production version (the odd number indicates the test version );
The third digit (20) indicates the first patch package of the minor version;

The version of the readhat Linux kernel is slightly different, for example, 2.4.20-10. You can find that a group of numbers (10) are added, and this number is the build number. Each build can add a small number of new drivers or defect fixes. Some readhat kernels also contain "pp", which means "pre-patch", which is a test version of the kernel. If the version number is an even number, the kernel is stable. If it is an odd number, the kernel is under development.

The source code of the linux kernel is located in the/usr/src/linux directory and consists of the following:

The arch subdirectory contains the core Code related to the hardware architecture supported by the core source code. For example, the X86 platform is i386.

The include directory contains most of the core include files. In addition, each supported architecture has a subdirectory.

Init this directory contains the core startup code.

Mm this directory contains all the memory management code. The Memory Management Code related to the specific hardware architecture is located in the arch/*/mm directory. For example, arch/i386/mm/fault. c corresponds to X86.

All device drivers in the drivers system are located in this directory. It is further divided into several types of device drivers, each of which also has corresponding sub-directories, such as the driver of the sound Card corresponds to drivers/sound.

Ipc this directory contains the core inter-process communication code.

Modules this directory contains the modules that can be dynamically loaded.

File System code supported by fs Linux. Different file systems have different subdirectories. For example, ext2 file systems correspond to ext2 sub-directories.

The main core code of kernel. At the same time, the Code related to the processor structure is stored in the arch/*/kernel directory.

Net core network code. Each subdirectory corresponds to one aspect of the network.

Lib This directory contains the core library code. The library Code related to the processor structure is stored in the arch/*/lib/directory.

Scripts this directory contains the script file used to configure the core.

Documentation this directory is a reference for some documents.

Red Hat Linux Startup Process Analysis

When the power of the PC is turned on, the 80x86 CPU structure will automatically enter the real mode, and automatically execute the program code from the address 0xFFFF0, this address is usually the address in the ROM-BIOS. The BIOS of the PC performs detection On some systems and starts to initialize the interrupt vector at the physical address 0. After that, it will read the first sector of the device (soft drive or hard disk) that can be started into the memory address 0x7C00, and jump to this place. If grub is installed in the first part of Linux, it will be read from the BIOS to the memory 0x7C00. grub displays information, selects the operating system, and transmits command parameters, then load/etc/grub. the kernel image file in conf, and the control is taught to the loaded kernel image. Next, extract the kernel, check the system hardware, and configure the driver. Install and check the root file system, and then start the init process in the system background.

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.