Get a Pentest and security assessment of your IT network.

Cyber Security

BIOS/UEFI & OS Code Changes

TL;DR

Yes, BIOS/UEFI can change OS code, but it’s complex and usually involves pre-boot or low-level access. It’s not a typical operating system update process. Direct modification is rare and risky; more common are secure boot features that control which OS code runs.

Understanding BIOS/UEFI

BIOS (Basic Input/Output System) was the traditional firmware, but UEFI (Unified Extensible Firmware Interface) has largely replaced it. Both act as an intermediary between your hardware and operating system. They handle initial boot processes, hardware setup, and provide a low-level environment before the OS takes over.

How BIOS/UEFI Can Affect OS Code

  1. Boot Order & Bootloaders: The most common way BIOS/UEFI affects the OS is by controlling which device to boot from (hard drive, USB, network). It loads a bootloader – a small program that then starts the operating system. Changing the boot order doesn’t change the OS code itself, but it determines what code *is* loaded.
    # Example: Setting boot order in UEFI setup (varies by manufacturer)
  2. Secure Boot: This is a crucial security feature. It verifies the digital signature of the OS kernel and other critical components before allowing them to run. If the signatures don’t match trusted keys, the OS won’t boot.
    • Enabling Secure Boot prevents unsigned or modified OS code from running.
    • You can manage trusted keys in the UEFI settings.
  3. UEFI Applications & Drivers: UEFI allows you to run applications directly within the firmware environment. These apps can, theoretically, modify boot files or other low-level data used by the OS.
    # Example: Listing UEFI applications (Linux)
    sudo efibootmgr -v
  4. Direct Firmware Updates: Some manufacturers provide firmware updates that include changes to boot processes or low-level hardware initialization. These updates can indirectly affect how the OS loads and runs.
  5. Malware & Rootkits (Rare): In rare cases, sophisticated malware can compromise the BIOS/UEFI itself to inject malicious code into the boot process before the OS even starts. This is very difficult to detect and remove.
    • This requires a deep understanding of firmware programming.
    • Regularly check for and install UEFI updates from your manufacturer.

Can You Directly Modify OS Code Through BIOS/UEFI?

Generally, no – not easily or safely. The OS code resides on the hard drive (or other storage) and is loaded by the bootloader. Direct modification would require:

  1. Access to the UEFI Shell: This provides a command-line interface within the firmware.
  2. Understanding of EFI File System: The OS files are stored in a specific format on the ESP (EFI System Partition).
  3. Knowledge of Assembly Language & OS Internals: You’d need to know how to modify executable code and understand the OS boot process.
  4. Disabling Secure Boot: This is usually required, which significantly reduces security.

Attempting this without proper knowledge can render your system unbootable.

Practical Scenarios

  • Dual-Boot Setup: BIOS/UEFI allows you to configure multiple boot entries for different operating systems.
  • Troubleshooting Boot Issues: You might need to adjust the boot order or disable Secure Boot temporarily to fix a problem.
  • Installing Linux Distributions: Some distributions require specific UEFI settings (e.g., enabling CSM – Compatibility Support Module).
Related posts
Cyber Security

Zip Codes & PII: Are They Personal Data?

Cyber Security

Zero-Day Vulnerabilities: User Defence Guide

Cyber Security

Zero Knowledge Voting with Trusted Server

Cyber Security

ZeroNet: 51% Attack Risks & Mitigation