Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux basic articles of the boot process     - RedHat / CentOS ext4 partition can not be formatted large supplementary ext4 formatting (Linux)

- LAMP and LNMP automated installation scripts (Server)

- MySQL database under Linux to achieve automatic backup scheduled backup day (Database)

- Linux Network Programming - raw socket instance: MAC Address Scanner (Programming)

- linux raid levels and concepts introduced (Linux)

- JBPM6 Installation and Configuration Tutorial (Linux)

- Dell R710 server disk recovery database one case (record) (Server)

- Seven kinds of NIC binding mode Detail (Linux)

- Modify Linux SSH default port 22 in several ways (Linux)

- Android gets the global process information and the memory used by the process (Programming)

- Java implementation heap sort (large root heap) (Programming)

- Linux kernel socket protocol stack routing lookup cache mechanism (Linux)

- CentOS install expect (Linux)

- Ora-00020: maximum number of processes (500) exceeded (Database)

- CentOS6.6 ordinary users to use sudo command to borrow root user privileges (Linux)

- Build RPM package uses Docker mirror (Linux)

- Django template inheritance child (Programming)

- Acquaintance C ++: the most simple C ++ program (Programming)

- MySQL loose index scan (Database)

- Static member variable modified (Programming)

 
         
  Linux basic articles of the boot process
     
  Add Date : 2017-08-31      
         
         
         
  1 Linux boot process

-------------------------------------------------- ------------------------------
1.1 load the BIOS hardware information and self-test, and according to the set to get the first bootable device

-------------------------------------------------- ------------------------------
BIOS (Basic Input Output System): The system loads the BIOS and loads the CMOS information through the BIOS, and obtains the hardware configuration of the host computer through the settings in the BIOS. The BIOS performs power-on self-test according to the acquired information. Self Test, POST), and determine the bootable device sequence.


1.2 read and execute the first boot device MBR boot loader (that is, grub, spfdisk boot management program)

-------------------------------------------------- ------------------------------
As the different os filesystem format is different from the need to boot management program to handle the core file load (load), the so-called boot loader. Boot loader program installed in the first boot device in the first sector (sector), that MBR (Master Boot Record, the main boot record area, 446bytes). The BIOS reads the MBR through the INT13 interrupt. Each operating system will install a default boot loader to his own file system, which is a prerequisite for multi-system.


1.3 According to the boot loader settings loaded Kernel, Kernel will begin to detect the hardware and load the driver

-------------------------------------------------- ------------------------------
Boot loader According to the set to read the kernel file, and extract to memory, Kernel will start to detect the hardware and load the driver. The kernel is usually in the / boot / vmlinuz-core version, and the kernel can load the kernel modules dynamically (the disk drives are in the form of modules), which are placed in the / lib / modules / directory.

Initial RAM Disk: / boot / initrd, loaded into the memory through the boot loader into a root directory simulation, the virtual file system can provide an executable program, through the boot process to load the process The most needed core module.
Boot loader by loading the kernel and initrd, and then extract the initrd into memory in the root directory, Kernel will be able to load the appropriate driver, the final release of the virtual file system, and mount the actual root directory file system, you can start Follow-up of the normal boot process.


1.4 in the hardware driver is successful, Kernel will automatically start the init program, and init will get run-level information

-------------------------------------------------- ------------------------------
The kernel starts the first program, / sbin / init, and prepares the environment for software execution, including the system's hostname, network settings, language handling, file system format, and other services. The configuration file is / etc / inittab. Inittab will also get run-level (boot execution level).


1.5 init Execute the /etc/rc.d/rc.sysinit file to prepare the software execution environment (such as network, time zone, etc.)

-------------------------------------------------- ------------------------------
Init processes the system initialization process (/etc/rc.d/rc.sysinit), including the decision whether to start SELinux, read the network configuration file / etc / sysconfig / network, user-defined module load / etc / sysconfig / modules / * .modules to fsck check disk file system: filesystem check, clear the boot process of the temporary file, the boot-related information to load / var / log / dmesg file medium.


1.6 init start-run the implementation of the various services (script)

-------------------------------------------------- ------------------------------
Start the system service and the relevant startup configuration file (/etc/rc.d/rc N & / etc / sysconfig) based on run-level. For example, run-level to 5, that is, when the graphical interface starts, it will execute the /etc/rc5.d/ directory script, each script is a real point /etc/init.d/ directory corresponding to the startup script. The last one executed is /etc/rc.d/rc.local.


1.7 init Execute the /etc/rc.d/rc.local file

-------------------------------------------------- ------------------------------
Execute the user-defined start-up program /etc/rc.d/rc.local.


1.8 init Execute the terminal emulation program mingetty to start the login program, and wait for the user to log in


2 boot process of the relevant documents and key points

-------------------------------------------------- ------------------------------
2.1. The configuration file for module loading: /etc/modprobe.d / *. Conf: (The /etc/modprobe.conf file is no longer used in CentOS 6.5).


2.2. / Etc / sysconfig / *: boot configuration file to read during the process, including authconfig (authentication mechanism for user authentication), network-scripts / * (network card settings).


2.3. About the Core and Core Modules (driver modules):
Core: / boot / vmlinuz or / boot / vmlinuz-version;
Core decompress the required RAM Disk: / boot / initrd (/ boot / initrd-version);
Kernel module: / lib / modules / version / kernel or / lib / modules / $ (uname -r) / kernel;
Core source: / usr / src / linux (default is not installed)
Core version: / proc / version
System core functions: / proc / sys / kernel
Two ways to add new hardware driver module: re-compile the core, and add the appropriate driver source code; the hardware driver compiled into a module, at boot time to load the module.
Dependencies of the kernel modules: / lib / modules / $ (uname-r) / The modules dependencies are documented in the /lib/modules/$(uname-r)/modules.dep file, using the depmod command to create the files .
Kernel module related commands: lsmod - shows the module already exists in the core, module dependency will also be displayed
Modinfo - Displays a module's details
Modpobe - automatically analyze the module dependencies (modprobe.dep) and load the module, -r remove the module
Insmod - Manually load the full file name of the module
Rmmod - remove the module, -f force to remove, -w wait to use and then removed
Ps: insmod, rmmod operation module dependent, unable to complete the operation.


2.4. Initrd: initrd file contains / lib / modules / $ (uname-r) / kernel / which boot the necessary modules at boot time through the host INT13 hardware function to read out the file to extract, initrd in memory simulation become Root directory, as this virtual file system (Initial RAM Disk) mainly contains the disk and file system module, the core will finally be able to identify the actual disk, you can mount the actual root directory. Use the mkinitrd command to re-create the initrd file: mkinitrd [-v] [--with = module name] initrd file name Core version


2.5. About the boot management artifact grub:
Through the configuration file /boot/grub/menu.lst to modify and increase the startup items, increase the startup items need to install the main program to the system through grub (such as setup (hd0), such as MBR (hd0) or boot sector Hd0,0) and so on
For a boot entry encryption: grub-md5-crypt, access to the encrypted password, add the menu.lst file in the title below the first line, eg: title CentOS
                      Password --md5 $ 1 $ kvlI0 / $ byrbNgkt / .REKPQdfg287.
Unsafe: The user can enter the menu through edit mode (e) and delete the password field and press b to start the boot process, so encrypt the menu.lst file: put the password in front of all the titles, Lock the title with lock below to lock, the boot entry can only be pressed to unlock p.
     
         
         
         
  More:      
 
- CentOS7 install and configure Nagios (Server)
- Kitematic how seamless and DockerFILE (Server)
- Linux user groups, file permissions Detailed (Linux)
- Linux system Perl Lite netstat (Linux)
- Use CutyCapt to convert HTML pages to png images on Linux (Linux)
- Linux system versions organize local root password cracking method (Linux)
- Ubuntu 10.10 install Oracle 10g graphic tutorials (Database)
- How to use GRUB2 files directly from the hard disk to run ISO (Linux)
- Fedora 20, Fedora 19, CentOS 6 and RHEL6 users how to install Wine 1.7.15 (Linux)
- The official release method to upgrade to Ubuntu 15.04 (Linux)
- Oracle table space usage monitoring (Database)
- Python pickle module for simple use notes (Programming)
- Shell scripts to copy all directories under the current directory of a certain type of file to the same directory (Linux)
- Linux screen command (Linux)
- High-performance JavaScript DOM programming (Programming)
- JDK installation and configuration environment variable under linuxb (Linux)
- MongoDB upgrade to 2.6 (Database)
- Linux System Getting Started Tutorial: How to update outdated version of Ubuntu (Linux)
- Large computer network security policy Experience (Linux)
- Linux environment to configure Apache + Django + wsgi (Server)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.