As electronic data processing devices such as personal computers become more complex, the time required to activate these devices continues to grow. Booting a computer from a completely powered down state is a common example. The time required to load an operating system and various applications into RAM and initialize those programs increases as the complexity of the operating system and applications increase. Many users find extended boot cycle times to be frustrating.
“Sleeping” power states offer a partial solution to this problem. Instead of completely shutting down a computer so as to require a full OS reboot when returning the computer to a working state, various intermediate power-down states can be invoked. Returning a computer to a fully active state from one of these intermediate states is generally faster than a reboot. Various system states are defined in the Advanced Configuration Power Interface Specification (revision 3.0)(“ACPI specification”), available from <http://www.acpi.info/>, incorporated by reference herein for purposes of illustrating the state of the art. In a G0 (or working) state, the computer is executing user-made application threads and is responding to external events in real time. State S3 is defined as a low-latency sleeping state. Power is removed from the CPU (central processing unit), cache and chipset in an S3 state, but is maintained to system memory (RAM). Returning the computer to a G0 state (or “waking” the computer) is relatively fast, as previous programming context is still in RAM. State S4 is defined as a lower-power, longer wake-latency sleep state. When entering an S4 state, current platform context (e.g., system and programming settings) is saved from RAM to the hard drive, and power is then removed from the RAM, CPU, cache and chipset. When the system is returned to G0 from S4, platform context is restored from the hard drive without rebooting the OS. Waking from S4 requires more time than waking from an S3 state, but less time than an OS reboot. State S5 is defined as a “soft” off state. Context is not saved from RAM to the hard drive, and a complete OS reboot is necessary for returning to a G0 state.
Although it might first seem that state S3 is preferable to state S4 when putting a computer to sleep, this is not always the case. If a computer were to suddenly lose power when in an S3 state, data could be lost. Because program data has not been saved from RAM to a hard drive (or other nonvolatile storage), that data could be lost if power to RAM were suddenly lost. This could occur, for example, if the computer's battery were to run out of power faster than expected. Some hardware vendors offer a “hibernate fail safe” feature in order to reduce this risk. The hibernate fail safe feature monitors battery power when the computer is in an S3 state. When battery power drops below a certain level, the fail safe wakes the computer and then places the computer in an S4 state. A “doze time out” algorithm is another mechanism used to avoid data loss. A doze time out algorithm measures the amount of time a computer has been in an S3 state. After a preset amount of time (the doze time out) expires, the computer is placed in an S4 state.
Despite these advances, many challenges remain. Many computer users do not take the time to determine which sleep mode may be the best choice for a particular set of system conditions. The user may not know if his or her system has a hibernate fail safe algorithm. Indeed, the user may be unaware that S3 or S4 states are even available. Although automating the selection of sleeping states would be desirable, doing so presents numerous difficulties to an operating system developer. An operating system will typically be used with many different computer manufacturers' products; some of those products may support hibernate fail safe, but some will not. The products may have different power consumption characteristics when in an S3 state, thus affecting the time during which a particular computer could be safely left in S3. Products may be used with different types of batteries having different capacities. A user may operate a particular computer in a variety of manners. For example, a laptop computer could be used with the AC adapter attached, and with the battery removed.
For these and other reasons, there remains a need for systems and methods to automatically select a power state for a computer or other device.