System startup and shutdown
System Startup:
1. Bootloader:
The boot process begins with the BIOS (Basic Input/Output System) or UEFI (Unified Extensible Firmware Interface) firmware, depending on your system. These firmware interfaces initiate the bootloader, which is responsible for loading the operating system into memory.
Common bootloaders include GRUB (Grand Unified Bootloader) for Linux systems and NTLDR (New Technology Loader) for Windows systems.
2. Kernel Initialization:
Once the bootloader loads the operating system's kernel into memory, the kernel takes control. It initializes essential hardware components, sets up memory management, and establishes the system's initial state.
3. Init or Systemd (Linux):
On Linux systems, after the kernel initializes, either the traditional init
process or systemd
(a more modern init system) is started. These init systems initialize system services and user-space processes based on configuration files like /etc/inittab
or service unit files.
4. Runlevel or Target:
In Linux, the system can be in a specific runlevel (SysVinit) or target state (systemd) that determines which services and processes are started. Runlevels/targets define the system's operational mode, such as single-user mode, multi-user mode, or graphical mode.
5. Service Initialization:
System services and daemons are started, including networking, disk management, user authentication, and more. These services ensure the system is fully operational for user interaction.
6. User Login:
Once the system reaches an appropriate runlevel or target, it presents the user with a login prompt, allowing users to log in and start their sessions.