Booting process of Linux: Difference between revisions

Content deleted Content added
m Init process: clarify init a bit more
m Kernel startup stage: minor punctuation fixes to initrd
Line 49:
start_kernel executes a wide range of initialization functions. It sets up [[interrupt handling]] ([[IRQ]]s), further configures memory, starts the Init process (the first user-space process), and then starts the idle task via <code>cpu_idle ()</code>. At this point, with interrupts enabled, the scheduler can take control of the overall management of the system, to provide pre-emptive multi-tasking, and the init process is left to continue booting the user environment in user space.
 
Notably, the kernel startup process also mounts the [[initial RAM disk]] ("initrd") that was loaded previously as the temporary root filing system during the boot phase. This allows driver modules to be loaded without reliance upon other physical devices and drivers, and keeps the kernel smaller. The root file system is later, switched via a call to <code>pivot_root ()</code> which unmounts the temporary root file system and replaces it with the use of the real one, once the latter is accessible. The memory used by the temporary root file system is then reclaimed.
 
Thus, the kernel initializes devices, mounts the root filesystem specified by the boot loader as [[read only]], and runs [[Init process|Init]] (<code>/sbin/init</code>) which is designated as the first process run by the system ([[PID]] = 1).<ref name="oldfield" /> A message is printed by the kernel upon mounting the file system, and by Init upon starting the Init process. It may also optionally run [[Initrd]] to allow setup and device related matters ([[ram disk]] or similar) to be handled before the root file system is mounted.<ref name="oldfield" />