acpi-apm V0.1

What is this?

acpi-apm is a Linux kernel module that simulates the output from /proc/apm on systems that have ACPI, not APM, for power management. Why is this useful? A great deal of software uses /proc/apm to determine the power status, include the Gnome panel applets. There are equivalents for ACPI, but they never seem to work very well. With this module, it appears to applications like Gnome that APM is in charge.

Please note that it does not simulate the control features of APM, only the monitoring. You won't be able to use this module to give you a suspend-to-RAM feature if your kernel doesn't support it through ACPI.

acpi-apm works by intercepting reads made on /proc/apm, determining the power status from the ACPI BIOS, then simulating the APM values based on the ACPI values. You need to have ACPI support compiled into your kernel and working before using the module.

What kernels does it work with?

This module has only been tested on a 2.4.18 kernel, with ACPI patch 20020918-2.4.18. It may work with other kernels and other ACPI patches: your mileage may vary. I would be happy to hear about problems if it doesn't work: please send a full output from the compiler or a kernel stack dump or whatever is appropriate.

Compiling and installing

Unpack the archive and run make. If it doesn't compile, e-mail me. The compilation should generate the file acpi-apm.o. Load this into the kernel by doing insmod acpi-apm.o. That's it. If you do a cat /proc/apm you should see some numbers in decimal and hex. If you get a segmentation fault, e-mail me. How you get the module loaded at boot time is up to you: rc script or whatever.

Bugs and limitations

Author and legal

This kernel module was written by Kevin Boone and is (c)2002, distributed according to the GPL. Some parts are (c)2002 Intel Corporation, also distributed according to the GPL. You may do whatever you like with this code, provided that this authorship continues to be acknowledged and source code remains available. Needless to say, there is no warranty of any kind, and you use this at your own risk. Please report bugs, etc., to kb@kevinboone.com.