Vincent Zimmer is a Principal Engineer in the Software and Solutions Group at Intel Corporation. Vincent was awarded an Intel Achievement Award for his development of the EFI Framework Architecture. Michael Rothman is a Senior Staff Engineer in the Software and Solutions Group at Intel. Robert Hale is a Principal Engineer in the Desktop Enterprise Group at Intel. This article was excerpted from their book Beyond BIOS: Implementing the Unified Extensible Firmware Interface with Intel's Framework. Copyright (c) 2006 Intel Corporation. All rights reserved.
I believe in standards. Everyone should have one.
--George Morrow
The Extensible Firmware Interface (EFI) describes a programmatic interface to the platform. The platform includes the motherboard, chipset, central processing unit (CPU), and other components. EFI allows for pre-operating system (pre-OS) agents. Pre-OS agents are OS loaders, diagnostics, and other applications that the system needs for applications to execute and interoperate, including EFI drivers and applications. EFI represents a pure interface specification against which the drivers and applications interact, and this chapter highlights some of the architectural aspects of the interface. These architectural aspects include a set of objects and interfaces described by the EFI Specification.
The cornerstones for understanding EFI applications and drivers are several EFI concepts that are defined in the EFI 1.1 Specification. Assuming you are new to EFI, the following introduction explains a few of the key EFI concepts in a helpful framework to keep in mind as you study the specification:
- Objects managed by EFI-based firmware. Used to manage system state, including I/O devices, memory, and events.
- The EFI System Table. The primary data structure with data information tables and function calls to interface with the systems.
- Handle database and protocols. The means by which callable interfaces are registered.
- EFI images. The executable content format by which code is deployed.
- Events. The means by which software can be signaled in response to some other activity
- Device paths. A data structure that describes the hardware location of an entity, such as the bus, spindle, partition, and file name of an EFI image on a formatted disk.
Objects Managed by EFI-based Firmware
Several different types of objects can be managed through the services provided by EFI. Some EFI drivers may need to access environment variables, but most do not. Rarely do EFI drivers require the use of a monotonic counter, watchdog timer, or real-time clock. The EFI System Table is the most important data structure, because it provides access to all EFI-provided the services and to all the additional data structures that describe the configuration of the platform.
EFI System Table
The EFI System Table is the most important data structure in EFI. A pointer to the EFI System Table is passed into each driver and application as part of its entry-point handoff. From this one data structure, an EFI executable image can gain access to system configuration information and a rich collection of EFI services that includes the following:
- EFI Boot Services.
- EFI Runtime Services.
- Protocol services.
The EFI Boot Services and EFI Runtime Services are accessed through the EFI Boot Services Table and the EFI Runtime Services Table, respectively. Both of these tables are data fields in the EFI System Table. The number and type of services that each table makes available is fixed for each revision of the EFI specification. The EFI Boot Services and EFI Runtime Services are defined in the EFI 1.10 Specification. Chapter 4 of the EFI 1.10 Specification describes the common uses that EFI drivers make of these services.
Protocol services are groups of related functions and data fields that are named by a Globally Unique Identifier (GUID), a 16-bit, statistically-unique entity defined in Appendix A of the EFI 1.10 Specification. Typically, protocol services are used to provide software abstractions for devices such as consoles, disks, and networks, but they can be used to extend the number of generic services that are available in the platform. Protocols are the mechanism for extending the functionality of EFI firmware over time. The EFI 1.10 Specification defines over 30 different protocols, and various implementations of EFI firmware and EFI drivers may produce additional protocols to extend the functionality of a platform.