UEFI Jungle

The UEFI Jungle

While writing LazarusOS, I first came across UEFI from an implementation standpoint. I am pretty sure everyone has dealt with UEFI at some point, especially during booting up a new OS. In the good old days, we had the choice between Legacy BIOS and UEFI, and during some of my earlier iterations of the project, I did write some BIOS bootloaders in assembly, but transitioning to UEFI was a whole new game.

The first thing which overwhelmed me were the plethora of terms like:

In this blog post, we try to debunk some of these terms and ELI5 some terminology which every OS developer is bound to run into at some point.

EFI/UEFI

The first question which came to my mind when beginning to research this topic was “What the hell is the difference between EFI and UEFI?”

EFI stands for Extensible Firmware Interface, while UEFI stands for Unified EFI. Turns out, for all intents and purposes, they are the same thing (more or less).

Quoting Intel:

The UEFI Specification was primarily intended for the next generation of IA architecture–based computers, and is an outgrowth of the “Intel® Boot Initiative” (IBI) program that began in 1998.

Intel’s original version of this specification was publicly named EFI, ending with the EFI 1.10 version.

In 2005, The Unified EFI Forum was formed as an industry-wide organization to promote adoption and continue the development of the EFI Specification. Using the EFI 1.10 Specification as the starting point, this industry group released the following specifications, renamed Unified EFI.

So, UEFI is just an upgraded version of EFI. However, there are some subtle differences between the two which I think are worth mentioning:

But, then again, what is UEFI exactly? We will borrow the definition from OSDev which describes it as follows:

(U)EFI or (Unified) Extensible Firmware Interface is a specification for x86, x86-64, ARM, and Itanium platforms that defines a software interface between the operating system and the platform firmware/BIOS.

Therefore, to put it simply, it is just a set of rules which any communication channels between the OS and the platform/firmware.

The interface consists of data tables that contain platform-related information, plus boot and runtime service calls that are available to the operating system and its loader. Together, these provide a standard environment for booting an operating system and running pre-boot applications.

UEFI PI

UEFI Platform Initialization (UEFI PI) is a set of specifications developed by the UEFI Forum.

It defines a standard interface between the platform firmware (UEFI firmware) and the operating system loader or kernel. The UEFI PI specification includes guidelines for implementing the platform initialization process, which is responsible for initializing various hardware components such as the processor, memory, and storage devices.

The supported architectures/interfaces are:

You can find the Platform Initialization (PI) Specification documentation here.

UEFI Forum

The Unified EFI Forum is the group responsible for developing, managing and promoting UEFI specifications.

The UEFI Forum was formed in 2005 to provide a platform for its members to collaborate and advance the UEFI specification. Its members include computer hardware manufacturers, firmware developers, operating system vendors, and other companies and organizations that are interested in promoting UEFI.

The specifications maintained by the UEFI Forum are:

All of these can be found listed here!

TIANOCORE

Tianocore

TianoCore is the community supporting an open source implementation of the Unified Extensible Firmware Interface (UEFI).

In June of 2004, Intel announced that it would release the “Foundation Code” of its Extensible Firmware Interface (EFI), a successor to the 16-bit x86 “legacy” PC BIOS, under an open source license. This Foundation Code, developed by Intel as part of a project code named Tiano, was Intel’s “preferred implementation” of EFI. This evolved into EDK, EDK II, and other open source projects under the TianoCore community.

The EFI Specifications were contributed to the United EFI Forum as part of the original UEFI Specifications, which has been adopted by over 200 companies and shipped on millions of compute devices. The UEFI Forum does not endorse any particular implementation, but TianoCore is designed to implement the UEFI and UEFI PI specifications.

EDK/EDK 2

EDK II is a modern, feature-rich, cross-platform firmware development environment for the UEFI and PI specifications. EDK II is open source, using a BSD+Patent.

The first EDK (EFI Developer Kit) was developed by Intel and released in 2002. It was designed to help developers create UEFI-based firmware and software.

Subsequently, Intel developed the next version of the EDK, known as EDK II, which was released in 2005. The EDK II was a major update to the original EDK and included significant changes and improvements. It is developed in C and maintained by the TianoCore community.

You can find out more about the EDK II here

References