Power Management


Power management is defined as the capability of the system to automatically enter power-conserving modes during periods of inactivity. Two main classes of power management exist. The original standard was called Advanced Power Management ( APM ) and has been supported by most systems since Intel first released the 386 and 486 processors. More recently, a new type of power management called Advanced Configuration and Power Interface (ACPI) was been developed and began appearing in systems in 1998. Most systems sold in 1998 or later support the more advanced ACPI type of power management. In APM, the hardware does the actual power management, and the operating system or other software has little control. With ACPI, the operating system and BIOS now handle the power management instead of the hardware. This makes the control more centralized and easier to access, and it enables applications to work with power-management functions.

Various components in a computer do not need to run continuously while the system is turned on. Mobile systems often conserve battery power by shutting down these components based on the activities of the user . If, for example, you open a text file in an editor and the entire file is read into memory, there is no need for the hard drive to spin while you are working on the file.

After a certain period of inactivity, a power-management system can park the hard drive heads and stop the platters from spinning until you save the file to disk or issue any other command that requires drive access. Other components, such as floppy and CD-ROM drives and PC cards, can also be powered down when not in use, resulting in a significant reduction of the power needed to run the system.

Most portables also have systemic power-saver modes that suspend the operation of the entire system when it is not in use. The names assigned to these modes can differ, but there are usually two system states. They differ in that one continues to power the system's RAM whereas the other does not. Typically, a "Suspend" mode shuts down virtually the entire system (except for the memory) after a preset period of inactivity. This requires only a small amount of power and allows the system to be reawakened in a few seconds, rather than having to go through the complete boot process. When in this "Standby" mode, the memory is maintained by the main battery, or the standby battery if the main battery is dead or you are changing the main battery. The standby battery usually powers the RAM for a few minutes to a few hours or more in some models. For this reason, it is important that you save any work before suspending the system.

Portable systems usually have a "Hibernate" mode as well, which writes the current contents of the system's memory to a special file on the hard disk and then shuts down the system, erasing memory in the process. The Hibernate mode does not require any power from either the main or standby batteries, so a system can theoretically hibernate indefinitely. When the computer is reactivated (powered up), it reads the contents of the hibernation file back into memory, restoring the system to exactly the condition it was in when hibernation started, and then work can continue. The reactivation process takes a bit longer than a normal resume from Suspend mode, but the system conserves more power by shutting down the memory array. Either mode is much faster than cold-booting the system.

Note

The memory swap file used for Hibernate mode might, in some machines, be located in a special partition on the hard drive dedicated to this purpose. If you inadvertently destroy this partition, you might need a special utility from the system manufacturer to re-create the file. Newer operating systems such as Windows Me, 2000, and XP create their own hibernation files.


In most cases, these functions are defined by the APM standard, a document developed jointly by Intel and Microsoft that defines an interface between an operating system's power-management policy driver and the hardware-specific software that addresses devices with power-management capabilities. This interface is usually implemented in the system BIOS.

Advanced Power Management

Advanced Power Management (APM) is a specification jointly developed by Intel and Microsoft that defines a series of interfaces between power management “capable hardware and a computer's operating system. When it is fully activated, APM can automatically switch a computer between five states, depending on the system's current activity. Each state represents a further reduction in power use, accomplished by placing unused components into a low-power mode. The five system states are as follows :

  • Full On ” The system is completely operational, with no power management occurring.

  • APM Enabled ” The system is operational, with some devices being power-managed. Unused devices can be powered down and the CPU clock slowed or stopped .

  • APM Standby ” The system is not operational, with most devices in a low-power state. The CPU clock can be slowed or stopped, but operational parameters are retained in memory. When triggered by a specific user or system activity, the system can return to the APM Enabled state almost instantaneously.

  • APM Suspend ” The system is not operational, with most devices unpowered. The CPU clock is stopped and operational parameters are saved to disk for later restoration. When triggered by a wakeup event, the system returns to the APM Enabled state relatively slowly.

  • Off ” The system is not operational. The power supply is off.

APM requires support from both hardware and software to function. Newer systems incorporate software-controlled power-on and power-off capability built in to the hardware. Manufacturers are also integrating the same sort of control features into other system components, such as motherboards, monitors , and disk drives.

Operating systems that support APM trigger power-management events by monitoring the activities performed by both the computer user and the applications running on the system. However, the OS does not directly address the power-management capabilities of the hardware.

A system can have many hardware devices and many software functions participating in APM functions, which makes communication difficult. To address this problem, both the operating system and the hardware have an abstraction layer that facilitates communication between the various elements of the APM architecture.

The operating system runs an APM driver that communicates with the various applications and software functions that trigger power-management activities, while the system's APM-capable hardware devices all communicate with the system BIOS. The APM driver and the BIOS communicate directly, completing the link between the OS and the hardware.

Therefore, for APM to function, support for the standard must be built in to the system's individual hardware devices, the system BIOS, and the operating system (which includes the APM driver). Without all these components, APM activities cannot occur.

Advanced Configuration and Power Interface

As power-management techniques continue to develop, maintaining the complex information states necessary to implement more advanced functions becomes increasingly difficult for the BIOS. Therefore, another standard has been developed by Intel, Microsoft, and Toshiba called Advanced Configuration and Power Interface (ACPI) , which is designed to implement power-management functions in the operating system. Microsoft Windows 98, Me, 2000, and XP automatically use ACPI if ACPI functions are found in the system BIOS when these operating systems are first installed. The need to update system BIOSes for ACPI support is one reason many computer vendors have recommended performing a BIOS update before installing Windows 98, Me, 2000, or XP.

If your BIOS and operating system support ACPI, full power-management control is now done by the operating system rather than by the BIOS. ACPI is intended to offer a single place for power-management and system-configuration control; in the past, with APM you would often be able to configure power-management settings in the BIOS setup as well as the operating system. This has often resulted in settings that overlap or conflict with each other. ACPI is supported in newer systems in lieu of APM.

Tip

If, for any reason, you find that power-management activities cause problems on your system, such as operating system freeze-ups or hardware malfunctions, the easiest way to disable APM is through the system BIOS. Most BIOSes that support APM include an option to disable it. This breaks the chain of communication between the operating system and the hardware, causing all power-management activities to cease . Although you also can achieve the same end by removing the APM driver from the operating system, Windows 9x's Plug and Play (PnP) feature detects the system's APM capabilities whenever you restart the computer and attempts to reinstall the APM driver.

If you have a newer system with ACPI, you can disable the power-management settings via the Power Management icon in the Windows control panel.


Placing power management under the control of the OS enables a greater interaction with applications. For example, a program can indicate to the operating system which of its activities are crucial, forcing an immediate activation of the hard drive, and which can be delayed until the next time the drive is activated for some other reason. For example, a word processor may be set to automatically save files in the background, which an OS using ACPI can then delay until the drive is activated for some other reason, resulting in fewer random spin-ups of the drive.

ACPI goes far beyond the previous standard, Advanced Power Management (APM), which consisted mainly of processor, hard disk, and display control. ACPI not only controls power but also all the Plug and Play hardware configuration throughout the system. With ACPI, system configuration (Plug and Play) and power-management configuration are no longer controlled via the BIOS setup; they are instead controlled entirely within the operating system.

ACPI enables the system to automatically turn internal peripherals on and off (such as CD-ROM drives, network cards, hard disk drives, and modems) as well as external devices such as printers, monitors, or any devices connected to serial, parallel, USB, video, or other ports in the system. ACPI technology also enables peripherals to turn on or wake up the system. For example, a telephone answering machine application can request that it be able to respond to answer the telephone within 1 second. Not only is this possible, but if the user subsequently presses the power or sleep button, the system will only go into the deepest sleep state that is consistent with the ability to meet the telephone answering application's request.

ACPI enables system designers to implement a range of power-management features that are compatible with various hardware designs while using the same operating system driver. ACPI also uses the Plug and Play BIOS data structures and takes control over the Plug and Play interface, providing an operating system “independent interface for configuration and control.

ACPI defines several system states and substates . There are four Global System states labeled from G0 through G3, with G0 being the fully operational state and G3 being mechanically turned off. Global System states are immediately obvious to the user of the system and apply to the entire system as a whole. Within the G0 state, there are four CPU Power states (C0 “C3) and four Device Power states (D0 “D3) for each device. Within the C0 CPU Power state there are up to 16 CPU Performance states (P0 “P15).

Device power states are states for individual devices when the system is in the G0 (Working) state. The device states may or may not be visible to the user. For example, it may be obvious when a hard disk has stopped or when the monitor is off; however, it may not be obvious that a modem or other device has been shut down. The device power states are somewhat generic; many devices do not have all four power states defined.

Within the G1 Global Sleep state, there are four Sleep states (S1 “S4). The G2 Global Soft Off state is also known as the S5 Sleep state , in which case the system is powered off but still has standby power. Finally, G3 is the Mechanical Off state, where all power is disconnected from the system.

The following list shows the definitions and nested relationship of the various Global, CPU/Device Power, and Sleep states:

  • G0 Working ” This is the normal working state where the system is running and fully operational. Within this state, the Processor and Device Power states apply. The Device Power states are defined as follows:

    • G0/D0 Fully-On ” The device is fully active.

    • G0/D1 ” Depends on the device; uses less power than D0.

    • G0/D2 ” Depends on the device; uses less power than D1.

    • G0/D3 Off ” The device is powered off (except for wake-up logic).

      The Processor Power states are defined as follows:

    • G0/C0 CPU On ” Normal processor operation.

    • G0/C1 CPU Halted ” The processor is halted.

    • G0/C2 CPU Stopped ” The clock has been stopped.

    • G0/C3 CPU/Cache Stopped ” The clock has been stopped and cache snoops are ignored.

  • G1 Sleeping ” The system appears to be off but is actually in one of four Sleep states ”up to full hibernation. How quickly the system can return to G0 depends on which of the Sleep states the system has selected. In any of these Sleep states, system context and status is saved such that it can be fully restored. The Sleep states available in the Global G1 state are defined as follows:

    • G1/S1 Halt ” A low-latency idle state. The CPU is halted; however, system context and status is fully retained.

    • G1/S2 Halt-Reset ” Similar to the S1 sleeping state except that the CPU and cache context is lost, and the CPU is reset upon wakeup.

    • G1/S3 Suspend to RAM ” All system context is lost except memory. The hardware maintains memory context. The CPU is reset and restores some CPU and L2 context upon wakeup.

    • G1/S4 Suspend to Disk (Hibernation) ” The system context and status (RAM contents) have been saved to nonvolatile storage ”usually the hard disk. This is also known as Hibernation . To return to G0 (working) state, you must press the power button, and the system will restart, loading the saved context and status from where it was previously saved (normally the hard disk). Returning from G2/S5 to G0 requires a considerable amount of latency (time).

  • G2/S5 Soft Off ” This is the normal power-off state that occurs after you select Shutdown or press the power button to turn the system off. The system and all devices are essentially powered off; however, the system is still plugged in and standby power is coming from the power supply to the motherboard, allowing the system to wake up (power on) if commanded by an external device. No hardware context or status is saved. The system must be fully rebooted to return to the G0 (working) state.

  • G3 Mechanical Off ” Power is completely removed from the system. In most cases this means the system must be unplugged or the power turned off via a power strip. This is the only state in which it is save to disassemble the system. Except for the CMOS/Clock circuitry , power consumption is completely zero.

Figure 7.4 shows the relationships between the various ACPI Global, Device/CPU, and Sleep states.

Figure 7.4. ACPI Global, Device/CPU, and Sleep states.

graphics/07fig04.gif

In normal use, a system alternates between the G0 (Working) and G1 (Sleeping) states. In the G1 (Working) state, individual devices and processors can be power managed via the Device Power (D1 “D3) and Processor Power (C1 “C3) states. Any device that is selectively turned off can be quickly powered on in a short amount of time, from virtually instantaneous to only a few seconds (such as a hard disk spinning up).

When the system is idle (no keyboard or mouse input) for a preset period of time, the system enters the Global G1 (Sleeping) state, which means also selecting one of the S1 “S4 sleep states. In these states the system appears to be off, but all system context and status are saved, enabling the system to return to exactly where it left off, with varying amounts of latency. For example, returning to the G0 (Working) state from the G1/S4 (Hibernation) state requires more time than when returning from the G1/S3 (Suspend) state.

When the user presses the power button to turn the system off, or if he or she selects Shutdown via the operating system, the system enters the G2/S5 (Soft Off) state. In this state no context is saved, and the system is completely off except for standby power. Fully disconnecting AC or battery power causes the system to be in the Global G3 (Mechanical Off) state, which is the only state in which the system should be disassembled.

During the system setup and boot process, ACPI performs a series of checks and tests to see whether the system hardware and BIOS support ACPI. If support is not detected or is found to be faulty, the system typically reverts to standard Advanced Power Management control, which is referred to as legacy power management under ACPI. If problems with power management are detected during bootup , the system may lock up with either a red or blue screen showing an ACPI error code.

A red screen indicates that the problem is probably related to hardware or the BIOS. A blue screen indicates that the problem is probably related to software or is an obscure problem. The ACPI error codes are described in Table 7.3.

Table 7.3. ACPI Error Codes

Error Code

Description

1xxx -

Indicates an error during the initialization phase of the ACPI driver and usually means the driver can't read one or more of the ACPI tables

2xxx -

Indicates an ACPI machine language (AML) interpreter error

3xxx -

Indicates an error within the ACPI driver event handler

4xxx -

Indicates thermal-management errors

5xxx -

Indicates device power-management errors

Virtually all these errors are the result of partial or incomplete ACPI implementations or incompatibilities in either the BIOS or device drivers. If you encounter any of these errors, contact your motherboard manufacturer for an updated BIOS or the device manufacturers for updated drivers.

APM BIOS Power Management Menu

Most of the BIOS Setup settings related to power management are for APM mode, which will be used only if you run legacy operating systems that are not ACPI aware. In APM mode, BIOS reduces power consumption by spinning down hard drives and reducing power to or turning off monitors that comply with Video Electronics Standards Association (VESA) and Display Power Management Signaling (DPMS). While in Standby mode, the system can still respond to external interrupts, such as those from keyboards, mice, fax/modems, and network adapters. For example, any keyboard or mouse activity brings the system out of Standby mode and immediately restores power to the monitor.

If both the motherboard BIOS and operating system support ACPI, the operating system uses ACPI to take over the power management, even overriding the APM BIOS settings.

Some systems feature a number of different power-management settings in their BIOSes, which are especially important if you are not using an ACPI-aware operating system. Some of the more common settings are shown in Table 7.4.

Table 7.4. Typical Power-Management Settings

ACPI Function

Select Enabled only if your operating system supports the ACPI specification. Windows 98 and all later versions support ACPI.

Power Management

This option enables you to select the type (or degree) of power saving for Doze, Standby, and Suspend modes. The following are the individual mode settings:

 

Max Saving ” Maximum power savings. Inactivity period is 1 minute in each mode.

 

User Define ” Set each mode individually. Select timeout periods in the section for each mode.

 

Min Saving ” Minimum power savings. Inactivity period is 1 hour in each mode (except the hard drive).

PM Control by APM

If Advanced Power Management (APM) is installed on your system, selecting Yes gives better power savings.

Video Off Method

Determines the manner in which the screen is turned blank.

V/H SYNC+Blank

The system turns off vertical and horizontal synchronization ports and writes blanks to the video buffer.

DPMS Support

Select this option if your monitor supports the DPMS standard of VESA. Use the software supplied for your video subsystem to select video power-management values.

Blank Screen

The system writes only blanks to the video buffer.

Video Off After

As the system moves from lesser to greater power-saving modes, select the mode in which you want the screen to turn blank.

MODEM Use IRQ

Name the IRQ line assigned to the modem (if any) on your system. Activity of the selected IRQ always awakens the system.

Doze Mode

After the selected period of system inactivity, the CPU clock throttles to a small percentage of its duty cycle: between 10% and 25% for most chipsets. All other devices still operate at full speed.

Standby Mode

After the selected period of system inactivity, the CPU clock stops, the hard drive enters an idle state, and the L2 cache enters a power-save mode. All other devices still operate at full speed.

Suspend Mode

After the selected period of system inactivity, the chipset enters a hardware-suspend mode, stopping the CPU clock and possibly causing other system devices to enter power-management modes.

HDD Power Down

After the selected period of drive inactivity, any system IDE devices compatible with the ATA-2 specification or later power-manage themselves, putting themselves into an idle state after the specified timeout and then waking themselves up when accessed.

Throttle Duty Cycle

When the system enters Doze mode, the CPU clock runs only part of the time. You can select the percentage of time the clock runs.

VGA Active Monitor

When enabled, any video activity restarts the global timer for Standby mode.

Soft Off by PWR-BTTN

When you select Instant Off or Delay 4 Sec., turning off the system with the On/Off button places the system in a very low power-usage state, either immediately or after 4 seconds, with only enough circuitry receiving power to detect power button activity or Resume by Ring activity.

CPUFAN Off in Suspend

When this setting is enabled, the CPU fan turns off during Suspend mode.

Resume by Ring

When this setting is enabled, an input signal on the serial Ring Indicator (RI) line (in other words, an incoming call on the modem) awakens the system from a soft off state.

Resume by Alarm

When this setting is enabled, you can set the date and time at which the real-time clock (RTC) alarm awakens the system from Suspend mode.

Date (of Month) Alarm

Select a date in the month when you want the alarm to go off.

Time (hh:mm:ss) Alarm

Set the time you want the alarm to go off.

Wake Up On LAN

When this setting is enabled, an input signal from a local area network (LAN) awakens the system from a soft off state.

IRQ8 Break [Event From]

You can select Enabled or SuspendDisabled for monitoring of IRQ8 (the real-time clock) so that it does not awaken the system from Suspend mode.

Reload Global Timer Events

When this setting is enabled, an event occurring on each device listed restarts the global timer for Standby mode:

IRQ3-7, 9-15, NMI

Primary IDE 0

Primary IDE 1

Secondary IDE 0

Secondary IDE 1

Floppy Disk

Serial Port

Parallel Port

Using the power-management settings in the BIOS Setup is especially useful if you are using an older operating system or one that is not ACPI aware, such as Windows 95, DOS, or Linux. If you are using an ACPI-aware operating system such as Windows 98/Me, 2000, or XP, it is better to control the power-management settings through the OS. Many laptop systems also include their own custom supplemental utility software for power management or control, which can add to the operating system ACPI control.



Upgrading and Repairing Laptops
Scott Muellers Upgrading and Repairing Laptops, Second Edition
ISBN: 0789733765
EAN: 2147483647
Year: 2003
Pages: 182
Authors: Scott Mueller

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net