How Does Linux Work ? ( 12 steps)

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.

  1. Power ON
  2. BIOS makes a POST (Power On Self Test) and then checks which drive to use as the primary boot device.
  3. 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.
  4. The kernel checks the running graphics card first and then checks the hardware present on the computer and loads their drivers.
  5. 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.
  6. 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)
  7. Then the init performs system initialization process, called sysinit.
  8. 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) .
  9. 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)
  10. At the end , init mounts all the file systems defined in /etc/fstab and executes any task specified in it.
  11. When all of the above are completed successfully, Graphical User Interface (GUI) starts up by /sbin/mingetty processes.
  12. If the computer is in this step that means the system is up and running GUI.

One thought on “How Does Linux Work ? ( 12 steps)

  1. Pingback: Linux | Serba Serbi

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s