Introduction to Linux kernel boot parameters

Source: Internet
Author: User
Article title: Linux kernel boot parameters. 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
Kernel boot parameters can be divided into two categories: device-independent and device-related. The Documentation/kernel-parameters.txt file under the kernel source tree lists all the available boot parameters and specifies the specific files that process each parameter. Note: for a module, the bootstrap parameter can only be used to directly compile the module into the core. the format is "module name. parameter = value "mode, for example, usbcore. blinkenlights = 1. For a dynamically loaded module, you can specify the corresponding parameter value on the modprobe command line, for example, modprobe usbcore blinkenlights = 1.

You can run the "modinfo-p $ {modulename}" command to display all available parameters of the loaded module. Modules loaded into the kernel will display their parameters in/sys/module/$ {modulename}/parameters, you can also run the echo-n $ {value}>/sys/module/$ {modulename}/parameters/$ {parm} command to modify the value of some parameters.

The boot parameters related to the device are numerous. you need to read the source code of the driver in the kernel to obtain the boot parameters that are acceptable to you. For example, if you want to know which boot parameters can be passed to the AHA1542 SCSI driver, find the aha1542.c file in the drivers/scsi directory, generally, you can find the description of the accepted bootstrap parameter in the comments of the first 100 rows. Most parameters are passed through "_ setup (... ,...)" For function settings, the first part of the comma is the name of the bootstrap parameter, and the second part is the name of the function that processes these parameters. [Note] you can try it in the root directory of the source code tree.

Grep-r' \ B _ setup * ('* command.

[Note] multiple parameters are separated by spaces. each parameter value cannot contain spaces. the parameter value is a comma-separated list.

Correct: ether = 9, 0x300, 0xd0000, 0xd4000, eth0 root =/dev/hda1
Error: ether = 9, 0x300, 0xd0000, 0xd4000, eth0 root =/dev/hda1 after the kernel is running, you can run the cat/proc/cmdline command to view the original bootstrap parameters and corresponding values.

All boot parameters are case sensitive!

How does the kernel handle boot parameters?
The format of most kernel boot parameters is as follows (each parameter value list can contain up to 10 items ):

Name [= value_1] [, value_2]... [, value_10] if "name" cannot be identified and meets the format of "name = value, it is interpreted as an environment variable (for example, "TERM = linux" or "BOOT_IMAGE = vmlinuz. otherwise, it will be passed to the init Program (such as "single ").

There is no limit on the number of parameters acceptable to the kernel, but the total length of the entire command line (including all the parameters, values, and spaces) is limited, generally between 256-4096, defined in include/asm/setup. COMMAND_LINE_SIZE macro in h.

Kernel boot parameter selection
This article does not cover all boot parameters. Therefore, we will only list the selected boot parameters (based on the 2.6.22 kernel), which are basically ignored.

 Tag description
Not all parameters are always available. they are only available when a specific module exists and the corresponding hardware also exists. The square brackets in the preceding guide parameters describe their dependencies. the labels used are described as follows:

ACPI advanced configuration and power interface APIC Advanced Programmable Interrupt Controller HW corresponding hardware equipment IA-32 IA-32 (i386) architecture X86-64 architecture, more parameters description in Documentation/x86_64/boot-options.txt IOSCHED enables multiple IO schedulers LIBATA enables Libata driver LOOP enables Loopback device NET enables network support PCI bus support PNP plug-and-play support PS2 PS/2 support for SCSI parameters for many SCSI devices description in Documentation/scsi/SMP symmetric multi-processor USB support usbhid usb man-machine interface equipment VT Virtual terminal (Virtual terminal)

In addition, the meanings of the following tags are logically different from those above:

BUGS = bugKNL used to solve certain CPU problems in a specific architecture is a kernel startup parameter. BOOT is a bootstrap parameter.

The parameter marked as "BOOT" is actually used by the BOOT program and has no direct meaning to the kernel itself. Do not modify the syntax of such parameters. For more information, see Documentation/i386/boot.txt.

[1] [2] [3] [4] [5] Next page

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.