Linux system startup process

Source: Internet
Author: User

Bios:

    • Basic input output system, typically stored in the BIOS chip on the motherboard
    • The BIOS is the first program that runs when the computer starts, checking the hardware and looking for bootable devices.
    • Bootable devices are defined in the BIOS settings, such as USB, CDROM, HD.

Mbr:

    • Size is 512 bytes,
    • After the BIOS finds the bootable device and executes its boot code, the boot code is the first 446 bytes of the MBR, because his capacity is small and it is impossible to complete all the boot work on the operating system, so it is mostly done with a jump function, specific bootloader in grub.

Grub:

    • It is now the mainstream boot program used by Linux and can be used to boot almost all of the operating systems now.
    • The relevant files for grub are saved in the/boot/grub directory, and the configuration file is/boot/grub/grub.conf.
    • /boot/grub/grub.conf==> stage1 512 bytes, is an MBR image file that can be used to back up ==> xxx_stage1_5, loading support for file systems,==> Stage2 = > Kernel
    • The contents of the configuration file are as follows:

Default=0--The first configuration is used by default
Timeout=0-The time to wait on the boot screen, which is set to 0 seconds
Splashimage= (hd0,0)/grub/splash.xpm.gz-The background of the boot interface, using a. xpm.gz format picture, can be customized manually.
Hiddenmenu--Hide the menu bar

The configuration format is as follows:
   titleFedora (2.6.35.13-92.FC14.I686.PAE)--The name displayed on the boot screen, can be set freely
   Root(hd0,0)--the partition where the operating system is located, which is the first partition of the first hard disk
   Kernel /vmlinuz-2.6.35.13-92.fc14.i686.pae( kernel file ) ro (parameters, read-only) root=/dev/mapper/vg_embedclub-lv_root (tell the bootstrapper where the root partition is located) rd_lvm_lv=vg_embedclub/lv_root rd_lvm_lv=vg_embedclub/lv_swap rd_no_luks rd_no_md Rd_NO_DM LANG=zh_CN. UTF-8 keytable=us RHGB quiet
   INITRD/initramfs-2.6.35.13-92.fc14.i686.pae.img--Kernel module package file

KERNEL:

    • The MBR's boot code will be responsible for locating and loading the Linux kernel, and will typically load kernel module packaging files: initrd/initramfs-2.6.35.13-92.fc14.i686.pae.img
    • Linux to keep the kernel of the simplification of some of the less common drivers, functions compiled into a module, when needed to dynamically load, and these modules are packaged to save as a Initramfs file.
    • Earlier versions of Linux use the Initrd file, Initramfs is an alternative to INITRD optimized version, more space-saving and more flexible than INITRD.
    • The command DMESG can view the output information of the kernel at the start of this boot, or it can be viewed through DMESG in the/var/log directory.

Init:

    • The first process running on a Linux system is the parent process of all processes that persist throughout the operating system until the system shuts down. The top command can view the PID, where 1 is the Init
    • Calling/etc/rc.d/rc.sysinit is responsible for initializing the system, mounting the file system, and starting the corresponding service based on the RunLevel.
    • Linux Run Level:
      0 Turn off the machine
      1 Single-User mode
      2 Multi-user mode without network
      3 Multi-user mode
      4 Not used
      5 XLL graphical Multi-user
      6 restart
    • The default runlevel can be modified through the/etc/inittab configuration file
      Startup services for each level are saved in/etc/rc.cd/tc[0123456]
      Command RunLevel to display the current and previous RunLevel
      Command init can change the current run level

Linux system startup process

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.