As a technical geek and Linux user we must have a knowledge of the Linux system Initialization process. Let's first start with its basic and will take it to the depth in upcoming articles.
When Linux system is started, there are few basic steps are involved in process.
- Hardware Initialization
- Boot Loader
- Kernel Initialization
- Init Initialization
1. Hardware Initialization:
- Everything on system starts with BIOS.
- BIOS runs POST (Power of Self Test), which checks hardware.
- It then passes control to the boot device.
- Boot loader is resposible for loading and starting OS when computer is powered on.
- It generally invoked in two ways.
BIOS passes control to an IPL (Initial Program Loader) installed within a drive's MBR (Master Boot Record).
BIOS passes control to another boot loader, which then invokes IPL installed within partition's boot sector.
- IPL must exist within a very small space, no longer than 446 byte. So IPL for GRUB is merely a first stage whose solve task is to locate and load a second stage of boot loader which does most of the work to boot the system.
Note: GRUB is widely used boot loader on Linux based distribution.
For more details on GRUB visit our post Linux Boot Loader.
3. Kernel Initialization:
- GRUB passes control to the kernel of respected OS.
- Kernel detects hardware and initializes required drivers for booting of system. At the time of kernel initialization device drivers are compiled in to kernel are called and will attempt to locate their corresponding devices. If its successful in locating the devices, the drivers would be initialized and logs output to the kernel message buffer.
- If essential drivers those are required for the booting of system have been compiled as modules instead in to the kernel then they must be included in an initrd image which is then temporarily mounted by kernel on RAM disk to make modules available for the initialization process.
- Kernel will mount root file system read only and passes control to the init process.
- Output of kernel messages are scrolled quickly instead use /var/log/dmesg that logs a snapshot of the kernel messages.
4. Init Initialization:
- Kernel then passes control to the init process. init is parent of all process. Its’ always having PID of 1.
- /etc/inittab file contains information on how init should set up the system in every runlevel as well as default run level to use.
- runlevel is a specific way to organize initialized software in Linux.
For more details on init visit our post Init Configuration.
I am excited to see more updates on this. It's interesting. Isn't it more or less similar to the basic booting procedure of any system including those from PC-xt, -at versions? when will be the next lesson :)
ReplyDelete