Difference between revisions of "Arch boot process"

From ArchWiki
Jump to: navigation, search
m (added ja lang)
(9 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
[[Category:Boot process]]
 
[[Category:Boot process]]
 
[[Category:About Arch]]
 
[[Category:About Arch]]
 +
[[ar:Arch Boot Process]]
 
[[cs:Arch Boot Process]]
 
[[cs:Arch Boot Process]]
[[en:Arch Boot Process]]
 
 
[[es:Arch Boot Process]]
 
[[es:Arch Boot Process]]
 
[[fr:Processus de boot]]
 
[[fr:Processus de boot]]
 
[[it:Arch Boot Process]]
 
[[it:Arch Boot Process]]
 +
[[ja:Arch Boot Process]]
 
[[ru:Arch Boot Process]]
 
[[ru:Arch Boot Process]]
 
[[zh-CN:Arch Boot Process]]
 
[[zh-CN:Arch Boot Process]]
{{Article summary start}}
+
{{Related articles start}}
{{Article summary text|A chronological overview of the Arch boot process.}}
+
{{Related|Boot Loaders}}
{{Article summary heading|Overview}}
+
{{Related|Master Boot Record}}
{{Article summary text|{{Boot process overview}}}}
+
{{Related|GUID Partition Table}}
{{Article summary heading|Related}}
+
{{Related|Unified Extensible Firmware Interface}}
{{Article summary wiki|fstab}}
+
{{Related|mkinitcpio}}
{{Article summary wiki|Systemd}}
+
{{Related|systemd}}
{{Article summary wiki|Autostarting}}
+
{{Related|fstab}}
{{Article summary end}}
+
{{Related|Autostarting}}
 +
{{Related articles end}}
  
== Bootloader ==
+
In order to boot Arch Linux, a Linux-capable [[Boot Loaders|boot loader]] such as [[GRUB]] or [[Syslinux]] must be installed to the [[Master Boot Record]] or the [[GUID Partition Table]]. The boot loader is responsible for loading the kernel and [[mkinitcpio|initial ramdisk]] before initiating the boot process. The procedure is quite different for [[Wikipedia:BIOS|BIOS]] and [[UEFI]] systems, the detailed description is given on this or linked pages.
After the system is powered-on and the [[Wikipedia:Power-on self-test|POST]] is completed, the BIOS locates the preferred boot medium and transfers control to the [[Master Boot Record]] of this device. On a GNU/Linux machine, often a bootloader such as [[GRUB]] or [[LILO]] is found and loaded from the MBR. The bootloader presents the user with a range of options for boot, e.g. Arch Linux and Windows on a [[Windows and Arch Dual Boot|dual-boot setup]]. Once Arch is selected, the bootloader loads the kernel ({{ic|vmlinuz-linux}}) and the initial root filesystem image ({{ic|initramfs-linux.img}}) into memory and then starts the kernel, passing in the memory address of the image.
+
 
 +
== Boot process ==
 +
 
 +
=== Under BIOS ===
 +
 
 +
# System switched on - [[Wikipedia:Power-on self-test|Power-on self-test]] or POST process
 +
# After POST BIOS initializes the necessary system hardware for booting (disk, keyboard controllers etc.)
 +
# BIOS launches the first 440 bytes ([[Master Boot Record]]) of the first disk in the BIOS disk order
 +
# The MBR boot code then takes control from BIOS and launches its next stage code (if any) (mostly [[Boot Loaders|boot loader]] code)
 +
# The launched (2nd stage) code (actual boot loader) then reads its support and config files
 +
# Based on the data in its config files, the boot loader loads the kernel and initramfs into system memory (RAM) and launches the kernel
 +
 
 +
=== Under UEFI ===
 +
 
 +
See the main page: [[Unified Extensible Firmware Interface#Boot Process under UEFI]].
  
 
== Kernel ==
 
== Kernel ==
Line 30: Line 46:
  
 
== Init process ==
 
== Init process ==
At the final stage of early userspace, the real root is mounted, and then replaces the initial root filesystem. {{ic|/sbin/init}} is executed, replacing the {{ic|/init}} process.
+
At the final stage of early userspace, the real root is mounted, and then replaces the initial root filesystem. {{ic|/sbin/init}} is executed, replacing the {{ic|/init}} process. Arch uses [[systemd]] as the init process.
 
+
In the past, Arch used [[SysVinit]] as the init process. Now on new installs, [[Systemd]] is used by default. Existing [[SysVinit]] users are recommended to switch to [[systemd]].
+
  
 
== See also ==
 
== See also ==

Revision as of 10:45, 16 November 2013

In order to boot Arch Linux, a Linux-capable boot loader such as GRUB or Syslinux must be installed to the Master Boot Record or the GUID Partition Table. The boot loader is responsible for loading the kernel and initial ramdisk before initiating the boot process. The procedure is quite different for BIOS and UEFI systems, the detailed description is given on this or linked pages.

Boot process

Under BIOS

  1. System switched on - Power-on self-test or POST process
  2. After POST BIOS initializes the necessary system hardware for booting (disk, keyboard controllers etc.)
  3. BIOS launches the first 440 bytes (Master Boot Record) of the first disk in the BIOS disk order
  4. The MBR boot code then takes control from BIOS and launches its next stage code (if any) (mostly boot loader code)
  5. The launched (2nd stage) code (actual boot loader) then reads its support and config files
  6. Based on the data in its config files, the boot loader loads the kernel and initramfs into system memory (RAM) and launches the kernel

Under UEFI

See the main page: Unified Extensible Firmware Interface#Boot Process under UEFI.

Kernel

The kernel is the core of an operating system. It functions on a low level (kernelspace) interacting between the hardware of the machine and the programs which use the hardware to run. To make efficient use of the CPU, the kernel uses a scheduler to arbitrate which tasks take priority at any given moment, creating the illusion of many tasks being executed simultaneously.

initramfs

After the kernel is loaded, it unpacks the initramfs (initial RAM filesystem), which becomes the initial root filesystem. The kernel then executes /init as the first process. The early userspace starts.

The purpose of the initramfs is to bootstrap the system to the point where it can access the root filesystem (see FHS for details). This means that any modules that are required for devices like IDE, SCSI, SATA, USB/FW (if booting from an external drive) must be loadable from the initramfs if not built into the kernel; once the proper modules are loaded (either explicitly via a program or script, or implicitly via udev), the boot process continues. For this reason, the initramfs only needs to contain the modules necessary to access the root filesystem; it does not need to contain every module one would ever want to use. The majority of modules will be loaded later on by udev, during the init process.

Init process

At the final stage of early userspace, the real root is mounted, and then replaces the initial root filesystem. /sbin/init is executed, replacing the /init process. Arch uses systemd as the init process.

See also