Power management ACPI, and the corresponding commands under APM, Gnu/linux system are used

Source: Internet
Author: User
Tags apm delete key

/********************************************************************* * Author:samson * date:05/19/2014 * Test PL Atform: * 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.

The real-time clock (RTC) unit can be run with a standby power supply when the system is powered off. The data contains the time, that is, the seconds, minutes, hours, dates, days, months, and years. The RTC operation is driven by an external 32.768kHz crystal and can perform alarm functions.

To master Standby and hibernate, you must first understand the following two knowledge: ACPI and APM.
1. What is ACPI
ACPI is an abbreviation for the Advanced Configuration and Power Interface, which is an industry standard developed jointly by Microsoft, Intel and Toshiba, in Chinese meaning "high profile and Power interface".

ACPI primarily implements the following features:
① users can make the computer at the specified time on and off;
② Plug and Play devices can be controlled and powered by ACPI when plugged in;
③ can put the computer into hibernation when no one is using the computer, but ensure that some communication devices are turned on;
The ④ operating system can allocate energy to peripherals and motherboard specific requirements;
The ⑤ operating system can reduce the clock frequency when the application does not have a high time requirement;
⑥ users who use laptops can specify that the computer enters a low-power state at low voltages to ensure that critical applications run.

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 properly, all hardware devices are in the state of open or normal operation;
S1: Also known as POS (Power on SUSPEND,CPU stops working), other hardware devices still work properly;
S2: The CPU is turned off, but the remaining hardware devices are still running;
S3: usually called STR (Suspend to RAM, hangs to memory), writes the running data to the memory and shuts down the hard disk;
S4: Also known as STD (Suspend to disk, hangs to hard disk), memory information is written to the hard disk, then all parts stop working;
S5: All hardware devices (including power supplies) are turned off, that is, shutdown.

2. What is APM
APM is actually an acronym for Advanced Power Manager, which is a management mode for controlling and managing the power of a computer's hardware through the operating system, in fact a set of computer power management programs (software) with different versions and features, such as APM V1.0 &v1.1, these two versions are performed directly by the BIOS for power management, while APM V1.2 can define power management through the operating system before being executed by the BIOS.
In today's popular operating system, all built-in APM, and in the previous DOS era, APM is not really introduced to the operating system, so can not perform standby, hibernation and other operations, restart can only use the Ctrl+alt+delete key combination or power of the reset key.


S1 =>standby. This means that the system is in a low power supply state, and in the Windows or BIOS, the output of the screen signal is closed, the hard disk stops running into the standby state, and the power light is in blink flashing state. You can wake the computer when you move a mouse, or any key on the keyboard.
  
S2 =>power Standby. And S1 are almost the same.
  
S3 =>suspend to RAM. This is to save all the information in the memory of Windows now, and then enter the "Fake machine". This time, in addition to the memory needs of the source to maintain the information, the other equipment, equipment, all stop the electricity. In other words, the theory can take the CPU, PCI, AGP device, and plug it back in, the computer may be the normal completion of the machine and operation, as long as not to the memory and the source of the part. There was only one blink of electricity at this time, and nothing else was the same as the machine. (The fan of the power supply also stops running.) When you re-open, the computer simply acknowledges the integrity of the memory and immediately returns to the front of your S3.
  
S4 =>suspend to Disk. is to put the information in Windows memory intact in the hard disk. You can read the memory directly from the place where you left it, and you don't need to run a bunch of applications. With this model, the hard drive must totem out a complete continuous space. Windows 98/se must use software to make a big file or a magnetic area to provide win98/se S4 this function, WINME/2000/XP itself has made a big file for the S4 function (there is a startup sleep in the power management, this is it). After the activation, under C: You'll see a big file with the size of your computer's memory.
  
S5 =>shutdown .... It doesn't have to be said!
  
S1/S3 is called "Standby or standby" "in Windows, so there's an option in the BIOS that says standby mode is S1 or S3, so. S1 and S3 are not available at the same time. Either S1,S4,S5 or S3,S4,S5.

S1, S2: Standby, can be awakened by mouse, keyboard, low power saving;
S3: Suspend, is to save all the current running environment to memory, and the shutdown of the hard disk and other devices all stop power, must be by the device's Start button wake-up to load;
S4: Hibernate, after saving all the current running environment to the hard disk, just RTC processor power, and RTC is based on the BIOS battery-powered, so in the power-saving is the same as the shutdown, when the wake-up time set or press the power button again, from the hard drive to load the saved environment into memory, This is the state before hibernation, which facilitates quick recovery to the last working environment.

The Gnu/linux system provides the Rtcwake command for the above 5 modes:
Dormancy:
The computer enters sleep mode and automatically wakes up after 2 hours (7,200 seconds)
sudo rtcwake-m disk-s 7200

Wake up at 10:45 this time
sudo rtcwake-m disk-t ' date-d 10:45 +%s '

Will let the system into the S3, sleep 20 seconds and then automatically wake up.
sudo rtcwake-v-S 20-m mem

The parameters after-M can be viewed in the mode supported under the system:
[Email protected]:~$ cat/sys/power/state
Standby MEM Disk

Visible is support for the above three modes. More about Rtcwake please gnu/linux man under the sun.


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.