Misplaced Pages

Advanced Power Management

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

Advanced power management ( APM ) is a technical standard for power management developed by Intel and Microsoft and released in 1992 which enables an operating system running an IBM-compatible personal computer to work with the BIOS (part of the computer's firmware ) to achieve power management .

#389610

44-546: Revision 1.2 was the last version of the APM specification, released in 1996. ACPI is the successor to APM. Microsoft dropped support for APM in Windows Vista . The Linux kernel still mostly supports APM, though support for APM CPU idle was dropped in version 3.0. APM uses a layered approach to manage devices. APM-aware applications (which include device drivers) talk to an OS-specific APM driver. This driver communicates to

88-408: 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

132-604: A car are transportation. They both have commonalities (e.g., you must steer) and physical differences (e.g., use of feet). One can always specify the abstraction "drive to" and let the implementor decide whether bicycling or driving a car is best. The "wheeled terrestrial transport" function is abstracted and the details of "how to drive" are encapsulated. Examples of "abstractions" on a PC include video input, printers, audio input and output, block devices (e.g. hard disk drives or USB flash drive ), etc. In certain computer science domains, such as operating systems or embedded systems,

176-726: 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 P n being successively lower-performance states. The total number of states is device or processor dependent, but can be no greater than 16. 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. ACPI-compliant systems interact with hardware through either

220-418: A different hardware interface. Hardware abstractions often allow programmers to write device -independent, high performance applications by providing standard operating system (OS) calls to hardware. The process of abstracting pieces of hardware is often done from the perspective of a CPU . Each type of CPU has a specific instruction set architecture or ISA. The ISA represents the primitive operations of

264-690: A driver cannot directly tell the CPU to go into a power saving state. The ATA specification and SATA specification defines APM provisions for hard drives, which specifies a trade-off between spin-down frequency and always-on performance. Unlike the BIOS-side APM, the ATA APM and SATA APM has never been deprecated. Aggressive spin-down frequencies may reduce drive lifespan by unnecessarily accumulating load cycles; most modern drives are specified to sustain 300,000 cycles and usually last at least 600,000. On

308-422: 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 Platform Error Interface (APEI) is a specification for reporting of hardware errors, e.g. chipset, RAM to the operating system. ACPI defines many tables that provide

352-477: A low-power state, or returning it to its full-power state), retrieving the current power state of a device, or requesting a power state change. The APM specification defines system power states and device power states. APM defines five power states for the computer system: APM also defines power states that APM-aware hardware can implement. There is no requirement that an APM-aware device implement all states. The four states are: The CPU core (defined in APM as

396-430: A minimum of code modification. Operating systems having a defined HAL are more easily portable across different hardware. This is especially important for embedded systems that run on dozens of different platforms. The Windows NT kernel has a HAL in the kernel space between hardware and the executive services that are contained in the file NTOSKRNL.EXE under %WINDOWS%\system32\hal.dll . This allows portability of

440-458: A signal related to "movement". As physical limitations (e.g. resolution of sensor, temporal update frequency) may vary with hardware, an API can do little to hide that, other than by assuming a "least common denominator" model. Thus, certain deep architectural decisions from the implementation may become relevant to users of a particular instantiation of an abstraction. A good metaphor is the abstraction of transportation. Both bicycling and driving

484-505: 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 . Internally, ACPI advertises the available components and their functions to the operating system kernel using instruction lists (" methods ") provided through

SECTION 10

#1732790468390

528-469: Is compiled from the ASL (ACPI Source Language) code. 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. The ACPICA code is used by Linux, Haiku , ArcaOS and FreeBSD , which supplement it with their operating-system specific code. The first revision of

572-527: The Linux kernel —described ACPI as "a complete design disaster in every way". Hardware abstraction Hardware abstractions are sets of routines in software that provide programs with access to hardware resources through programming interfaces. The programming interface allows all devices in a particular class C of hardware devices to be accessed through identical interfaces even though C may contain different subclasses of devices that each provide

616-718: The USB ;3.0 support, logical processor idling support, and x2APIC support. Initially ACPI is exclusive to x86 architecture; Revision 5.0 of the ACPI specification was released in December 2011, which added the ARM architecture support. The revision 5.1 was released in July 2014. The latest specification revision is 6.5, which was released in August 2022. Microsoft's Windows 98

660-468: 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. In September 2004, revision 3.0

704-574: The API and communicates with the hardware by calling functions in the API. A hardware abstraction layer ( HAL ) is an abstraction layer , implemented in software, between the physical hardware of a computer and the software that runs on that computer. Its function is to hide differences in hardware from most of the operating system kernel , so that most of the kernel-mode code does not need to be changed to run on systems with different hardware. On Microsoft Windows, HAL can basically be considered to be

748-514: The APM BIOS to the operating system. The APM driver regularly polls for event change notifications. Power Management Events: There are 21 APM function calls defined that the APM driver can use to query power management statuses, or request power state transitions. Example function calls include letting the BIOS know about current CPU usage (the BIOS may respond to such a call by placing the CPU in

792-583: The APM driver is an intermediary between the BIOS and the operating system. Power management happens in two ways; through the above-mentioned function calls from the APM driver to the BIOS requesting power state changes, and automatically based on device activity. In APM 1.0 and APM 1.1, power management is almost fully controlled by the BIOS. In APM 1.2, the operating system can control PM time (e.g. suspend timeout). There are 12 power events (such as standby, suspend and resume requests, and low battery notifications), plus OEM -defined events, that can be sent from

836-466: The APM-aware BIOS, which controls the hardware. There is the ability to opt out of APM control on a device-by-device basis, which can be used if a driver wants to communicate directly with a hardware device. Communication occurs both ways; power management events are sent from the BIOS to the APM driver, and the APM driver sends information and requests to the BIOS via function calls. In this way

880-535: The BIOS date is after January 1, 1999. Similarly, Linux kernel 2.6 may not use ACPI if the BIOS date is before January 1, 2001. Linux-based operating systems can provide handling of ACPI events via acpid. 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. The ACPI Specification defines

924-405: The CPU clock, cache , system bus and system timers) is treated specially in APM, as it is the last device to be powered down, and the first device to be powered back up. The CPU core is always controlled through the APM BIOS (there is no option to control it through a driver). Drivers can use APM function calls to notify the BIOS about CPU usage, but it is up to the BIOS to act on this information;

SECTION 20

#1732790468390

968-698: The HAL, Windows 2000 was able to run on them. Since Windows Vista and Windows Server 2008 , the HAL used is automatically determined during startup . An "extreme" example of a HAL can be found in the System/38 and AS/400 architectures, currently implemented in the IBM i operating system. Most compilers for those systems generate an abstract machine code; the Licensed Internal Code, or LIC, translates this virtual machine code into native code for

1012-523: The Windows NT kernel-mode code to a variety of processors, with different memory management unit architectures, and a variety of systems with different I/O bus architectures; most of that code runs without change on those systems, when compiled for the instruction set applicable to those systems. For example, the SGI Intel x86-based workstations were not IBM PC compatible workstations, but due to

1056-476: The ability to insert one while running, like Adeos . The NetBSD operating system is widely known as having a clean hardware abstraction layer which allows it to be highly portable. As part of this system are uvm(9) / pmap(9) , bus_space(9) , bus_dma(9) and other subsystems. Popular buses which are used on more than one architecture are also abstracted, such as ISA , EISA , PCI , PCIe , etc., allowing drivers to also be highly portable with

1100-413: The abstractions have slightly different appearances (for instance, operating systems tend to have more standardized interfaces), but the concept of abstraction and encapsulation of complexity are common, and deep. The hardware abstraction layer resides below the application programming interface (API) in a software stack, whereas the application layer (often written in a high level language) resides above

1144-672: The computer to have an ACPI-compliant BIOS, and since Windows 8 , the S0ix/Modern Standby state was implemented. Windows operating systems use acpi.sys 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. 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

1188-583: The device. This meant programmers didn't need to know how specific devices worked, making their programs compatible with any device. An example of this might be a "joystick" abstraction. The joystick device, of which there are many physical implementations, is readable/writable through an API which many joystick-like devices might share. Most joystick-devices might report movement directions. Many joystick-devices might have sensitivity-settings that can be configured by an outside application. A Joystick abstraction hides details (e.g., register format, I2C address) of

1232-411: The driver for the motherboard and allows instructions from higher level computer languages to communicate with lower level components, but prevents direct access to the hardware. CP/M ( CP/M BIOS ), DOS ( DOS BIOS ), Solaris , Linux , BSD , macOS , and some other portable operating systems also have a HAL, even if it is not explicitly designated as such. Some operating systems, such as Linux, have

1276-581: The fact that the underlying hardware has been changed dramatically; at least three different types of processors have been in use. Android introduced a HAL known as the "vendor interface" (codenamed "Project Treble") on version 8.0 "Oreo" . It abstracts low-level code from the Android OS framework, and they must be made forward compatible to support future versions of Android to ease the development of firmware updates. Before Project Treble Android relied on various non-standardized legacy HALs. Halium

1320-555: 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. 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

1364-427: The following four global "Gx" states and six sleep "Sx" states for an ACPI-compliant computer system: 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. The device states D0 – D3 are device dependent: The CPU power states C0 – C3 are defined as follows: While

Advanced Power Management - Misplaced Pages Continue

1408-439: The hardware so that a programmer using the abstracted API, does not need to understand the details of the device's physical interface. This also allows code reuse since the same code can process standardized messages from any kind of implementation which supplies the "joystick" abstraction. A "nudge forward" can be from a potentiometer or from a capacitive touch sensor that recognises "swipe" gestures, as long as they both provide

1452-575: 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. 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

1496-419: The machine that are available for use by assembly programmers and compiler writers. One of the main functions of a compiler is to allow a programmer to write an algorithm in a high-level language without having to care about CPU-specific instructions. Then it is the job of the compiler to generate a CPU-specific executable. The same type of abstraction is made in operating systems, but OS APIs now represent

1540-526: The original developers of the ACPI standard, agreed to transfer all assets to the UEFI Forum , in which all future development will take place. The latest version of the standard 6.5 was released in August 2022. 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

1584-546: The other hand, not spinning down the drive will cause extra power draw and heat generation; high temperatures also reduce the lifespan of hard drives. Advanced Configuration and Power Interface 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. It

1628-427: The primitive operations of the machine, rather than an ISA. This allows a programmer to use OS-level operations (e.g. task creation/deletion) in their programs while retaining portability over a variety of different platforms. Many early computer systems did not have any form of hardware abstraction. This meant that anyone writing a program for such a system would have to know how each hardware device communicated with

1672-462: The processor on which it is running and executes the resulting native code. (The exceptions are compilers that generate the LIC itself; those compilers are not available outside IBM.) This was so successful that application software and operating system software above the LIC layer that were compiled on the original S/38 run without modification and without recompilation on the latest AS/400 systems, despite

1716-418: The rest of the system. This was a significant challenge to software developers since they then had to know how every hardware device in a system worked to ensure the software's compatibility . With hardware abstraction, rather than the program communicating directly with the hardware device, it communicates to the operating system what the device should do, which then generates a hardware-dependent instruction to

1760-501: 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),

1804-846: The tables for expanding OS compatibility. 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 . Samsung shipped PCs with Windows Update disabled. Windows versions older than Windows 7 do not support this feature, but alternative techniques can be used. This behavior has been compared to rootkits . In November 2003, Linus Torvalds —author of

Advanced Power Management - Misplaced Pages Continue

1848-549: Was first released in December 1996. ACPI aims to replace Advanced Power Management (APM), the MultiProcessor Specification , and the Plug and Play BIOS (PnP) Specification. 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. The specification

1892-465: 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

1936-591: 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 , macOS (x86 macOS only), eComStation , ArcaOS , FreeBSD (since FreeBSD 5.0 ), NetBSD (since NetBSD 1.6 ), OpenBSD (since OpenBSD 3.8 ), HP-UX , OpenVMS , Linux , GNU/Hurd and PC versions of Solaris , have at least some support for ACPI. Some newer operating systems, like Windows Vista , require

#389610