How does the process of loading the Linux operating system occur?
sobes.tech AI
Answer from AI
-
BIOS/UEFI: Hardware initialization, peripheral check, boot device selection.
-
MBR/GPT: Reading the contents of the Master Boot Record (MBR) or GUID Partition Table (GPT) from the boot device.
-
Bootloader (GRUB, LILO): Loading the bootloader. Displaying the boot menu (if available), selecting the kernel and initial ramdisk.
-
Kernel: Loading the operating system kernel into memory. Hardware initialization, mounting the root filesystem.
-
Initial Ramdisk (initrd/initramfs): Loading a temporary root filesystem into memory. Executing scripts to detect hardware and prepare for mounting the real root filesystem.
-
Root Filesystem: Mounting the real root filesystem specified in kernel parameters or initrd/initramfs.
-
Init System (SysVinit, systemd): Starting the init system. systemd is more modern and widely used.
- SysVinit: Starting services based on runlevels.
- systemd: Starting services in parallel based on units (services, targets, etc.).
# Example systemd unit [Unit] Description=My Application Service After=network.target [Service] ExecStart=/usr/local/bin/my-app Restart=on-failure [Install] WantedBy=multi-user.target -
Runlevel/Target: Transition to the appropriate runlevel (SysVinit) or target state (systemd), starting necessary services (network services, graphical shell, etc.).
-
Login Prompt/Display Manager: Starting the login shell (terminal) or graphical login manager (GDM, LightDM, etc.).
-
User Login: User logs into the system. User session is started.