Power Management ACPI, and corresponding commands in apm and GNU/Linux systems

Source: Internet
Author: User
Tags apm

 

/********************************************************************* * Author  : Samson * Date    : 05/19/2014 * Test platform: *              Mint 15-3.8.13.13 *              GNU bash, version 4.2.45 * *******************************************************************/ 

Rtc:

The Real Time Clock (RTC) unit can be operated by the backup battery when the system power is off. The data
Include the time by second, minute, hour, date, day, month, and year. The RTC unit works with an external 32.768 KHz crystal and can perform the alarm function.

When the system power is off, the real-time clock (RTC) unit can be run through the standby power supply. The time that the data contains, that is, second, minute, hour, date, day, month, and year. RTC is driven by an external 32.768 kHz crystal and can be used for alarm.

To master the standby mode and sleep mode, you must first understand the following two knowledge: ACPI and APM.
1. What is ACPI?
ACPI is short for Advanced Configuration and Power Interface. It stands for "Advanced Configuration and Power Interface". It is an industrial standard jointly developed by Microsoft, Intel, and Toshiba.

ACPI provides the following functions:
① The user can enable or disable the computer at a specified time;
② The plug-and-play device can be controlled by ACPI during insertion and supply power to it;
③ When no one uses a computer, the computer can enter sleep state, but ensure that some communication devices are enabled;
④ The operating system can allocate energy to the peripherals and the Main Board according to their specific needs;
⑤ The operating system can reduce the clock frequency when the application requires less time;
⑥ Laptop users can specify that the computer enters the low-power state at low voltage to ensure that important applications run properly.

At the same time, ACPI can be divided into six different working states, namely, S0 to S5, which represent the following meanings:
S0: The computer is working normally, and all hardware devices are on or working normally;
S1: Also known as POS (Power on Suspend, CPU stops working), other hardware devices still work normally;
S2: Shut down the CPU, but other hardware devices are still running;
S3: generally called STR (Suspend to RAM, suspended to memory), writes running data to memory and closes the hard disk;
S4: Also known as STD (Suspend to Disk, suspended to the hard Disk). The memory information is written to the hard Disk, and all components stop working;
S5: All hardware devices (including power supply) are shut down, that is, shutdown.

2. What is APM?
APM is short for Advanced Power Manager (Advanced Power Management), which is a management mode for controlling and managing computer hardware Power supplies through the operating system, in fact, it is also a set of computer power management programs (software), different versions, functions are also different, such as APM V1.0 & V1.1, these two versions are directly executed by the BIOS power management, APM V1.2 can first define the power management through the operating system, and then be executed by the BIOS.
In today's popular operating systems, APM is built in. In the past DOS era, APM was not actually introduced into the operating system, so it is impossible to perform operations such as standby and sleep, you can only press Ctrl + Alt + Delete or power Reset to restart the instance.


S1 => Standby. That is to say, the system is applicable to low-power supply scenarios, in windows or BIOS, you can set an on-screen operation to allow outgoing access, hard drive to stop running, and then enable the on-screen operation to allow remote access. At this time, you can wake up a mouse or press any mouse button.
  
S2 => Power Standby. Similar to S1.
  
S3 => Suspend to RAM. That is to say, you can save all the information in the current windows Memory without any action, and then enter the "false host 」. At this time, except for the need for the computer to maintain the resources, all other equipment and devices are stopped for power supply. That is to say, in theory, the CPU, PCI, and AGP device can be removed and inserted back, and the computer may also be able to properly start and operate, as long as it does not touch the computer and the source part. At this time, only the source computer is available for one hour and one hour. There are no other and no other devices. (The fan of the power supply device also stops running.) After the computer is restarted, the computer only verifies the integrity of the information of the computer, that is, it will immediately return to the interface before you enter S3.
  
S4 => Suspend to Disk. That is, the information in windows Memory is completely stored in the hard disk. When you are on the machine, you can directly copy the data directly from the location where the data is stored to the memory. You do not need to run a bunch of applications. In this mode, the hard drive must have a complete bandwidth. For Windows 98/SE, you must use a physical tool to prepare a large case or a magnetic zone to provide the win98/SE serial S4 function, winME/2000/XP itself has been used as a big case for S4 functions (this is the case when there is an animation sleep in the power source management ). After the notebook, I will see a big case similar to your computer's memory in C.
  
S5 => Shutdown... don't talk about it!
  
S1/S3 is called "standby or Standby" in windows, so there will be an option in the BIOS. It is determined that the standby mode is required for S1 or S3, so. S1 and S3 cannot exist at the same time. No S1, S4, or S3.

S1 and S2: standby mode, which can be awakened by the mouse or keyboard to reduce power consumption;
S3: suspended. All running environments are saved to the memory, and all other devices, such as hard disk, are shut down to stop power supply. You must wake up and load them by pressing the start button of the device;
S4: Sleep. After saving all the running environments to the hard disk, only the RTC processor is powered, while the RTC is powered by the BIOS battery, so in terms of power saving, it is the same as shutdown. When the set wake-up time or press the power-on button again, load the stored environment from the hard disk to the memory, that is, the status before hibernation, it is easy to quickly restore to the previous work environment.

The rtcwake Command provided by GNU/Linux is used in the preceding five modes:
Sleep:
The computer enters sleep mode and automatically wakes up after 2 hours (7200 seconds)
Sudo rtcwake-m disk-s 7200

Wake up
Sudo rtcwake-m disk-t 'date-d 10:45 + % s'

Will let the system enter S3, sleep for 20 seconds and then automatically wake up.
Sudo rtcwake-v-s 20-m mem

You can view the supported modes for the parameters after-m:
Gy @ yy :~ $ Cat/sys/power/state
Standby mem disk

The preceding three modes are supported. For more information about rtcwake, see man in GNU/Linux.

Ref:

Http://wenku.baidu.com/view/016ff0ee81c758f5f61f67ba.html

Http://wenku.baidu.com/view/c8f9c7f57c1cfad6195fa710.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.