Background

Modern power management is handled via ACPI, a spec designed by various companies (Microsoft, Intel, Phoenix, HP, etc). It contains information about the given system's hardware, including details on how to suspend/resume (and hibernate).

To use suspend, an operating system must first configure wake-up events (things like the power button, lid-button, etc). These are listed in /proc/acpi/wakeup (though it may not always list the power button). To toggle a given device, one can echo it to the file:

To enter suspend, the OS writes the desired state to /sys/power/state. Assuming the "mem" suspend, the kernel does the following:

Above the kernel layer, user-space must do work before handing off control to the above kernel procedures. Currently Ubuntu uses /etc/acpi/sleep.sh to enter/leave suspend mode. HAL makes calls to this script when reacting to various key presses or power management events. The goal is to move to pmutils in Hardy.

The call stack:

Bad packages (swsusp, hibernate) can interfere with /etc/acpi/sleep.sh, so make sure they are purged.

/sys/power/state

Debugging


CategoryDocumentation

UnderstandingSuspend (last edited 2011-06-22 19:00:46 by iriserv)