A mechanism is provided for a personal computer to preserve user and
system state data in the event of an AC power failure when the computer
is in a standby state. When the AC power failure occurs, a switchover
circuit connects a rechargeable energy storage medium, such as a
rechargeable battery, to the power supply of the computer for powering
components of computer, and the computer is awaken. A critical battery
alarm is then issued to trigger the operating system of the computer to
perform a transition into a hibernation state, during which the state
data of the computer are persistently stored. The energy storage medium
is disconnected from the power supply after the computer system has
entered hibernation.