Purpose of the UEFI System Table Pointer
Every standard Unified Extensible Firmware Interface (UEFI)
image—whether an application, driver, or OS bootloader—receives a
pointer to the EFI_SYSTEM_TABLE upon entry. This article
explains the fundamental purpose of this pointer, detailing how it
serves as the primary gateway for firmware communication, provides
direct access to critical boot and runtime services, exposes standard
console input/output interfaces, and links the executable to essential
system configuration tables such as ACPI and SMBIOS.
The UEFI Entry Point Signature
In standard C development for UEFI, an entry point function (commonly
named UefiMain or EfiMain) has the following
prototype:
EFI_STATUS
EFIAPI
UefiMain (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
);While the ImageHandle identifies the loaded binary
itself, the SystemTable pointer provides the context of the
platform firmware. Because UEFI executes in a flat physical memory
address space without a pre-existing operating system kernel, the
application has no standard library or OS runtime loaded by default. The
EFI_SYSTEM_TABLE fills this void by acting as the
foundational data structure through which the application discovers and
invokes all platform capabilities.
Core Roles of the System Table Pointer
1. Access to Boot
Services (EFI_BOOT_SERVICES)
The BootServices field in the System Table points to a
table of function pointers available strictly while firmware owns the
platform. Through this interface, the application can:
- Allocate and Free Memory: Utilize functions like
AllocatePages,AllocatePool, andFreePoolto manage physical RAM. - Locate Protocols: Query interfaces exposed by other
drivers using functions such as
LocateProtocolandOpenProtocol. - Handle Events and Timers: Create asynchronous events, register callbacks, and set timers.
- Image Management: Load, start, and unload other UEFI drivers or OS kernels.
Boot services remain available until the operating system loader
calls ExitBootServices().
2. Access to
Runtime Services (EFI_RUNTIME_SERVICES)
The RuntimeServices field provides access to platform
services that persist even after the operating system takes control of
the hardware. Crucial capabilities include:
- Non-Volatile Variables: Reading and writing UEFI
environment variables (
GetVariable,SetVariable) stored in NVRAM. - Real-Time Clock: Querying and configuring the
hardware clock (
GetTime,SetTime). - System State: Programmatically rebooting or
shutting down the machine (
ResetSystem).
3. Standard Console Input and Output
The System Table contains direct interfaces for interacting with the console before any complex display drivers are initialized:
ConIn: Points to anEFI_SIMPLE_TEXT_INPUT_PROTOCOLfor reading keystrokes.ConOut: Points to anEFI_SIMPLE_TEXT_OUTPUT_PROTOCOLfor printing text to the primary output device.StdErr: Points to anEFI_SIMPLE_TEXT_OUTPUT_PROTOCOLreserved for error reporting.
4. System Configuration Tables
The System Table contains an array of
EFI_CONFIGURATION_TABLE structures along with a count
(NumberOfTableEntries). These structures map GUIDs to
pointers of industry-standard configuration tables, including:
- Advanced Configuration and Power Interface (ACPI) tables.
- System Management BIOS (SMBIOS) tables.
- Device Tree (flattened device tree / FDT) pointers on ARM systems.
Operating system bootloaders read these tables directly from the System Table to pass foundational platform metadata to the OS kernel.
5. Firmware Metadata and Integrity
The structure begins with an EFI_TABLE_HEADER that
includes a 32-bit CRC checksum, ensuring the integrity of the function
table. It also exposes the firmware vendor name
(FirmwareVendor) and revision number
(FirmwareRevision), allowing images to implement
platform-specific workarounds if necessary.
Summary
The SystemTable pointer is the central anchor of the
UEFI programming model. Without it, a loaded UEFI binary exists in an
isolated execution state with no access to memory management, I/O
devices, hardware discovery mechanisms, or platform services. By passing
this pointer at entry, the UEFI specification ensures a uniform,
hardware-agnostic method for software to interact with system
firmware.