Unix - UNIX Boot Process Explained Step by Step

 

The UNIX boot process is the sequence of operations that starts when the system is powered on and ends when the user gets a login prompt. This process ensures that hardware, kernel, and system services are properly initialized before user interaction.

The first stage begins with BIOS or UEFI, which performs hardware checks known as POST (Power On Self Test). It initializes essential hardware components and then locates a bootable device based on the boot order configuration.

The second stage involves the bootloader, commonly GRUB. The bootloader loads the UNIX kernel into memory and passes required parameters to it. It may also allow the user to select different kernels or operating systems.

Once loaded, the kernel takes control of the system. It initializes memory management, CPU scheduling, device drivers, and mounts the root filesystem in read-only mode. At this stage, the kernel prepares the system environment.

After kernel initialization, the first user-space process is started. Traditionally this is init, but modern systems use systemd. This process always has PID 1 and is responsible for starting all other system services.

The system then enters a specific runlevel or target, which defines the system state, such as single-user mode, multi-user mode, or graphical mode. Required services like networking and logging are started accordingly.

Finally, login services are launched, and the user is presented with a login prompt or graphical interface. Once authenticated, the user shell starts, marking the completion of the boot process.