How Operating Systems Report Errors to UEFI
Operating systems report hardware errors back to the platform firmware through standardized interfaces defined by the ACPI and UEFI specifications. When a catastrophic or correctable hardware fault occurs, the OS formats the diagnostics into Common Platform Error Records (CPER) and writes them to persistent storage via the ACPI Error Record Serialization Table (ERST). This process ensures that hardware diagnostic logs persist across unexpected reboots, system crashes, and power cycles, allowing UEFI firmware and platform management controllers to inspect and handle faults during subsequent boots.
The APEI Architecture
The primary mechanism enabling OS-to-firmware error reporting is the ACPI Platform Error Interfaces (APEI). APEI provides a unified architecture for error handling between the operating system, the system hardware, and platform firmware. Within APEI, error data is standardized into the Common Platform Error Record (CPER) format, defined by Appendix N of the UEFI Specification. CPER encapsulates diverse hardware errors—such as processor Machine Check Exceptions (MCEs), PCIe Advanced Error Reporting (AER) events, and memory ECC errors—into a uniform data structure containing unique identifiers, error severity levels, and hardware-specific payloads.
Persisting Logs via the ERST Interface
When an operating system detects or processes a hardware error that must be preserved for platform-level analysis, it uses the Error Record Serialization Table (ERST).
- Table Discovery: During boot, the OS parses ACPI tables exposed by the UEFI firmware to locate the ERST.
- Operation Definition: The ERST does not directly expose raw flash storage; instead, it defines an abstract, register-based interface. It provides an instruction set (such as read register, write register, and check status) that the OS executes to perform low-level read, write, and clear operations on platform non-volatile storage.
- Execution: When logging an error, the OS packages the event into a CPER record, prepares the serialized payload, and executes the sequence of actions defined in the ERST to commit the data directly to NVRAM, SPI flash, or a dedicated baseboard management controller (BMC) repository.
Boot-Time Retrieval and BERT
Once written to persistent storage via the ERST, the UEFI platform firmware can retrieve the error data on the next initialization phase. If an uncorrectable error resulted in a system reset, the platform firmware extracts the stored CPER record during the pre-boot phase.
Firmware can evaluate these records to take preventive actions, such as mapping out faulty memory regions or disabling unstable PCIe devices. Additionally, the firmware can present these records back to the OS on the subsequent clean boot using the Boot Error Record Table (BERT), completing a closed-loop diagnostic lifecycle between the OS and the UEFI platform.