ACPI

From HandWiki
Short description: Computer firmware interface standard
Advanced Configuration and Power Interface
StatusPublished
First publishedDecember 1996
Latest version6.5
August 2022
Organization
Related standardsUEFI
DomainPower management firmware
AbbreviationACPI
Websiteuefi.org/acpi

Advanced Configuration and Power Interface (ACPI) is an open standard that operating systems can use to discover and configure computer hardware components, to perform power management (e.g. putting unused hardware components to sleep), auto configuration (e.g. Plug and Play and hot swapping), and status monitoring. First released in December 1996, ACPI aims to replace Advanced Power Management (APM), the MultiProcessor Specification, and the Plug and Play BIOS (PnP) Specification.[1] ACPI brings power management under the control of the operating system, as opposed to the previous BIOS-centric system that relied on platform-specific firmware to determine power management and configuration policies.[2] The specification is central to the Operating System-directed configuration and Power Management (OSPM) system. ACPI defines hardware abstraction interfaces between the device's firmware (e.g. BIOS, UEFI), the computer hardware components, and the operating systems.[3][4]

Internally, ACPI advertises the available components and their functions to the operating system kernel using instruction lists ("methods") provided through the system firmware (UEFI or BIOS), which the kernel parses. ACPI then executes the desired operations written in ACPI Machine Language (such as the initialization of hardware components) using an embedded minimal virtual machine.

Intel, Microsoft and Toshiba originally developed the standard, while HP, Huawei and Phoenix also participated later. In October 2013, ACPI Special Interest Group (ACPI SIG), the original developers of the ACPI standard, agreed to transfer all assets to the UEFI Forum, in which all future development will take place.[5] (As of October 2022) of the standard 6.5 was released in August 2022.[6]

Architecture

The firmware-level ACPI has three main components: the ACPI tables, the ACPI BIOS, and the ACPI registers. The ACPI BIOS generates ACPI tables and loads ACPI tables into main memory. Much of the firmware ACPI functionality is provided in bytecode of ACPI Machine Language (AML), a Turing-complete, domain-specific low-level language, stored in the ACPI tables.[7] To make use of the ACPI 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 bytecode is compiled from the ASL (ACPI Source Language) code.[8][9]

Overall design decision was not without criticism. In November 2003, Linus Torvalds—author of the Linux kernel—described ACPI as "a complete design disaster in every way".[10][11]

ACPI Component Architecture (ACPICA)

The ACPI Component Architecture (ACPICA), mainly written by Intel's engineers, provides an open-source platform-independent reference implementation of the operating system–related ACPI code.[12] The ACPICA code is used by Linux, Haiku, ArcaOS[13] and FreeBSD,[8] which supplement it with their operating-system specific code.

History

The first revision of the ACPI specification was released in December 1996, supporting 16, 24 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 1999, then Microsoft CEO Bill Gates stated in an e-mail that Linux would benefit from ACPI without them having to do work and suggested to make it Windows-only.[14][15][16]

In September 2004, revision 3.0 was released, bringing to the ACPI specification support for SATA interfaces, PCI Express bus, multiprocessor support for more than 256 processors, ambient light sensors and user-presence devices, as well as extending the thermal model beyond the previous processor-centric support.

Released in June 2009, revision 4.0 of the ACPI specification added various new features to the design; most notable are the USB 3.0 support, logical processor idling support, and x2APIC support.

Revision 5.0 of the ACPI specification was released in December 2011,[17] which added the ARM architecture support. The revision 5.1 was released in July 2014.[18]

The latest specification revision is 6.5, which was released in August 2022.[6]

Operating systems

The "It's now safe to turn off your computer" screen in Windows 9x. Most of the computer peripherals are offline, and the only ways to exit this screen is to power off or reset the computer.
The "It's now safe to turn off your computer" screen in Windows NT 4.0. Unlike Windows 9x and later NT releases, most of the essential computer peripherals are working normally, so the user can opt to restart instead of powering off their computer.

Microsoft's Windows 98 was the first operating system to implement ACPI,[19][20] but its implementation was somewhat buggy or incomplete,[21][22] although some of the problems associated with it were caused by the first-generation ACPI hardware.[23] Other operating systems, including later versions of Windows, macOS, eComStation, ArcaOS,[24] FreeBSD (since FreeBSD 5.0[25]), NetBSD (since NetBSD 1.6[26]), OpenBSD (since OpenBSD 3.8[27]), HP-UX, OpenVMS, Linux, GNU Hurd and PC versions of Solaris, have at least some support for ACPI.[28] Some newer operating systems, like Windows Vista, require the computer to have an ACPI-compliant BIOS, and since Windows 8, the S0ix/Modern Standby state was implemented.[29]

Windows operating systems use acpi.sys[30] to access ACPI events.

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.[31] 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.[32] Similarly, Linux kernel 2.6 may not use ACPI if the BIOS date is before January 1, 2001.[31]

Linux-based operating systems can provide handling of ACPI events via acpid.[33]

OSPM responsibilities

Once an OSPM-compatible operating system activates ACPI, it takes 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.

Power states

Global states

The ACPI Specification defines the following four global "Gx" states and six sleep "Sx" states for an ACPI-compliant computer system:[34][35]

Gx Name Sx Description
G0 Working S0 The computer is running and the CPU executes instructions. "Awaymode" is a subset of S0, where monitor is off but background tasks are running
G1 Sleeping S0ix Modern Standby,[36] or "Low Power S0 Idle". Partial processor SoC sleep.[37][38] Known to ARM and x86 devices.
S1 Power on Suspend (POS): 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. Fans may turn off. Requires GPU drivers on Windows.
S4 Hibernation or Suspend to Disk: All content of the main memory is saved to non-volatile memory such as a hard drive, and the system is powered down.
G2 Soft Off S5 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. No previous content is retained. Some 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).

The specification also defines a Legacy state: the state of an operating system which does not support ACPI. In this state, the hardware and power are not managed via ACPI, effectively disabling ACPI.

Device states

The device states D0D3 are device dependent:

  • D0 or Fully On is the operating state.
    • As with S0ix, Intel has D0 states for intermediate levels on [39]
  • D1 and D2 are intermediate power-states whose definition varies by device.
  • D3: The D3 state is further divided into D3 Hot (has auxiliary power), and D3 Cold (power on):
    • Hot: A device can assert power management requests to transition to higt power states.
    • Cold or On has the device power on and responsive to its.

Processor states

The CPU power states C0C3 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 and AMD Athlon, also support an Enhanced C1 state (C1E or Enhanced Halt State) for lower power consumption, however this proved to be buggy on some systems.[40][41]
  • 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.[42]

Performance state

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. 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.[43]

P-states have become known as SpeedStep in Intel processors, as PowerNow! or Cool'n'Quiet in AMD processors, and as PowerSaver in VIA processors.

  • P0 maximum power and frequency
  • P1 less than P0, voltage and frequency scaled
  • P2 less than P1, voltage and frequency scaled[44]
  • Pn less than P(n–1), voltage and frequency scaled

Interfaces

Hardware

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,[45] 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 Platform Error Interface (APEI) is a specification for reporting of hardware errors, e.g. chipset, RAM to the operating system.

Firmware

ACPI defines many tables that provide the interface between an ACPI-compliant operating system and system firmware (BIOS or UEFI). This includes RSDP, RSDT, XSDT, FADT, FACS, DSDT, SSDT, MADT, and MCFG, for example.[46][47]

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 AML can be decompiled by tools like Intel's iASL (open-source, part of ACPICA) for purposes like patching the tables for expanding OS compatibility.[48][49]

The Root System Description Pointer (RSDP) is located in a platform-dependent manner, and describes the rest of the tables.

A custom ACPI table called the Windows Platform Binary Table (WPBT) is used by Microsoft to allow vendors to add software into the Windows OS automatically. Some vendors, such as Lenovo, have been caught using this feature to install harmful software such as Superfish.[50] Samsung shipped PCs with Windows Update disabled.[50] Windows versions older than Windows 7 do not support this feature, but alternative techniques can be used. This behavior has been compared to rootkits.[51][52]

Tables

PHAT
Platform Health Assessment Table
SLIP
Software Licensing Description Table

See also

Further reading

References

  1. "ACPI Overview" (slide show in PDF). http://www.acpi.info/presentations/ACPI_Overview.pdf. 
  2. "APM BIOS Specification" (RTF). Intel Corporation, Microsoft Corporation. February 1996. http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/APMV12.rtf. 
  3. "What is ACPI (Advanced Configuration and Power Interface)? - Definition from WhatIs.com" (in en). https://searchwindowsserver.techtarget.com/definition/ACPI-Advanced-Configuration-and-Power-Interface. 
  4. "ACPI Device Tree - Representation of ACPI Namespace — The Linux Kernel documentation". https://www.kernel.org/doc/html/latest/firmware-guide/acpi/namespace.html. 
  5. "The Advanced Configuration & Power Interface web page has a prominent note that links to the Preexisting ACPI Specifications page on the UEFI web site". July 23, 2014. http://www.acpi.info/. 
  6. 6.0 6.1 "Advanced Configuration and Power Interface Specification, Release 6.5". August 2022. https://uefi.org/sites/default/files/resources/ACPI_Spec_6_5_Aug29.pdf. 
  7. Bernhard Kauer (August 2009). "ATARE: ACPI Tables and Regular Expressions". https://os.inf.tu-dresden.de/papers_ps/tr-atare-2009.pdf. 
  8. 8.0 8.1 ACPI implementation on FreeBSD - Usenix
  9. ACPI in Linux, 2005
  10. Linux Magazine issue 162, May 2014, page 9
  11. Searls, Doc (2003-11-25). "Linus & the Lunatics, Part II". Linux Journal. http://www.linuxjournal.com/article/7279. 
  12. ACPICA: ACPI Component Architecture
  13. "Readme for the ACPI Driver Package". https://www.arcanoae.com/wp-content/uploads/wiki/ReadMe-ACPI.txt. 
  14. "Microsoft wollte ACPI nur für Windows" (in de-AT). https://www.derstandard.at/story/2843846/microsoft-wollte-acpi-nur-fuer-windows. 
  15. "Microsoft: ACPI sollte nur unter Windows funktionieren". https://www.golem.de/0704/51686.html. 
  16. Gates, Bill (1999-01-24). "ACPI extensions". http://www.iowaconsumercase.org/011607/3000/PX03020.pdf. 
  17. "Advanced Configuration and Power Interface Specification (Revision 5.0)". 2011-12-06. http://acpi.info/DOWNLOADS/ACPIspec50.pdf. 
  18. "Advanced Configuration and Power Interface Specification (Revision 5.1)". 2014-07-23. http://www.uefi.org/sites/default/files/resources/ACPI_5_1release.pdf. 
  19. "Limitations When Using Microsoft Windows 98 on Compaq Armada Portables". physik.hu-berlin.de. October 1998. p. 3. ftp://ftp.physik.hu-berlin.de/pub/driver/grafik/armada1120/RMF98/DISK1/WINDOW~1.PDF. [yes|permanent dead link|dead link}}]
  20. "Windows 98 on ThinkPad systems - ThinkPad General". Support.lenovo.com. http://support.lenovo.com/en_US/guides-and-manuals/detail.page?&LegacyDocID=LWIK-3VJLL8. 
  21. Robert Cowart; Brian Knittel (2000). Using Microsoft Windows 2000 Professional. Que Publishing. p. 30. ISBN 978-0-7897-2125-9. https://archive.org/details/usingmicrosoftwi00cowa. 
  22. Windows 98 Does Not Support ACPI Passive Cooling Mode
  23. "Cover Story: Win98 Bugs & Fixes - December 1998". http://winmag.com/library/1998/1201/cov0066.htm. 
  24. "ArcaOS Changelog". https://www.arcanoae.com/wp-content/uploads/wiki/ArcaOS-changes.txt. 
  25. "FreeBSD 5.0-RELEASE Announcement". https://www.freebsd.org/releases/5.0R/announce.html. 
  26. "acpi(4) - NetBSD Manual Pages". https://man.netbsd.org/acpi.4. 
  27. "acpi(4) - OpenBSD manual pages". https://man.openbsd.org/acpi.4. 
  28. Therien, Guy (2000-01-06). "ACPI 2.0 Specification Technical Review, Intel Developer Forum" (PPT). Intel Corporation. http://www.acpi.info/presentations/acpi2M0800IDF.ppt. 
  29. Marshall, Allen. "ACPI in Windows Vista" (PPT). Microsoft Corporation. http://download.microsoft.com/download/5/b/9/5b97017b-e28a-4bae-ba48-174cf47d23cd/CPA002_WH06.ppt. 
  30. "Acpi.sys: The Windows ACPI Driver". Microsoft Corporation. 2017-06-15. https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/acpi-driver. 
  31. 31.0 31.1 The State of ACPI in the Linux Kernel
  32. ACPI BIOS. msdn.microsoft.com.
  33. Linux in a nutshell. Ellen Siever, Ellen Siever (5th ed.). Beijing: O'Reilly. 2005. pp. 36. ISBN 978-0-596-52949-9. OCLC 773210086. https://www.worldcat.org/oclc/773210086. 
  34. ACPI Spec Rev 5.0 - dated December 6, 2011
  35. Anand Lal Shimpi (2012-10-05). "Intel's Haswell Architecture Analyzed". AnandTech. http://www.anandtech.com/show/6355/intels-haswell-architecture/3. 
  36. windows-driver-content. "Modern Standby" (in en-gb). https://docs.microsoft.com/en-gb/windows-hardware/design/device-experiences/modern-standby. 
  37. "S0ix States" (in en). 9 March 2020. https://software.intel.com/en-us/energy-analysis-user-guide-s0ix-states. 
  38. Wang, Wendy (17 October 2018). "How to achieve S0ix states in Linux*". https://01.org/blogs/qwang59/2018/how-achieve-s0ix-states-linux. 
  39. "D0 States" (in es). 11 Dec 2023. https://software.intel.com/es-mx/energy-analysis-user-guide-d0-states. 
  40. "Athlon II X2: Hardware C1E and Return of the CnQ Bug". AnandTech. https://www.anandtech.com/show/2775/2. 
  41. Wasson, Scott (2005-02-21). "Intel's Pentium 4 600 series processors". The Tech Report. p. 2. http://techreport.com/articles.x/7998/2. 
  42. "Processor Package and Core C-States". AnandTech. 2013-06-09. http://images.anandtech.com/reviews/cpu/intel/Haswell/ULT/c10.png. 
  43. "Advanced Configuration and Power Interface Specification, Revision 3.0, Section 2.6 Device and Processor Performance State Definitions". 2004-09-02. p. 23. http://www.acpi.info/DOWNLOADS/ACPIspec30.pdf. 
  44. Link aggregation
  45. Intel Corporation (September 2006). "Intel Processor Vendor-Specific ACPI". ftp://download.intel.com/technology/iapc/acpi/downloads/30222305.pdf. 
  46. Brown, Len (2005-07-20). "ACPI in Linux". Ottawa Linux Symposium: 3. 
  47. "ACPI Tables — The Linux Kernel documentation". https://www.kernel.org/doc/html/latest/arm64/acpi_object_usage.html. 
  48. "DSDT". https://wiki.archlinux.org/index.php/DSDT. 
  49. "Getting Started With ACPI". https://khronokernel.github.io/Getting-Started-With-ACPI/. 
  50. 50.0 50.1 Hoffman, Chris (August 19, 2015). "Zombie Crapware: How the Windows Platform Binary Table Works". https://www.howtogeek.com/226308/the-windows-platform-binary-table-why-crapware-can-come-back-after-a-clean-install/. 
  51. "Vendors 'rootkit': 'Windows Platform Binary Table' (WPBT)". December 6, 2017. https://borncity.com/win/2017/12/06/vendors-rootkit-windows-platform-binary-table-wpbt/. 
  52. "Millions of Windows 10 PCs exposed by nasty security vulnerability" (in en). 2021-09-27. https://www.techradar.com/news/nasty-security-vulnerability-exposes-millions-of-windows-10-pcs. 

External links

Template:Firmware and booting