A laptop computer system executes automatic battery calibration to improve
the accuracy of the battery's internal charge monitor. The calibration
procedure drains the battery to approximately 0% of charge capacity during
normal computer operation, permitting a user to operate the computer
without risking power failure when the battery discharges. The computer
returns to normal operation if either the AC power or the battery is
removed. During the calibration procedure, the computer system prevents
power management software from forcing shut down before the battery
completely drains.