Hello,
Thanks for visiting RvKmR.blogspot.in
You may be curious about what happens in background when you press an power button of an Linux PC/server. Well in this post I am going to explain about how Linux systems boots. I gone thorough lot of tutorials and came with below boot steps.
Before going to process you must to be aware of ROM, RAM, CPU etc.
OK, let's start !!!
- As soon as power button pressed system performs system integrity check, we call it as POST and load and execute boot loader to RAM. The module for performing POST and loading boot loader in RAM is available in ROM and which wont be lost when you power off the systems so that we call it as Read only memory.
- Then the cpu/processor comes in picture. processor having registers, some of them are AX, BX, CX, ISP etc. each of them having there own purpose. For now we are interested in ISP only, which is an instruction pointer in RAM. It means it holds address of instruction to run next. Loaded module contains instruction to talk to HDD to load boot loader, partition table and other information.
- Then the boot loader or grub gets loaded from first sector of HDD to RAM. Now ISP set to execute boot loader. Boot loader is sophisticated, it knows about partition table and file system so it can deal with directory structure.
- Boot loader is of about 512 bytes in size which contains primary boot loader info of 446 bytes, partition table info of 64 bytes and MBR validation check info of 2 bytes in size.
- As grub is loaded now cpu starts executing grubs and reads configuration file of grub which is at /boot/grub/grub.cfg
- This configuration file contains information / menu list of OS. and which OS is where on HDD.
- Now grub displays list of available/configured OS on console. User can select OS to be started or it will boot default OS configured.
- After selecting OS , grub load and execute kernel in initrd. initrd is temporary root file system as specified in grub.cfg
- Then kernel execute init program located in /sbin/init. init process decides runlevel to be booted with and loads respective modules.
- Program starts with 'S' are used while startup of system for respective runlevel and program starts with 'K' are used while shutdown.
Thanks...its very helpful for me.
ReplyDelete