What is a device boot?

Booting a device refers to the process of starting up a computer or electronic system. When a device boots, it goes from being powered off to becoming fully operational and ready to perform its functions. The boot process involves loading the device’s operating system and other essential software into memory so that the device can be used.

What happens during the boot process?

The exact boot process varies between different devices and operating systems, but there are some general stages that most systems go through:

  1. Power on – The device is switched on and power is supplied to the components.
  2. BIOS/UEFI initialization – The firmware initializes hardware components and does a power-on self-test.
  3. Boot loader – A small piece of code that loads the operating system kernel and starts the boot process.
  4. Operating system load – The operating system kernel and core drivers are loaded into memory.
  5. Initialization – Background services, daemons, and applications needed by the OS are started.
  6. Login prompt – The system is now ready for a user to log in and start using it.

The entire process from power on to login prompt may take anywhere from a few seconds to a minute or longer, depending on the system hardware and configuration.

BIOS/UEFI

When a computer first turns on, the Basic Input/Output System (BIOS) or Unified Extensible Firmware Interface (UEFI) firmware runs a power-on self test to check that hardware components like the CPU, RAM, and peripherals are functioning properly. It then looks for bootable devices like hard disks and optical drives, and loads a boot loader program from the boot device.

The main responsibilities of the BIOS/UEFI include:

  • Initializing, testing, and inventorying system hardware
  • Providing runtime services like power management and security
  • Locating bootable devices and booting to the installed OS

Newer UEFI systems offer improvements over BIOS like faster startup, secure boot to prevent malware, and support for larger hard drives. Most modern PCs use UEFI firmware instead of the legacy BIOS.

Bootloader

The boot loader is a small program that loads the operating system kernel into memory and executes it. It may give the user a chance to modify boot options or select alternate operating systems before continuing to load the OS.

Common boot loaders on PCs include:

  • GRUB (GNU GRand Unified Bootloader) – Used by Linux systems
  • NTLDR (NT Loader) – Earlier Windows versions
  • BOOTMGR (Boot Manager) – Modern Windows bootloader

For embedded systems and appliances, the boot loader may be custom code tailored to that hardware environment.

Operating system initialization

After the boot loader passes control to the operating system kernel, the kernel initializes hardware drivers and core OS components like the process scheduler and memory manager. It mounts the filesystems stored on hard disks and other media, loading their contents into memory. The kernel starts essential background services and daems needed for normal functioning of the OS.

At this stage, the system is considered booted, even though it may not be ready for interactive use. The boot process finishes when the system is prepared for a user to log in – for example, the desktop environment loads and the login screen appears.

Boot modes

Operating systems often support different boot modes that alter the boot process for special situations:

  • Normal boot – The standard boot process described above.
  • Safe mode – A minimal boot using just essential drivers and services to troubleshoot problems.
  • Recovery mode – Boots with options for system repair and recovery.
  • Single-user mode – Boots to a root shell prompt without loading the full OS.
  • Firmware UI – Stops to allow firmware configuration via BIOS/UEFI settings.

Boot modes are selected from the boot menu which can be accessed by pressing a function key like F12, F2, or F10 during the BIOS/UEFI initialization stage.

Boot failure

If the boot process fails due to issues like invalid boot devices, missing operating system files, or hardware faults, the system may display an error message and halt or restart to attempt booting again. Common boot errors include:

  • BOOTMGR missing – The Windows bootloader file is corrupted or missing.
  • Invalid partition table – The disk partition layout is erased or corrupted.
  • Operating system not found – No valid OS install was found on boot devices.
  • No bootable device – No bootable media like a hard disk or USB drive is installed.
  • Kernel panic – The OS kernel crashes during early boot.

Troubleshooting boot problems depends on identifying the exact point of failure and repairing underlying issues like faulty hardware, missing files, or configuration errors.

Boot process optimization

The boot experience can often be improved by optimizing the boot process. Common optimization techniques include:

  • Using a solid state drive rather than a hard disk, as SSDs have much faster access speeds.
  • Adding more RAM so less data needs to be loaded from slower storage.
  • Removing unnecessary programs or services that run at boot.
  • Cleaning the registry and files to avoid disk fragmentation.
  • Updating hardware drivers, BIOS/UEFI firmware, and software to newer versions.

Boot time can be measured with tools like Windows Performance Recorder or Bootchart for Linux. Optimizations can reduce boot time from over a minute to under 10 seconds for systems with fast hardware.

Boot devices

The boot device is the storage medium that contains the bootloader and operating system files required to boot the computer. The most common boot devices are:

  • Internal hard disks – The primary boot device in most computers. Stores operating systems, applications, and data.
  • Solid state drives – Faster than hard disks with no moving parts, but more expensive per gigabyte.
  • USB flash drives – Small portable drives that can boot many operating systems.
  • Optical discs – CD, DVD and Blu-Ray discs can boot if made bootable.
  • Network adapters – Allow booting from a network server over PXE or iSCSI.

The boot order is configured in BIOS/UEFI setup to determine the boot device priority. The bootloader attempts to boot from devices in order until an operating system is found.

Booting from external devices

Booting from removable media or external devices allows things like:

  • Booting multiple operating systems on one PC.
  • Booting and troubleshooting when the installed OS fails.
  • Booting without modifying installed hard disks.
  • Booting portable operating systems from any computer.

Bootable external devices need to contain a bootloader and OS files in supported formats like ISO images. Flash drives with bootable Linux distros, Windows PE recovery environments, and bootable antivirus scans are commonly used for IT support tasks.

Network booting

Network booting starts the client computer using a boot image loaded from a server instead of a local drive. Two common methods are:

  • PXE – Clients boot using the Preboot eXecution Environment protocol, which uses DHCP and TFTP to access boot files on the server.
  • iSCSI – Internet SCSI disks on the server are mounted by the client during boot to load the OS.

Benefits of network booting include centralized management, easier OS deployment, and the ability to boot systems without local drives. It requires PXE client firmware support and boot images configured on a DHCP/TFTP server.

Trusted Platform Module (TPM) & Secure Boot

For greater security, modern PCs include a TPM chip that stores encryption keys. The UEFI Secure Boot feature uses the TPM to validate bootloaders and OS kernels by their digital signatures before booting them. This protects against malware tampering with boot code.

TPM and Secure Boot prevent unauthorized access to the system by only allowing validated boot software to run. Enterprise policies can fully manage Secure Boot keys for company-issued devices.

Boot Process in Windows

The Windows boot process typically includes these stages:

  1. BIOS/UEFI initialization
  2. Select boot device
  3. NTLDR or BOOTMGR (Windows bootloader) starts
  4. bootmgr.exe loads Windows Boot Manager
  5. winload.exe loads the Windows kernel (ntoskrnl.exe)
  6. Kernel initializes device drivers and OS core
  7. Services.exe starts system services
  8. LogonUI.exe launches login screen
  9. Explorer.exe starts desktop and explorer shell

The boot files are located in the C:\Boot folder and system partition. When troubleshooting, Advanced Startup Options can be used to boot into safe mode or recovery environments.

Boot Process in Linux

A typical Linux boot process:

  1. BIOS/UEFI POST checks hardware
  2. Bootloader (GRUB) loads Linux kernel into memory
  3. Kernel initializes hardware drivers and data structures
  4. Initial RAM disk (initrd) mounts root filesystem
  5. Kernel launches init process (systemd/SystemV)
  6. Init starts services via runlevels and targets
  7. Display manager presents graphical login screen
  8. Login to desktop environment shell (GNOME, KDE, etc)

The Linux kernel (vmlinuz) and initrd files are located under /boot. Boot options can be passed via the GRUB menu for troubleshooting.

Boot Process in macOS

How macOS boots:

  1. Hardware power-on self tests by EFI firmware
  2. boot.efi UEFI boot loader executes
  3. boot.efi starts I/O Kit kernel extensions for hardware
  4. boot.efi hands off to bootx64.efi bootloader
  5. bootx64.efi loads Darwin kernel and kexts into memory
  6. Kernel initializes hardware and core OS components
  7. launchd process created to manage system startup
  8. SystemStarter initializes graphical interface
  9. loginwindow presents the OS X login screen

Holding option key during boot allows selecting macOS install partitions or recovery modes.

Embedded System Boot Process

Embedded devices like smart TVs, IoT systems, and routers have a simplified boot process optimized for their specialized hardware environment:

  1. Boot ROM runs power-on tests and initializes CPU and hardware
  2. Bootloader copied from flash storage to RAM
  3. Bootloader locates OS kernel image in flash/storage
  4. Decompressed kernel loaded into RAM
  5. Kernel mounts root filesystem from flash memory
  6. Kernel launches init process to set up services
  7. Application runtime environment loads graphical UI/console

Some devices dispense with loading an OS and applications and boot directly into their runtime code. The bootloader may allow firmware updates via USB or network.

Conclusion

In summary, the boot process loads a device from an unpowered state into an initialized system running essential software like an OS kernel. The main stages include running POST tests, loading boot software like bootloaders, initializing hardware, and launching essential system services and applications.

Boot problems can be tricky to troubleshoot, but often point to issues like corrupt boot files, misconfigured BIOS/UEFI, bad sectors on a hard disk, or failing hardware components. Optimizing the boot sequence and upgrading to faster hardware like SSDs can greatly improve startup speed.