Friday, February 22, 2008

ACPI Advanced Configuration and Power Interface

ACPI consists of several components that are designed to manage power usage in you PC. For something that seems fairly minor in theory, it is very complicated in its application. There consists several elements such as the ACPI register set, ACPI BIOS, ACPI table, and two operating system elements; the OSPM system code, and the ACPI driver with the AML interpreter. The following chart indicates each of the elements of the ACPI. Courtesy of the ACPI specification Revision 3.0a.



Before Windows 98, the power management system relies on BIOS to control it. Since the release of Windows 98, more control has been granted to the operating system by way of the AML or ACPI Machine Language embedded in the BIOS firmware. This gives the operating system the means to control the low-level information relating to the hardware thus giving it more control over the various states devices can be placed in to control power usage. Older systems had no way to interpret the AML and had no clue how to handle the ACPI registers. ACPI specifications outline standards to which manufacturers must conform to insure that all devices including motherboard chipsets, operating systems, and CPU's can support current ACPI designs. The current ACPI specifications that I've based some of this outline on are from Revision 3.0a.

There are several states of power management described as global states, processor states, device states, and performance states. There are also several layers within each state that the computer system can be placed in.

Global state G0 is the working state. The software is running, there is no latency (delay in response) and the power consumption is at its highest. The computer should not be disassembled in this state due to the risk of electrical shock and system damage.

The G1 state is considered sleeping which is further divided into modes S1 to S4. In S1 mode the CPU stops running and all unnecessary devices are shut down. S2 mode goes a little further than S1 in that the CPU is completely powered down. S3 also called SUSPEND to RAM (STR) or standby in Windows. The only ting powered in this mode is RAM. The system will still maintain all data and will resume without rebooting. S4 or Hibernation by Windows, the data in the main memory is saved. This means that if the computer looses power the only loss of data would be any unsaved documents.

The G2 also known as S5 Soft off, are almost the same as the next state G3, except the system is still using a minimum amount of power. The system must go through a restart and there is a long latency. The computer should not be disassembled in this state.

The G3 state is achieved by powering down the system and no power is being consumed except for the real-time clock. A hard boot is required to return the system to working mode. This is the only state that the computer can safely be disassembled after removing the power cord.

The next set of states are the Device states. There are only four levels D0 through D3. D0 is the state when the device is operating and consuming power as it needs to. D1 and D2 are entered as required by each of the different devices. D3 requires no power and will no communicate with the system. This level requires the device to be reinitialized in order to be used.

Processor states have only four levels as well. They range from C0 to C3. C0 is full operation. C1 also called HALT, the CPU is not executing any instructions and can be returned to working mode in the shortest amount of time. C2 also known as Stop-clock, takes longer to wake up than C1 and uses less power than C1. C3 is known as Sleep and takes the longest to return to working mode and uses the least amount of power.

Performance states are mostly defined by the manufacturers of processors. They range from P0 to P16. In the P0 state, the processor or device is at its highest level and will use the most power. The remaining states are all lesser levels then P0 and will vary by processor.

The complete ACPI specification can be obtained online and contains over 600 pages of additional information including specific syntax requirements for device designers. If you have the time, it's well worth a look and a copy can be downloaded at www.acpi.info/.

No comments: