Open-Source Internship opportunity by OpenGenus for programmers. Apply now.
Both UEFI and BIOS are firmware that specifies an interface between the computer operating system and the underlying firmware. Legacy boot involves booting the computer using legacy firmware such as BIOS and UEFI boot involves booting a computer using the more advanced UEFI.
Table of contents.
- Introduction.
- UEFI boot.
- Legacy boot.
- Differences between UEFI and Legacy boot mode.
- Switching the boot mode.
- Summary.
- References.
Prerequisites.
Introduction.
There are two ways we can boot a computer, UEFI is one of such methods to boot a computer, it is meant as a replacement for BIOS. This is because it addresses the current limitations of BIOS such as speed, security, and much more as we will see in this article.
With UEFI we get new advanced features such as secure boot, GUI, speed, performance.
Legacy booting involves booting a machine using BIOS firmware that is directly etched into the machine's hardware.
UEFI.
UEFI stands for Unified Extensible Firmware Interface, it specifies the interface between the OS and other firmware.
It provides a user-friendly graphical user interface where one can even use a mouse.
UEFI also offers security features such as a secure boot where unsigned drivers cannot load during bootup, this prevents malware from infecting anything during startup - the time when a system is most vulnerable.
Apart from such features, UEFI also supports Legacy BIOS booting.
During a UEFI boot, UEFI firmware maintains a list of boot volumes referred to as EFI service partitions(ESP). The POST process verifies that hardware is working properly after which the UEFI firmware scans for bootable devices from the GUID partitioning table GPT, i.e EFI partition.
This partition will have all information needed to start the OS including a boot loader therefore we don't need to pass control to a boot loader as in the case for BIOS.
Legacy boot.
In this type of booting, the machine uses BIOS firmware. During boot up, it performs the POST after which it finds the MBR which passes control to a boot loader such as GRUB whose function is to load the OS into memory for execution. If the boot loader doesn't find a partition to boot from, it continues to look for a boot device.
Differences between UEFI and Legacy boot modes.
The following are the differences between the two boot modes;
Language.
BIOS is written ins low-level assembly language code that is processor architecture-specific. This means that BIOS is platform-dependent.
UEFI is written in high or mid-level C programming code which is easier to work with, that is, one can add to the code to update or remove bugs easily without touching the hardware.
Security.
UEFI prioritizes security using the secure boot feature which prevents malware from infecting a computer during start-up since this is the most vulnerable a computer system is.
This is not the case for legacy boot.
Speed and performance.
UEFI boots faster and make the system performant compared to legacy boot. This can be seen from this video.
User interface.
There is also a difference in the user-friendliness of the two boot modes. UEFI is more user-friendly as it runs in 32-bit or 64-bit thereby allowing one to make actions using the keyboard and mouse.
With legacy boot mode runs in 16-bit therefore only keyboard actions are allowed.
Platform dependence/independence.
UEFI is platform-independent and therefore manufacturers don't have to concern themselves with a specific OS that might run on the computers.
Legacy boot involving BIOS is machine-dependent since its code is assembly and assembly code runs on specific processor architecture.
Partitioning scheme.
UEFI uses GUID Partitioning Table - GPT scheme while Legacy boot with BIOS uses Master Boot Record partitioning scheme.
Changing or updating.
To update UEFI firmware is very easy as we don't deal with hardware complexities while updating legacy BIOS is a very complex and sensitive task.
Switching boot mode.
Switching boot mode is not a difficult task, the steps are as follows.
- First we need to access the BIOS utility by pressing the specific keyboard keys for a specific machine common function keys are f12, f2, f10, or ESC during startup.
- Next, we navigate to the boot option in the top menu bar and select boot.
- A modal will appear with two options, named legacy and UEFI.
- Next we save the changes and exit.
Summary.
BIOS and UEFI provide an interface between the OS and other firmware.
BIOS firmware is hardcoded into the hardware and is written in low-level assembly code therefore to change or update it is a sensitive task. UEFI is firmware that can be changed since it is written in a high-level programming language and is not coded into the hardware.
Although we have given a lot of praise to UEFI, in some situations, booting using legacy is preferable for example, if we want to have dual-booting or when we have 2TB or less storage space.