Linux Booting Sequence :
Have you ever wondered what happens when you power on your LINUX machine?. Here i come with the tutorial for how linux booting process takes place when you turn on the power supply.
There are six stage we have to finally reach our desktop.
STAGES:
1. BIOS
2. MBR
3. GRUB
4. KERNEL
5. INIT
6. RUNLEVELS
LEVEL 1:
BIOS STANDS FOR BASIC INPUT/OUTPUT SYSTEM. USUALLY IT WILL CONTROL AND HAVE THE FIRMWARES FOR ALL THE DEVICES RESIDING INSIDE THE MACHINE. IT WILL EXECUTE THE MASTER BOOT RESORD(MBR).
LEVEL 2:
WHEN BIOS FINISHED IT IS OPERATIONS THEN ALL THE CONTROLS WILL BE HAND OVERED TO THE MBR. IT ALWAYS BE 512 BYTES IN SIZE. IT HAS BEEN SEGREGATED IN FOLLOWING METHOD.
1. FIRST 446 BYTE CONTAINS THE PRIMARY BOOT LOADER INFORMATIONS.
2. PARTITION TABLE INFORMATION IN NEXT 64 BYTES.
3. MBR VALIDATION CHECK IN LAST 2 BYTES.
IT CONTAINS THE INFORMATION ABOUT THE GRUB BOOT LOADER. THIS MBR WILL TAKES THE MACHINE TO THE NEXT LEVEL, WHICH IS USUALLY GRUB(GRANT UNIFIED BOOT LOADER)
LEVEL3:
1. GRUB DEALING WITH KERNELS. FOR EXAMPLE IF YOU HAVE MULTIPLE KERNELS IN YOUR MACHINE ,THROUGH GRUB YOU CAN CHOOSE WHICH ONE SHOULD BE EXECUTED.
2. WHEN GRUB IS BEING EXECUTED BY MBR IT WAITS FOR FEW SECONDS, TO GET THE INPUT FROM USER. IF NO DATA WILL BE PASSED THEN IT WILL RUN THE DEFINITIONS DEFINED IN GRUB.CONF FILE.
3. BY MODIFYING THIS GRUB FILE WE CAN CHANGE THE BEHAVIOR OF THE MACHINE.
LEVEL 4:
1. ONCE THE GRUB EXECUTION PHASE COMPLETED, THEN GRUB EXECUTES THE KERNEL IMAGE. KERNEL IS RESPONSIBLE FOR BRIDGING OUR HARDWARES WITH THE SOFTWARES OR KNOWN AS DRIVERS.
2. KERNEL EXECUTES THE PROGRAM CALLED /sbin/init. SINCE IT IS EXECUTED AS A FIRST PROCESS IT HAS THE PID OF 1 AND SOME SYSTEMS IT WILL BE 0.
3. AND IT ALSO MOUNTS THE ROOT FILE SYSTEM MENTIONED IN THE GRUB.CONF FILE.
4.initrd(init ram disk) is MOUNTED AS THE TEMPORARY ROOT FILE SYSTEM UNTIL THE REAL ROOT FILE SYSTEM GET MOUNTED.
LEVEL 5:
1. IT LOOKS AT THE /etc/inittab file to decide the linux run level.
2. FOLLOWING ARE THE RUN LEVELS AVAILABLE IN LINUX SYSTEMS.
0 - HALT
1 - SINGLE USER MODE
2 - MULTIUSER MODE
3 - FULL MULTIUSER MODE
4 - UNUSED
5 - X11
6 - REBOOT
LEVEL 6:
THEN AT THE 6-TH STAGE IT WILL EXECUTE RUN LEVEL PROGRAMS, BASED ON THE INFO DERIVED FROM THE /etc/inittab. ALL THE DAEMONS LOCATED UNDER THE rc.d directory. THIS IS HOW LINUX BOOTS. IT HAPPENS IN MATTER OF MINUTES OR SO.
I HOPE THIS TUTORIAL WILL HELP YOU GUYS TO UNDERSTAND THE BOOTING PROCESS. IF YOU DO HAVE ANY QUERIES REPLY ME.
ไม่มีความคิดเห็น:
แสดงความคิดเห็น