Detailed explanation of laptop power management ACPI[Copy link]
Now I will briefly write about what I know about ACPI technology in laptop power management for your reference. If it is incomplete or wrong, please correct me. Thank you. Maybe everyone who has used a laptop has used this function: when you want to leave the laptop to do some time-consuming work, you usually put the laptop into standby mode or hibernation mode, but do you know what components of your laptop are working at this time? What components have stopped working? What is the power consumption of different states? Knowing these things has a lot of positive significance for us to protect the life of components of our own beloved machines and to promote power saving and environmental protection. Well, let's get to the point without further ado: ACPI is the abbreviation of "Advanced Configuration and Power interface" in English, which was jointly developed by INTEL, MICROSOFT, and TOSHIBA. It is to have a common power management interface between the operating system and the hardware. In order to improve the inconsistent interfaces previously developed by individual manufacturers in power management. ACPI improves the original power management mode (APM) through BIOS and provides a relatively excellent power management mode and configuration management interface specification. ACPI provides an effective way to make an orderly transition from the original hardware to ACPI-compatible hardware, and it also allows the coexistence of ACPI and APM management mechanisms in one machine for use when needed. In addition, the new system architecture has also broken through the limitations of the current plug-and-play interface and expanded it. ACPI has improved the original motherboard configuration interface so that it can support these advanced system architectures and run in a more efficient state. ACPI was introduced by Win98 and WNT5.0 Started to support. Integrate the power management function into the operating system. Control the power operation of all hardware through a unified interface. From notebook to desktop and server, this specification is included. It is the key to the direct power management (OSPM) of the operating system.
All states can be divided into G (Global), D (Device), S (Sleeping), C (CPU).
Global refers to all systems. It can be divided into:
G0 - Working working state. User programs can run normally. But devices can dynamically allocate their own states. When this device is not used, this device can enter other non-working states. In this state, the system responds to external events in real time (the machine cannot be disassembled in this state)
G1 - Sleeping In this state, the system consumes less power. No user program is running. The system looks like it is in the shutdown state because the display screen is turned off at this time. As long as any wake-up activation event is transmitted to the system, it will quickly return to the working state. (The machine cannot be disassembled in this state)
G2/S5 - Soft Off In this state, the system only retains very little power. No user and operating system programs are running. It takes a longer time to return to the working state in this state. (The machine cannot be disassembled in this state)
G3 - Mechanical Off The power of the entire system is turned off. No current flows through the system. The system can only be activated by turning on the power supply switch again. The power consumption in this state is zero.
Global Status Summary System Status Running Software Wake-up Time Power Consumption OS Restart Safe Disassembly Electronic Exit State G0 - Working YES 0 LARGE NO NO YES G1 - Sleeping NO >0 SMALL NO NO YES G2/S5 - Soft Off NO LONG VERY NEAR0 YES NO YES G3 - Mechanical Off NO LONG RTC BATTERY YES YES NO
Device refers to some devices. For example, modems, hard disks, optical drives, etc. They can be divided into:
D0 - Fully-On Normal operation.
D1 can save less power consumption, and the device functions that still maintain ACTIVE are much more than D2. This state is determined by the device itself, and some devices cannot enter D1 STATE.
D2 Some functions are turned off. It can save more power. This state is determined by the device itself, and some devices cannot enter D2 STATE.
D3 - Off In this state, the power of the device is completely removed, so the next time the power is supplied again, the operating system needs to re-set the device (the device does not decode the address line in this state). This state requires the longest wake-up time, and all devices can enter this state.
Device Status Summary Device Status Power Consumption Device Activity Function Wake-up Time D0 – Fully On Depends on the operation needs All None D1 D0>D1>D2>D3 >D2 D2 D0>D1>D2>D3 D1 D3 - Off 0 None Requires full initialization and reload
Sleeping refers to the system entering sleep state under G1. It can be divided into:
S0 - Full on Normal operation, all devices are fully turned on, power consumption generally exceeds 80W
S1 – Sleeping (POS) Power on Suspend, shallow sleep state, in this state, the system operation can be quickly restored, the content of the system (CPU OR CHIPSET) is not lost. However, the CPU has stopped working, and other components are still working normally. The power consumption is generally below 30W. (In fact, some CPU cooling software uses this working principle)
S2 - Sleeping Similar to S1, but the content of the CPU and Cache has been lost. After the system is restored, the operating system needs to maintain the content of the CPU and Cache. At this time, the CPU is in the off state and the bus clock is also turned off, but the rest of the devices are still running. After the wake-up event occurs, the CPU reset signal starts the action first.
S3 - Sleeping (STR) Suspend to RAM, except for the data in the memory, the rest of the CPU, Cache, Chipset contents are lost. The contents of the memory are maintained by the hardware. After the wake-up event occurs, the CPU reset signal starts the action first. The power consumption at this time does not exceed 10W.
S4 - Sleeping (STD) Suspend to DISK, this state has the lowest power consumption, the longest wake-up time, and all devices are turned off. The system main power is turned off, but the system information will be stored in the hard disk. The hard disk is still powered and can be woken up.
S5 - Soft Off is the state of G2, which is similar to S4. All devices including the power supply are turned off, but the operating system does not maintain any content. In this state, a complete and thorough boot process is required to re-awaken the system. The BIOS uses a different state value to distinguish whether it will need to be started from the saved memory image when waking up from the S4 and S5 states. The power consumption at this time is 0.
The CPU working state can be divided into:
C0 CPU executes instructions normally.
C1 has the lowest wake-up time. The hardware wake-up time in this state must be small enough so that the operating software can completely ignore the hardware wake-up time in this state when deciding whether to use the device. In addition to putting the processor in a non-executing instruction power state, the software in this state is completely unaffected.
C2 saves more power than C1. This state has a slightly longer wake-up time than C1. This is determined by the ACPI system firmware. The operating software can use this information to decide when the CPU should enter the C1 state from the C2 state. In addition to putting the processor in a non-executing instruction power state, the software in this state is completely unaffected.
C3 saves more power than C1 and C2. The wake-up time in this state is the longest. This is determined by the ACPI system firmware. The operating software can use this information to decide when the CPU should enter the C2 state from the C3 state. In this state, the processor's cache contents are still maintained, but any snooping is ignored. The operating software is responsible for maintaining the consistency of the cache contents.