Unified Extensible Firmware Interface

The Unified Extensible Firmware Interface (UEFI)Pronounced as an acronym or as . is in the boot sequence before the operating system and after the firmware. UEFI replaces the legacy BIOS firmware interface found in all IBM computers. Most UEFI implementations are backwards-compatible to the legacy BIOS. UEFI supports remote diagnostics and repairing of computers, even when there isn't an operating system.

Intel made the Extensible Firmware Interface (EFI). Some of the EFI's usage and formats mimic those of Windows.IBM PC Real Time Clock should run in UT. Cl.cam.ac.uk. Retrieved on 30 October 2013. In 2005, EFI 1.10 (the final release) was deprecated.

 History 

Creation
The motivation for EFI came during early development of the first Intel–HP Itanium systems in the mid-1990s. Limitations had become too restrictive for the server platforms Itanium was looking for. The effort to address these restrictions began in 1998 and was first called the Intel Boot Initiative. It was renamed to Extensible Firmware Interface (EFI).

In July 2005, Intel stopped its development of the EFI specification at version 1.10, and gave it to the Unified EFI Forum, which has developed the specification as the Unified Extensible Firmware Interface (UEFI). The original EFI specification remains owned by Intel, which exclusively provides licenses for EFI-based products, but the UEFI specification is owned by the UEFI Forum.
Versions
Version 2.0 of UEFI was released on 31 January 2006. It added cryptography and security.

Version 2.1 of UEFI was released on 7 January 2007. It added network authentication and the user interface architecture.

The latest UEFI specification, version 2.9, was released in March 2021.
Open source
The first open source UEFI implementation, Tiano, was released by Intel in 2004. Tiano has since then been succeeded by EDK and EDK2 and is now maintained by the TianoCore community.

 Advantages 
UEFI firmware provides several technical advantages over a traditional BIOS system:

 Being able to boot a disk containing large partitions (over 2 TB) with a GUID Partition Table (GPT)
 Flexible pre-OS environment, including network capabilities, a GUI, and multi language support
 32-bit (for example IA-32) or 64-bit (for example x64) pre-OS environment
 C language programming
 Modular design
 Backward and forward compatibility with the Legacy BIOS

 Features 

 Services 

 Graphics Output Protocol (GOP) services 
 The Graphics Output Protocol (GOP) gives runtime services; see also Graphics features below. The operating system is allowed to write to the framebuffer provided by GOP during runtime mode.

 Variable services 
 UEFI variables provide a way to store data, in particular non-volatile data. Some UEFI variables are shared between platform firmware and operating systems. Variable namespaces are identified by GUIDs, and variables are key/value pairs.  UEFI variables can be used to keep crash messages in NVRAM after a crash for the operating system to get after a reboot.

 Time services 
 UEFI provides time services. Time services include support for someone's time zone and daylight saving fields, which allow the hardware's real-time clock to be set to local time or UTC.UEFI specification, section 7.3 On machines using a PC-AT real-time clock, by default the hardware clock still has to be set to local time for compatibility with BIOS-based Windows, unless using recent versions and an entry in the Windows registry is set to indicate the use of UTC.

 Applications 

Beyond loading an OS, UEFI can run UEFI applications, which stay as files on the EFI System Partition. They can be executed from the UEFI Shell, by the firmware's boot manager, or by other UEFI apps. UEFI apps can be developed and installed independently of the original equipment manufacturers (OEMs).

A type of UEFI application is an OS boot loader such as GRUB, rEFInd, Gummiboot, and Windows Boot Manager; which loads some OS files into memory and executes them. Also, an OS boot loader can provide a user interface to allow the selection of another UEFI application to run. Utilities like the UEFI Shell are also UEFI applications.

 Protocols 
EFI defines protocols as a set of software interfaces used for communication between two binary modules. All EFI drivers must provide services to others via protocols. The EFI Protocols are similar to the BIOS interrupt calls.

 Graphics features 
The EFI 1.0 specification defined a Universal Graphic Adapter) protocol as a way to support graphics features. UEFI did not include it and replaced it with GOP (Graphics Output Protocol).

UEFI 2.1 defined a "Human Interface Infrastructure" to manage user input, localized strings, fonts, and forms (in the HTML sense). These enable original equipment manufacturers (OEMs) or independent BIOS vendors (IBVs) to design graphical interfaces for pre-boot configuration.

Most early UEFI firmware implementations were console-based. Today many UEFI firmware implementations are GUI-based.

 Boot stages 
SEC – Security Phase is the first stage of the UEFI boot but may have platform specific code. It is built as code written in assembly language for the specific architecture. It initializes temporary memory (often CPU cache as RAM) and serves as the system's software root of trust.

PEI – Pre-EFI Initialization. This second stage of UEFI contains a dependency-aware dispatcher that loads and runs PEI modules to handle hardware tasks such as main memory initialization and firmware recovery operations. It's also responsible for the discovery of the boot mode and handling many ACPI S0ix/ACPI S3 operations. In the case of ACPI S0ix/ACPI S3 resume, it is responsible for restoring many hardware registers to a pre-sleep state. PEI also uses CPU cache as RAM.

DXE – Driver Execution Environment is made of C modules and a dependency-aware dispatcher. With main memory now available, CPU, chipset, mainboard and boot devices are initialized in DXE and BDS.

BDS – Boot Device Select  is a part of the DXE. In this stage, boot devices are initialized, UEFI drivers or Option ROMs of PCI devices are executed according to system configuration, and boot options are processed.

TSL – Transient System Load  is the stage between boot device selection and hand-off to the OS. At this point one may enter UEFI shell, or execute an UEFI application such as the OS boot loader.

RT – Runtime - The UEFI hands off to the operating system (OS) after  is executed. A UEFI compatible OS is now responsible for exiting boot services triggering the firmware to unload all no longer needed code and data, leaving only runtime services code/data, e.g. SMM and ACPI. A typical modern OS will prefer to use its own programs (such as kernel drivers) to control hardware devices.

When a legacy OS is used, CSM will handle this call making sure that the system is compatible with legacy BIOS expectations.

 Criticism 
Many digital rights activists have protested against UEFI. Some experts have blamed UEFI as an attempt to remove the ability of the user to control the computer. It does not solve the BIOS's long-standing problems of requiring two different drivers—one for the firmware and one for the operating system—for most hardware.

Open-source project TianoCore also provides UEFI interfaces. TianoCore doesn't have the specialized drivers that initialize functions, which are instead provided by coreboot, of which TianoCore is one of many payload options. The development of coreboot requires cooperation from CPU manufacturers to provide the specifications needed to develop initialization drivers.

 Secure Boot 

In 2011, Microsoft announced that computers certified to run its Windows 8 operating system had to release with Microsoft's public key enrolled and Secure Boot enabled. Following the announcement, Microsoft was accused by critics and free software/open source advocates (including the Free Software Foundation) of trying to use the Secure Boot functionality of UEFI to prevent the installation of alternative operating systems such as Linux. Microsoft denied that the Secure Boot requirement was intended to serve as a form of lock-in. They also clarified its requirements by stating that 32-bit-based systems certified for Windows 8 must allow Secure Boot to enter custom mode or be disabled, but not on systems using the ARM architecture. Windows 10 allows OEMs to decide whether or not Secure Boot can be changed by users of their 32-bit systems.
Concerns
Other developers concerned about the issues of implementing support for Secure Boot on Linux systems in general. Former Red Hat developer Matthew Garrett noted that conditions in the GNU General Public License version 3 may prevent the use of the GNU GRand Unified Bootloader without a distribution's developer disclosing the private key (however, the Free Software Foundation has since clarified its position, assuring that the responsibility to make keys available was held by the hardware manufacturer), and that it would also be difficult for advanced users to build custom kernels that could function with Secure Boot enabled without self-signing them. Other developers suggested that signed builds of Linux with another key could be provided, but noted that it would be difficult to persuade OEMs to ship their computers with the required key alongside the Microsoft key.
Disputes
It has been disputed whether the operating system kernel and its modules must be signed as well; while the UEFI specifications do not require it, Microsoft has asserted that their contractual requirements do, and that it reserves the right to revoke any certificates used to sign code that can be used to compromise the security of the system. In Windows, only the WHQL kernel driver is allowed if Secure Boot is enabled. In February 2013, another Red Hat developer attempted to submit a patch to the Linux kernel that would allow it to parse Microsoft's authenticode signing using a master X.509 key embedded in PE files signed by Microsoft. However, the proposal was criticized by Linux creator Linus Torvalds, who attacked Red Hat for supporting Microsoft's control over the Secure Boot infrastructure.

 Notes 

 References 

 Further reading 








 Other websites 


 UEFI Specifications
 Intel-sponsored open-source EFI Framework initiative
 Intel EFI/UEFI portal
 Microsoft UEFI Support and Requirements for Windows Operating Systems
 How Windows 8 Hybrid Shutdown / Fast Boot feature works
 Securing the Windows 10 Boot Process
 LoJax: First UEFI rootkit found in the wild, courtesy of the Sednit group
Category:Computing