• Booting Process in linux?

    The Linux Booting Process.

    In Linux, the login page is handled by the GNOME Display Manager (GDM) or the LightDM. When you press the power button, an electrical signal passes through your system’s motherboard and awakens the entire hardware system. As we all know, the Linux kernel works in a very different method than the traditional booting system. In Linux, the boot process includes a few steps.

    Linux’s boot process activates the kernel user mode that activates the BIOS, MBR, boot menu, GRUB, and the login page. To cover the entire method of the Linux booting process, we will also discuss the power supply, hardware setup, hardware virtualization, storage system, RAM, complementary MOS (CMOS) battery, and all the other booting related topics.


    The Linux Boot Process consists of several stages. each represent by a different components .the following list is briefly summarizes the boot process and features all the major components involved.



    BIOS


    • BIOS stands for basic input/output system.
    • The BIOS perform platform (rather than OS ) specific startup task.
    • The BIOS loaded and executes the partition boot code from the designed boot device,which contain phase 1 of Linux boot loader , phase 1 load phase 2 (the bulk of boot loader code). some ladder may use an intermediate stage to achieve this (know as phase 1.5) since modern large disk may not be fully readable without further code.
    • once the boot loader program is detected and loaded into the memory , BIOS gives the control to it.
    • so in a simple term BIOS loads and executes the MBR boot loader. 

    MBR


    • MBR stands for Master Boot Record.If you’re thinking about switching from Windows to Linux, there is a chance that you have already heard the term MBR vs. GPT. Master boot record or in the shot MBR is well known among Linux enthusiasts because it is maintainable from the BIOS system. Basically, the MBR partition holds the boot records and the booting related files.
    • In the Linux system’s boot process, the MBR partition also stores the data about all the other storage drives and how they will be acting on your Linux system. If you mess up with the MBR partition, your Linux system is in trouble.

      It only requires 4096 Bits of storage to store the GRUB and Linux booting files inside the MBR partition. Though the MBR partition is found in Linux distributions, the GPT partitioning scheme replaces the MBR table in the modern era. Actually, using the GPT scheme is safer than using the MBR scheme for multiple booting.


    • so , in simple term MBR loads and executes the GRUB boot loader.

    GRUB


    • GRUB stands for Grand Unified Bootloader.
    • if you have multiple kernel image installed on your system, you can choose which one to the executed.
    • GRUB display a splash screen , waits for few second , if you don't enter anything , it loads the default kernel image as specified in the group configuration file.
    • GRUB has knowledge of file system .
    • so , in simple word GRUB just load and execute kernel and initrd images .

    KERNEL


    • Kernel () then perform the majority of system setup (interrupts, the rest of memory management device initialization , drivers etc) before spawning separately , the idle process and scheduler , and the init process (which executed in users space).
    • the scheduler effectively takes control of the system management as the kernel goes dormant (idle).
    • Kernel executes the /sbin/init program.
    • initrd stands for initial RAM Disk.



    INIT


    • Looks at the /etc / inittab  files to decide the Linux run level.
    • following are available
                      0-  halt
                      1-  single user mode
                      2-  multi user ,without NFS
                      3-  Full multi user mode
                      4-  Unused
                      5-  x11
                      6-  Reboot
    • init identifies the default initlevel from / etc / inittab and uses that to load all appropriate programs.
    • Execute 'grep' init default / etc / inittab on your system to identify the default run level.
    • the init process execute scripts as need that set up all non-kernel services and structures in order to allow a user environment to be create and than presented the user with a login screen.                                

    RUNLEVEL 


    • When the Linux system is booting up, you might see various services getting started , for example , it might say "start sendmail...OK".Those are the runlevel  program , execute from run level dictionary as defined by run level .
    • Depending on your default init level setting the system will execute the program , execute the program from one on the following directories.
                             *     Run level 0- / etc / rc.d  / rc0.d /
                             *     Run level 1- / etc / rc.d  / rc1.d /
                             *     Run level 2- / etc / rc.d  / rc2.d/                              *     Run level 3- / etc / rc.d  / rc3.d /
                             *     Run level 4- / etc / rc.d  / rc4.d/
                             *     Run level 5- / etc / rc.d  / rc5.d /

                             *     Run level 6- / etc / rc.d  / rc6.d /

    • pls note that there are also symbolic links available for these directory under / etc directly ,So  /etc  / rc0.d is linked to / etc / rc.d / rc0.d.
    • under the /etc / rc.d /  rc*.d / directories . you would see program that stared with S and K .
    • program start during S are used during startup . S for startup.
    • program start with k are used during shutdown . k for kill.
    • there are number right s to k in the program names . these are the sequence number which the program should be started or killed.
    • for example S12 syslog is to start the syslog daemon . which has the sequence number of 12. s80 sendmail is to start the sendmail daemon ,which has sequence number of 80. so, syslog program will be started before send mail.

    On shutdown , init is called to close down all user space functionality in a controlled manners , again via scripted direction , following which init terminated and Kernel execute its own shut down.

    Virtualization: Enable Virtualization Technology on a Virtual Machine


    The hardware virtualization is a setting that you can find inside the BIOS framework. Typically, you do not need to enable the virtualization technology to boot a regular Linux OS on your machine. But, if you are using a mare or a virtual machine to boot the Linux system, you probably need to enable the hardware virtualization feature to accelerate your virtual machine’s efficiency.





    Thanks for Reading.

    SHIVANSHU TIWARI
                                              

      • 0 Comments:

        Post a Comment

        SSKKT

        .

        SSKKT

        if you want to be happy, set a goal that commands your thoughts, liberates your energy and inspires your hopes.

        SSKKT

        System programmers are the high priests of a low cult.

        SSKKT

        Without programming, life would be a mistake.

        Hello

        Author Name

        Shivanshu Tiwari

        Contact Info

        shivanshut9889@gmail.com

        My Hobbies & Interests

        My hobby is playing cricket. It makes me feel fresh and energetic.I have made so many friends while playing cricket. Cricket encourages teamwork.
        My second hobby is playing chess ,Chess Teaches You Problem Solving and making complex decision it helps me in programming.

        Carrier

        Shivanshu Tiwari is a game developer with 5 year of experience working with online companies. He specializes in using Java, c,c++,c#, to build customer facing APIs, and also has experience of software programmer.

        Hello, I am Shivanshu Tiwari