Some of the power saving functions are performed by the APM BIOS itself. On many laptops, standby and suspend states can be activated with key combinations or by closing the lid, without any special operating system function. However, to activate these modes with a command, certain actions must be triggered before the system is suspended. To view the battery charge level, you need a suitable kernel and the respective packages.
By default, APM support is integrated in the kernels shipped with SUSE LINUX. However, APM is only activated if no ACPI is implemented in the BIOS and an APM BIOS is detected. To activate APM support, ACPI must be disabled with acpi=off at the boot prompt. Enter cat /proc/apm to check if APM is active. An output consisting of various numbers indicates that everything is OK. You should now be able to shut down the computer with the command shutdown -h.
Strange things may happen if the BIOS implementation does not fully comply with the standard. Some problems can be circumvented with special boot parameters (formerly kernel configuration options). All parameters are entered at the boot prompt in the form apm=<parameter>:
Enable or disable APM support.
Allow interrupts during the execution of BIOS functions.
The “GetPowerStatus” function of the BIOS does not work properly.
Reset processor to real mode prior to shutdown.
Log APM events in system log.
Power system off after shutdown.
Time in hundredths of a second after a suspend event during which additional suspend events are ignored.
System inactivity percentage from which the BIOS function idle is executed (0=always, 100=never).
Time in hundredths of a second after which the system activity is measured.
The apmd daemon (package apmd) monitors the battery and can trigger certain actions when a standby or a suspend event occurs. Although it is not mandatory for operation, it may be useful for some problems.
apmd is not started automatically when the system is booted. If you want it started automatically, edit the settings for the system services with the YaST runlevel editor. Alternatively, use the chkconfig utility. The daemon can be started manually with the command rcapmd start.
A number of configuration variables are available in /etc/sysconfig/powermanagement. As the file is commented, only some information is provided here:
Adapts the disk performance to the power supply status. This can be done with a number of additional variables beginning with APMD_BATTERY (for battery operation) or APMD_AC (for AC operation).
Disk inactivity period after which the disk is spun down. The values are described in Section 17.4. “Rest for the Hard Disk” or in the manual page for hdparm, option -S.
Interval between two cycles of the kernel update daemon.
Maximum age of buffered data.
Maximum fill level of the hard disk buffer.
Although PCMCIA is implemented with APM support, difficulties may sometimes be encountered. Some card drivers do not resume correctly after a suspend (xirc2ps_cs). Therefore, apmd can deactivate the PCMCIA system prior to the suspend and reactivate it afterwards. To do this, set this variable to yes.
Set network interfaces to stop prior to a suspend and restart afterwards.
Use this variable if you also need to unload the driver modules of these interfaces.
Sometimes, resuming after a suspend may not work if an IDE device (hard disk) is still in DMA mode.
Other options include the possibility to correct the key repeat rate or the clock after a suspend or to shut down the laptop automatically when the APM BIOS send a “battery critical” event. To execute special actions, adapt the script /usr/sbin/apmd_proxy (performs the tasks listed above) to your needs.
apmd contains a number of useful tools. apm can be used to query the current battery charge level and to set the system to standby (apm -S) or suspend (apm -s). Refer to the manual page of apm. The command apmsleep suspends the system for a specified time. To watch a log file without keeping the hard disk spinning, use tailf instead of tail -f.
There are also tools for the X Window System. apmd contains the graphical utility xapm for displaying the battery charge level. If you use the KDE desktop or at least kpanel, use kbatmon to view the battery charge level and suspend the system. xosview is another interesting alternative.