Booting process of linux consist of following steps:
1)POWER ON
2)BIOS (basic input/output system)-initializes the hardware like keyboard, mouse etc,. Bios software is stored on a ROM chip on the motherboard. After this remaining boot process is controlled by the os. Bios consist of some basic drivers like usb, cd-rom, network with limited functionalities etc.
3)MBR(master boot record)-It is small space of 512 bytes in first sector of hard disk which stores the bootloader code.
4)BOOTLOADER(like grub[GRAND UNIFIED BOOTLOADER] & ISOLINUX(for booting from removable media) )-usually stored in mbr (but now a new space EFI partion space in hard disk is also used for this purpose). Bootloader also provides a interface to choose kernel version & any other os if present.
first bootloader check for bootable partition, then it search for grub & loads it into RAM.
The second stage boot loader resides under /boot. A splash screen is displayed which allows us to choose which Operating System (OS) to boot. After choosing the OS, the boot loader loads the kernel of the selected operating system into RAM and passes control to it.
The boot loader loads the selected kernel image (in the case of Linux) and passes control to it. Kernels are almost always compressed, so its first job is to uncompress itself. After this, it will check and analyze the system hardware and initialize any hardware device drivers built into the kernel.
Bootloader loads kernel as well as initramfs into memory which can be used by kernel.
5)INITIALISE KERNEL AND INITRAMFS :
The initramfs filesystem image contains programs and binary files that perform all actions needed to mount the proper root filesystem, like providing kernel functionality for the needed filesystem and device drivers for mass storage controllers with a facility called udev (for User Device) which is responsible for figuring out which devices are present, locating the drivers they need to operate properly, and loading them.The mount program instructs the operating system that a filesystem is ready for use, and associates it with a particular point in the overall hierarchy of the filesystem (the mount point). If this is successful, the initramfs is cleared from RAM and the init program on the root filesystem (/sbin/init) is executed.
6)INIT PROCESS RUNS,
Once the kernel has set up all its hardware and mounted the root filesystem, the kernel runs the /sbin/init program. This then becomes the initial process, which then starts other processes to get the system running. Most other processes on the system trace their origin ultimately to init; the exceptions are kernel processes, started by the kernel directly for managing internal operating system details.
Near the end of the boot process, init starts a number of text-mode login prompts (done by a program called getty). These enable you to type your username, followed by your password, and to eventually get a command shell.
7)XWINDOWS SYSTEM
Generally, in a Linux desktop system, the X Window System is loaded as the final step in the boot process.
A service called the display manager keeps track of the displays being provided, and loads the X server (so-called because it provides graphical services to applications, sometimes called X clients). The display manager also handles graphical logins, and starts the appropriate desktop environment after a user logs in.