Advanced Configuration and Power Interface
|This article needs additional citations for verification. (July 2010)|
First released in December 1996, ACPI defines platform-independent interfaces for hardware discovery, configuration, power management and monitoring. With the intention of replacing Advanced Power Management, the MultiProcessor Specification and the Plug and Play BIOS Specification, the standard brings power management under the control of the operating system, as opposed to the previous BIOS-central system which relied on platform-specific firmware to determine power management and configuration policy. The specification is central to Operating System-directed configuration and Power Management (OSPM), a system implementing ACPI which removes device management responsibilities from legacy firmware interfaces.
The standard was originally developed by Intel, Microsoft and Toshiba, and was later joined by HP and Phoenix. The latest version is "Revision 5.0", which was published on 6 December 2011. As the ACPI technology gained wider adoption with many operating systems and processor architectures, the desire to improve the governance model of the specification has increased significantly. In October 2013, original developers of the ACPI standard agreed to transfer all assets to the UEFI Forum, where all future development will be taking place.
- 1 Architecture
- 2 History
- 3 Operating systems
- 4 OSPM responsibilities
- 5 Hardware interface
- 6 Firmware interface
- 7 ACPI Platform Error Interface (APEI)
- 8 See also
- 9 References
- 10 External links
The firmware-level ACPI has three main components: the ACPI tables, the ACPI BIOS and the ACPI registers. Unlike its predecessors, like the APM or PnP BIOS, the ACPI implements little of its functionality in the ACPI BIOS code, whose main role is to load the ACPI tables in system memory. Instead, most of the firmware ACPI functionality is provided in ACPI Machine Language (AML) bytecode stored in the ACPI tables. To make use of these tables, the operating system must have an interpreter for the AML bytecode. A reference AML interpreter implementation is provided by the ACPI Component Architecture (ACPICA). At the BIOS development time, AML code is compiled from the ASL (ACPI Source Language) code.
As ACPI also replaces PnP BIOS, it also provides a hardware enumerator, mostly implemented in the DSDT (Differentiated System Description Table) ACPI table. The advantage of a bytecode approach is that unlike PnP BIOS code (which was 16-bit), the ACPI bytecode may be used in any operating system, even in 64-bit long mode. This design decision was not without criticism. In November 2003, Linus Torvalds, initial creator of the Linux kernel, described ACPI as "a complete design disaster in every way". In 2001, other senior Linux software developers like Alan Cox expressed concerns about the requirements that bytecode from an external source must be run by the kernel with full privileges, as well as the overall complexity of the ACPI specification.
ACPI Component Architecture (ACPICA)
The ACPI Component Architecture (ACPICA) provides an open-source OS-independent reference implementation of the OS-related ACPI code; it is mainly written by Intel's engineers. The ACPICA code is used by Linux and FreeBSD, which supplement it with their OS-specific code.
The first revision of the ACPI specification was released in December 1996, supporting 16 and 32-bit addressing spaces. It was not until August 2000 that ACPI received 64-bit address support as well as support for multiprocessor workstations and servers with revision 2.0. In September 2004, revision 3.0 gave the ACPI specification support for SATA connectors, PCI Express bus, >256 multiprocessor support, ambient light sensors and user-presence devices, as well as extending the Thermal model beyond the previous processor-centric support. In June 2009, the 4.0 specification added many new features to the design; most notable are USB 3.0 support, logical processor idling support, and x2APIC support. The latest of the major publications is revision 5.0, released in November 2011.
Microsoft's Windows 98 was the first operating system to implement ACPI, but its implementation was somewhat buggy or incomplete, although some of the problems associated with it were caused by the first-generation ACPI hardware. Other operating systems, including later versions of Windows, eComStation, FreeBSD, NetBSD, OpenBSD, HP-UX, OpenVMS, Linux, and PC versions of SunOS, have at least some support for ACPI. Some newer operating systems like Windows Vista require ACPI-compliant BIOS to work at all; actually, Vista requires a BIOS with ACPI 2.0 or later.
The 2.4 series of the Linux kernel had only minimal support for ACPI, with better support implemented (and enabled by default) from kernel version 2.6.0 onwards. Old ACPI BIOS implementations tend to be quite buggy, and consequently are not supported by later operating systems. For example, Windows 2000, Windows XP, and Windows Server 2003 only use ACPI if the BIOS date is after January 1, 1999. Similarly, Linux kernel 2.6 blacklisted any ACPI BIOS from before January 1, 2001.
Once an OSPM-compatible operating system activates ACPI, it takes over and has exclusive control of all aspects of power management and device configuration. The OSPM implementation must expose an ACPI-compatible environment to device drivers, which exposes certain system, device and processor states.
- G0 (S0), Working: "Awaymode" is a subset of S0, where monitor is off but background tasks are running.
- G1, Sleeping: Divided into four states, S1 through S4:
- S1, Power on Suspend (POS): All the processor caches are flushed, and the CPU(s) stops executing instructions. The power to the CPU(s) and RAM is maintained. Devices that do not indicate they must remain on, may be powered off.
- S2: CPU powered off. Dirty cache is flushed to RAM.
- S3, commonly referred to as Standby, Sleep, or Suspend to RAM (STR): RAM remains powered.
- S4, Hibernation or Suspend to Disk: All content of the main memory is saved to non-volatile memory such as a hard drive, and is powered down.
- G2 (S5), Soft Off: G2/S5 is almost the same as G3 Mechanical Off, except that the power supply unit (PSU) still supplies power, at a minimum, to the power button to allow return to S0. A full reboot is required. No previous content is retained. Other components may remain powered so the computer can "wake" on input from the keyboard, clock, modem, LAN, or USB device.
- G3, Mechanical Off: The computer's power has been totally removed via a mechanical switch (as on the rear of a PSU). The power cord can be removed and the system is safe for disassembly (typically, only the real-time clock continues to run - using its own small battery).
Furthermore, the specification defines a Legacy state: the state on an operating system which does not support ACPI. In this state, the hardware and power are not managed via ACPI, effectively disabling ACPI.
The device states D0–D3 are device-dependent:
- D0 Fully On is the operating state.
- D1 and D2 are intermediate power-states whose definition varies by device.
- D3 Off has the device powered off and unresponsive to its bus.
- D3 Hot & Cold: The D3 state is further divided into D3 Hot (has aux power), and D3 Cold (no power provided). A device in D3 Hot state can assert power management requests to transition to higher power states.
The CPU power states C0–C3 are defined as follows:
- C0 is the operating state.
- C1 (often known as Halt) is a state where the processor is not executing instructions, but can return to an executing state essentially instantaneously. All ACPI-conformant processors must support this power state. Some processors, such as the Pentium 4, also support an Enhanced C1 state (C1E or Enhanced Halt State) for lower power consumption.
- C2 (often known as Stop-Clock) is a state where the processor maintains all software-visible state, but may take longer to wake up. This processor state is optional.
- C3 (often known as Sleep) is a state where the processor does not need to keep its cache coherent, but maintains other state. Some processors have variations on the C3 state (Deep Sleep, Deeper Sleep, etc.) that differ in how long it takes to wake the processor. This processor state is optional.
- Additional states are defined by manufacturers for some processors. For example, Intel's Haswell platform has states up to C10, where it distinguishes core states and package states.
While a device or processor operates (D0 and C0, respectively), it can be in one of several power-performance states. These states are implementation-dependent. Though, P0 is always the highest-performance state; with P1 to Pn being successively lower-performance states, up to an implementation-specific limit of n no greater than 16.
- P0 max power and frequency
- P1 less than P0, voltage/frequency scaled
- P2 less than P1, voltage/frequency scaled
- Pn less than P(n-1), voltage/frequency scaled
ACPI-compliant systems interact with hardware through either a "Function Fixed Hardware (FFH) Interface", or a platform-independent hardware programming model which relies on platform-specific ACPI Machine Language (AML) provided by the original equipment manufacturer (OEM).
Function Fixed Hardware interfaces are platform-specific features, provided by platform manufacturers for the purposes of performance and failure recovery. Standard Intel-based PCs have a fixed function interface defined by Intel, which provides a set of core functionality that reduces an ACPI-compliant system's need for full driver stacks for providing basic functionality during boot time or in the case of major system failure.
ACPI defines a large number of tables that provide the interface between an ACPI-compliant operating system, and system firmware. For example:
- DSDT – Differentiated System Description Table
- SSDT – Secondary System Description Table
- SRAT – Static Resource Affinity Table
The tables allow description of system hardware in a platform-independent manner, and are presented as either fixed-formatted data structures or in AML. The main AML table is the DSDT (differentiated system description table).
The Root System Description Pointer is located in a platform-dependent manner, and describes the rest of the tables.
ACPI Platform Error Interface (APEI)
A specification for reporting of hardware errors e.g. from the chipset, to the operating system.
- ACPI Overview
- Microsoft Corporation, Intel Corporation (February 1996). "APM BIOS Specification". Microsoft Corporation. Retrieved 2010-07-02.
- Hewlett-Packard, Intel Corporation, Microsoft, Phoenix Technologies, Toshiba (2011-12-06). "Advanced Configuration and Power Interface Specification (Revision 5.0)" (PDF). Retrieved 2013-11-17.
- "ACPI and UEFI forum join forces: here’s why it matters". fixedbyvonnie.com. 2013-11-13. Retrieved 2013-11-17.
- ACPI implementation on FreeBSD - Usenix
- ACPI in Linux, 2005
- Searls, Doc (2003-11-25). "Linus & the Lunatics, Part II". Linux Journal. Retrieved 2010-01-13.
- Corbet, Jonathan (2001-07-04). "Kernel development". LWN.net weekly edition. LWN.net. Retrieved 2010-07-02.
- "Limitations When Using Microsoft Windows 98 on Compaq Armada Portables" (PDF). physik.hu-berlin.de. October 1998. p. 3. Retrieved 2014-01-27.
- "Windows 98 on ThinkPad systems - ThinkPad General". Support.lenovo.com. Retrieved 2014-01-27.
- Robert Cowart; Brian Knittel (2000). Using Microsoft Windows 2000 Professional. Que Publishing. p. 30. ISBN 978-0-7897-2125-9.
- Windows 98 Does Not Support ACPI Passive Cooling Mode
- Therien, Guy (2000-01-06). "ACPI 2.0 Specification Technical Review, Intel Developer Forum" (ppt). Intel Corporation. Archived from the original on 21 July 2011. Retrieved 2011-08-21.
- Marshall, Allen. "ACPI in Windows Vista" (PPT). Microsoft Corporation. Retrieved 2010-07-02.
- David Karp (2008). Windows Vista Annoyances: Tips, Secrets, and Hacks for the Cranky Consumer. "O'Reilly Media, Inc.". p. 221. ISBN 978-0-596-52762-4.
- The State of ACPI in the Linux Kernel
- ACPI BIOS
- ACPI Spec Rev 5.0 - dated December 6, 2011
- Anand Lal Shimpi (2012-10-05). "Intel's Haswell Architecture Analyzed". AnandTech. Retrieved 2013-10-20.
- Wasson, Scott (2005-02-21). "Intel's Pentium 4 600 series processors". The Tech Report. p. 2.
- "Processor Package and Core C-States". AnandTech. 2013-06-09. Retrieved 2013-10-20.
- Intel Corporation (September 2006). "Intel Processor Vendor-Specific ACPI" (PDF). Retrieved 2010-07-02.
- Brown, Len (2005-07-20). "ACPI in Linux". Ottawa Linux Symposium (PDFCiteSeerX: 10.1.1.173.2206.). p. 3.
- Advanced Configuration and Power Interface Specification Revision 5.0
- ACPI home page
- Intel's ACPI Component Architecture
- How Linux Suspend and Resume works in the ACPI age
- Implementing ACPI 5 Features (Linux Foundation Collaboration Summit 2013)
- Using and Debugging FreeBSD ACPI
- Everything You Need to Know About the CPU C-States Power Saving Modes
- Sample ASL code (in the *.dsl files) from the SeaBIOS project
- Sample EFI ASL code used by VirtualBox; EFI/ASL code itself is from the open source Intel EFI Development Kit II (Tianocore)