Booting process of Linux: Difference between revisions

Content deleted Content added
Kernel and Init phases: separate kernel from init
Init phase: clarify init and fix section indent
Line 46:
:"When the kernel is loaded, it immediately initializes and configures the computer's memory and configures the various hardware attached to the system, including all processors, I/O subsystems, and storage devices. It then looks for the compressed initrd image in a predetermined ___location in memory, decompresses it, mounts it, and loads all necessary drivers. Next, it initializes virtual devices related to the file system, such as LVM or software RAID before unmounting the initrd disk image and freeing up all the memory the disk image once occupied. The kernel then creates a root device, mounts the root partition read-only, and frees any unused memory. At this point, the kernel is loaded into memory and operational. However, since there are no user applications that allow meaningful input to the system, not much can be done with it."
 
===Init phase=process==
:{| style="border:1px black solid"
| "Init is the father of all [[process]]es. Its primary role is to create processes from a script stored in the file <code>/etc/inittab</code>. This file usually has entries which cause init to spawn [[getty]]s on each line that users can log in. It also controls autonomous processes required by any particular system. A run level is a software configuration of the system which allows only a selected group of processes to exist. The processes spawned by init for each of these run levels are defined in the /etc/inittab file.
Line 53:
|}
 
Init's job is "to get everthing running the way it should be", <ref name="p2b_6">http://axiom.anu.edu.au/~okeefe/p2b/power2bash/power2bash-6.html</ref> includingonce the kernel is fully running. This includes checking and mounting [[file system]]s, starting up necessary user [[services]], and ultimately switching to a user-based environment when system startup is completed. It is similar to the [[Unix]] and [[BSD]] init processes, from which it derived, but in some cases has diverged or become customized. In a standard Linux system, Init is executed with a parameter, known as a [[runlevel]], that takes a value from 1 to 6, and that determines which subsystems are to be made operational. Each runlevel has its own [[script]] which codifies the process involved for the given runlevel, and it is these scripts which are referenced as necessary in the boot process. Init scripts are typically held in directories with names such as <code>"/etc/rc..."</code>. Corresponding scripts also exist to direct the process required when leaving each runlevel. The top level configuration file for init is at <code>/etc/inittab</code>.<ref name="p2b_6" />
 
During system boot, it checks whether a default runlevel is specified in /etc/inittab, and requests the runlevel to enter via the system [[console]] if not. It then proceeds to run all the relevant boot scripts for the given runlevel, including loading [[module]]s, checking the integrity of the root file system (which was mounted read-only) and then remounting it for full read-write access, and sets up the [[newtowrking|network]].<ref name="oldfield" />