Booting process of Linux: Difference between revisions

Content deleted Content added
Init phase: clarify init and fix section indent
add overview, remove header. Wikipedia editorship scheduler initialized, author_idle() executed, Article enters runlevel 3 or 5 :)
Line 3:
The '''Linux Startup Process''' is the process by which [[Linux]] based [[operating system]]s initialize. It is in many ways similar to the [[BSD]] and other [[Unix]] style boot processes, from which it derives.
 
==Overview of typical process==
==Boot Loader phase==
In Linux, the flow of control during a boot is from BIOS, to boot loader, to kernel. The kernel then starts the scheduler (to allow multi-tasking) and runs Init (which sets up the user environment and allows user interaction and login), at which point the kernel goes idle unless called externally.
 
# The [[BIOS]] performs platform (rather than OS) specific startup tasks
# The BIOS loads and executes the partition boot code from the designated boot device, which contains phase 1 of a Linux boot loader. Phase 1 loads phase 2 (the bulk of the boot loader code). Some loaders may use an intermediate stage to achieve this (known as phase 1.5) since modern large disks may not be fully readable without further code.
# The boot loader loads the kernel, which decompresses into memory and sets up system functions such as essential hardware and memory paging, before calling <code>kernel_start ()</code>.
# Kernel_start then performs 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]].
# The scheduler effectively takes control of the system management, as the kernel goes idle.
# The Init process executes scripts as needed that set up all non-kernel services and structures in order to allow a user environment to be created, and then presents the user with a login screen.
 
On shutdown, Init is called to close down all user space functionality in a controlled manner, again via scripted directions, following which Init terminates and the Kernel executes its own shutdown.
 
==Boot Loader phase==
The boot loader phase varies by platform. Since the earlier phases are not specific to the OS, the boot process is considered to start:
* For [[X86 architecture|x86]] or [[x64]]: when the partition boot sector code is executed in [[real mode]] and loads the first stage [[boot loader]] (typically a part of [[LILO]] or [[GRUB]]).