These steps are not fully detailed so you maybe after reading them you still can’t understand how does it exactly work, but I believe that they are the most important steps in booting and running the system.
- Power ON
- BIOS makes a POST (Power On Self Test) and then checks which drive to use as the primary boot device.
- Then a small program always located at the same place for all operating systems: track 0, head 0 and cylinder 0 called GRUB (GRand Unified Boot loader) or LILO (LInux LOader) performs the initialization and boot of the operating system.
** The GRUB configuration file contains command to :
– set the default OS to boot if you do not hit any key.
– set the time in seconds to wait before the default OS is booted.
– decide which kernel image to load.
– point to the partition where /boot directory is.
- The kernel checks the running graphics card first and then checks the hardware present on the computer and loads their drivers.
- In this step the kernel attempts to mount file system , if it fails then kernel panic occurs and the system stops. If not , a process called init with PID = 1 will be generated.
- When the init process starts, it checks configuration files to carry on its job. The most important thing here is the runlevel.
** The runlevels are modes of operation (from 1 to 6) :
– Runlevel 0: shutdown/halt the system
– Runlevel 1: single user mode
– Runlevel 2: multi user mode without network
– Runlevel 3: multi user mode with network
– Runlevel 4: reserved for local use (GUI mode for Slackware only)
– Runlevel 5: graphical user interface (GUI) mode
– Runlevel 6: reboot
they are listed in rcX.d files, where X indicates the runlevel number.
**If you want your computer to boot to runlevel 3, runlevel 1 programs are started, then runlevel 2 programs then runlevel 3, and the system is booted.(runlevel 4 will not start)
- Then the init performs system initialization process, called sysinit.
- init mounts /proc, where Linux keeps track of various processes and hardware and reads the BIOS to check Date and Time then sets the time zone. Then it mounts the swap area (partition) .
- After that , init sets the host name and mounts the root file system (/ ). Then starts to identify the Plug’n’Play devices and makes the OS know about them by executing specific routines. (it checks and verifies RAID if there is any)
- At the end , init mounts all the file systems defined in /etc/fstab and executes any task specified in it.
- When all of the above are completed successfully, Graphical User Interface (GUI) starts up by /sbin/mingetty processes.
- If the computer is in this step that means the system is up and running GUI.