Linux operating system, Advanced Power Management

  




under Windows we have the power management system is very familiar with, we can achieve STR, STD and other functions through the motherboard's advanced power management module. For laptop users to use advanced power management, let the laptop sleep, saving battery is even more important. The implementation of these features on the Windows platform may not be difficult for us. But if you switch to Linux, I am afraid that few people know about it. Today we will introduce the implementation of power management under the Linux operating system. Since many servers use Linux, the importance of power management becomes apparent.


In x86 machines, there are two power management methods: APM (Advanced Power Management) and ACPI (Advanced Configuration and Power Interface). APM is the old standard, and ACPI provides a more flexible interface for managing computers and devices. Linux supports both protocols, but sometimes it requires manual configuration. In addition, the two standards cannot be run at the same time. By default, Linux runs ACPI.

APM allows you to put your machine in a Suspend or Standby state and check the battery capacity. ACPI also allows you to power off peripherals (such as monitors, graphics cards, PCI buses) and have more control over energy savings. In order for the power management function to take effect, you need to open it in the BIOS and Linux kernel, and load the necessary application software in Linux.

Checking whether the system supports power management

In the newer core, support for ACPI and APM is included. In general, ACPI is active. Use dmesg to check:

dmesg | Egrep -i '(apm| Acpi)'

Kernel command line: vga=274 quiet console=ttyS3,9600acpi=no-idleoot=/dev/hda3

ACPI: Core Subsystem version [20010208]

ACPI: Subsystem enabled

ACPI: System firmware supports: C2

ACPI: plvl2lat=99 plvl3lat=1001

ACPI: C2 enter=1417 C2 exit=354

ACPI: C3 enter=-1 C3 exit=-1

ACPI: Not using ACPI idle

ACPI: System firmware supports: S0 S1 S4 S5

In addition, systems that support ACPI will also add a directory of /proc/sys/acpi. If it exists, it means that the core has loaded the ACPI driver.

Specific application examples

It is recommended to use the latest core (eg 2.4.5). Because the old core support features less, and the core of 2.2.x is to support ACPI, and there are very few features.

1. Advanced Power Management

APM applications include: apmd (APM's background server) and other applications (such as APM). It is recommended to find the latest version for your use at rpmfind.net. After installing and running OK, we can test the APM command.

The simplest use of APM is to display the battery capacity in the machine.

APM

AC on-line, no system battery

If APM is not supported, “No APM support in core” is displayed. At this time, first check if there is /proc/apm. If not, check if you are running the core after installing APM. If you have APM as a module, check if the module is loaded. Apm can also enter the Standby and Suspend states with -S/-s.


Figure 1

Figure 1 is the KDE system interface, which uses APM to check the battery capacity, and can also manage the energy-saving mode of other hardware (Figure 2), and display it in the taskbar. . Further knowledge can be found at www.linuxdoc.org.

2, ACPI

Linux has good support for ACPI, and related documents are more than APM.

ACPI's authoritative website http://phobos.fs.tum.de/acpi/, which includes two content in the download bar: acpid and pmtools, which can better optimize and manage ACPI.


Figure 2

There is a command in Pmtools that is Pmtest, which lets you detect devices. In general, it displays ACPI devices in your system and allows you to "hang" or "standby" them. It must be run as root.

/pmtools/pmtest

VGA (D0)

keyboard (D0)

PCI 0x0 (D0)

system 0x0 ( D0)

It seems that the VGA display, keyboard, PCI bus and system are all recognized as ACPI devices. Their status is D0, which is the active state. We can set the status to D1/D2 (power consumption minimized) or D3 (completely off). For example:

/pmtools/pmtest -d1 VGA

The display should now be black. This does not stop the video card from generating a video signal (the display also indicates an input signal), but simply turns the signal all black. /pmtools/pmtest -d0 VGA can be restored.

Above we just gave a few examples, you can give you a third-hand, manage your system and give full play to advanced voltage management functions.




Copyright © Windows knowledge All Rights Reserved