Power Management

Power management implementation in Windows 2000 and Windows XP is an integrated approach to power management within the whole computer system (for both hardware and software). This means that the computer system supporting power management must include both hardware and software support for the following functions:

  • Minimum time expenses for startup and shutdown. This means that the system may stay in a hibernation state as long as necessary. It may "wake up" from this mode very quickly (this doesn't require rebooting).

  • Efficient and economic power consumption, increase of the working life of the hardware. Devices consume power only when they process a system request or perform operations requested by the user. Devices that aren't in use during the specified time period are switched to a "sleeping" state, and subsequently "wake-up" as needed.

  • Silent operation.

Requirements to the power-aware hardware and software are defined by the OnNow initiative. Windows XP provides this support, and both the PC as a whole and each individual device consume minimum power (if the hardware meets the OnNow requirements). Notice that power management and PnP are interrelated and depend on each other.

This approach provides the following advantages:

  • Intellectual behavior of the system. The operating system and applications work together to operate the PC, delivering effective power management in accordance with your current needs. For example, applications won't inadvertently keep the PC busy when it isn't necessary; instead, they'll proactively participate in shutting down the PC to conserve energy and reduce noise.

  • Improved robustness and reliability.

  • Higher level of integration.

By using the Power Options applet in the Control Panel, it's possible to decrease energy consumption for any device installed in the system. However, you can only achieve this if you have an ACPI-compliant computer system.

The Power Schemes Tab

To start the Power Options applet, proceed as follows:

  1. From the Start menu, select Settings | Control Panel. Double-click Power Management.

  2. The Power Options Properties window will appear (Fig. 5.11).

    click to expand
    Fig. 5.11: The Power Schemes tab of the Power Options Properties window

  3. To reduce the power consumption of your computer devices, or of your entire system, choose a power scheme, which is a collection of settings that manage the power usage of your computer. You can select one of the existing power schemes or create a user-defined power scheme. For example, depending on your hardware, you can do the following:

    • Specify the conditions where the system will automatically turn off your monitor and hard disks to save power.

    • Put the computer on standby if it's idle for a long period of time. While on standby, your entire computer switches to a low power state, where devices such as the monitor and hard disks turn off and your computer uses less power. When you want to use the computer again, it comes out of standby quickly, and your desktop is restored exactly as you left it. Standby is particularly useful for conserving battery power in portable computers.

    • Put your computer in hibernation The hibernate feature saves everything in memory on disk, turns off your monitor and hard disk, and then turns off your computer. When you restart your computer, your desktop is restored exactly as you left it. It takes longer to bring your computer out of hibernation than out of standby.

Table 5.2 lists the registry keys that you can modify using the Power Schemes tab of the Power Management Properties window.

Table 5.2: Registry Keys Modified Using the Power Schemes Tab Controls

Power Schemes option

Registry key


Power schemes

HKCU\Control\Panel\PowerCfg\CurrentPowerPolicy

Standby detection threshold values (for the system, monitor, hard disk—System hibernates, Turn off monitor, Turn off hard disks fields, respectively)

Binary-encoded parameters
HKCU\Control Panel\PowerCfg\PowerPolicies\n\Policies

Deleting the power scheme (the Delete button)

Deletes the following key
HKCU\Control Panel\PowerCfg\PowerPolicies\n\Policies
Decreases the following index counter:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\LastID

Adding new power scheme (the Save As button)

Adds new subkey under the following key:
HKCU\Control Panel\PowerCfg\PowerPolicies\n\Policies
Increases the following index counter:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\LastID

Usually, you need to turn off your monitor or hard disk for a short period of time to conserve power. The most convenient mode for this is the standby mode, which puts your entire system in a low-energy state.

The Hibernate Tab

Besides the standby mode, the Power Options applet allows you to put your system into hibernation mode. As I already mentioned, the hibernate feature saves everything in memory on disk, turns off your monitor and hard disk, and then turns off your computer. After rebooting the system, your desktop is restored exactly as you left it. It takes longer to bring your computer out of hibernation than out of standby.

If you're planning to be away from your computer for any length of time, I recommend that you put the system into hibernation. To activate hibernation support, proceed as follows:

  1. Open the Power Options Properties window and go to the Hibernate tab (Fig. 5.12). If your system doesn't support this option, the tab will be unavailable.

    click to expand
    Fig. 5.12: The Hibernate tab of the Power Options Properties window

  2. Set the Enable hibernate support checkbox. Please note that when your computer is set to hibernation, everything in the physical memory is saved to the hard disk. Because of this, you need to have sufficient disk space on the hard disk (the file storing memory dump will be as large as your RAM memory)

After hibernation support is activated, the What do you want the computer to do? list in the Shut Down Windows dialog will contain a new option—Hibernate, which allows you to put the computer into hibernation manually (Fig. 5.13).

click to expand
Fig. 5.13: When you enable hibernation support, the Shut Down Windows window will display a new option—Hibernate, allowing you to put the system to hibernation manually

The Advanced Tab

The Advanced tab of the Power Options Properties window (Fig. 5.14) allows you to do the following:

click to expand
Fig. 5.14: The Advanced tab of the Power Options Properties window

  • Enable and disable the power options indicator on the taskbar (Fig. 5.15). This indicator is a small icon that provides quick access to the Power Options applet.


    Fig. 5.15: The taskbar indicator provides quick access to the Power Options applet

  • Enable and disable password protection for the standby mode.

Registry keys that correspond to the parameters set using this tab are listed in Table 5.3.

Table 5.3: Registry Keys Modified by Setting Parameters of the Advanced Tab

Advanced tab option

Registry key


Always show icon on the taskbar checkbox

HKCU\Control Panel\PowerCfg\GlobalPowerPolicy\Policies

Display a prompt for a password when the computer goes off standby checkbox

HKCU\Control Panel\ PowerCfg\GlobalPowerPolicy\Policies

The APM Tab

Advanced Power Management (APM) is the legacy scheme of power management based on the BIOS implementation adopted in Windows 95. Most of the interesting functionality for APM is in a machine-specific BIOS that's hidden from the operating system. At present, APM is a legacy solution that's been superseded by ACPI (Advanced Configuration and Power Interface). This is a robust scheme for power management and system configuration supported in the Windows 98 and Windows 2000/XP family of operating systems.

Note 

Microsoft strongly recommends that system designers build systems based on ACPI. This chapter provides only the basic information concerning this specification. The most complete and up-to-date information covering this topic is available at: http://www.microsoft.com/hwdev/OnNow.

However, Microsoft recognizes that while many machines have both ACPI and APM support, some only have APM support. APM support was included with Windows 2000/XP for providing backward compatibility, especially for the convenience of users who have legacy notebook computers.

APM should not be used if the machine or BIOS is on the Windows 2000/XP "Disable APM" list. The system will refuse to run APM on these machines, because Microsoft Development found that it does not work on them. Don't attempt to override this limitation.

You can try using APM if the system BIOS isn't ACPI-compliant or the ACPI BIOS isn't properly implemented.

Note 

On some machines, the APM BIOS may make the system unstable. Enabling APM support in Windows 2000/XP (using the Ntapm.sys driver) may correct the problem, since this puts the operating system more in sync with the system's APM BIOS.

The classes of APM systems under Windows 2000 and Windows XP are:

  • "AutoEnable APM". This indicates that the system passed testing at Microsoft and was placed on the "AutoEnable APM List" that Windows 2000 Setup checks before installing the operating system. Windows 2000 Setup will install and enable APM support automatically on these systems. This list includes the APM system/BIOS combinations that Microsoft believes are stable and ready to support APM while running Windows 2000/XP.

  • "Disable APM". This means that Microsoft has determined that APM doesn't work properly on the system. Microsoft placed entries for specific system/BIOS combinations on the Disable APM List that malfunctioned in testing when APM was turned on. For system/BIOS combinations on the Disable APM List, Windows 2000/XP Setup won't install or enable APM support. Notice that it may still be necessary to disable the APM BIOS using the machine's BIOS setup utility to make things reliable.

  • Neutral systems. This means that Microsoft doesn't know how well this system works with APM under Windows 2000/XP. Systems that aren't on the AutoEnable APM List or the Disable APM List are considered "neutral." In this case, Windows 2000/XP installs the Ntapm.sys software, but leaves it disabled. You can manually enable the APM support in Windows 2000/XP by using the Power Options applet in the Control Panel.

Note 

The only approved or supported method of activating or disabling APM support manually is to use the Power Options applet from Control Panel. To enable APM support, go to the APM tab of the Power Options Properties window (Fig. 5.16), and set the Enable Advanced Power Management support checkbox. Notice that turning APM support off requires a reboot. Turning APM on doesn't require a reboot.

click to expand
Fig. 5.16: The APM tab of the Power Options Properties window

APM support is included only with Windows 2000 Professional, Windows XP Professional, and Home Edition. APM support isn't allowed on server products. This means that the APM tab won't appear and that there's no APM support in Windows 2000 Server, Windows 2000 Advanced Server, or Windows 2000 DataCenter.

APM Keys in the Registry

The data on APM support collected by the hardware recognizer (Ntdetect.com) is stored in the registry under the following key: HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\MultifunctionAdapter.

This key contains a set of subkeys named 0, 1, 2, 3, and so on. Each of them will have value entries named Component Information, Configuration Data, or Identifier. Find the key whose Identifier entry has a value of "APM" (Fig. 5.17). The Configuration Data entry of that key will contain the data on APM found and reported by Ntdetect.com. If the key is absent, then APM wasn't found.

click to expand
Fig. 5.17: APM data in the registry

APM support is provided for Intel platforms only (the HAL version is Halx86.dll). This information is stored in the registry under the following key: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ApmLegalHal. If the HAL is Halx86.dll, this registry key will have a value entry present with data of 1.

The results of machine-specific detection versus Biosinfo.inf are stored in HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\BIOSInfo\APM. If the "Attributes" value is 1, the machine's APM BIOS is "known good" and the machine is on the AutoEnable APM list. If the value is 2, the machine's APM BIOS is "known bad" and the machine is on the Disable APM list. Otherwise, the machine is neutral.

If the machine is an ACPI machine, there will be a services entry for ACPI under (HKLM\System\CurrentControlSet\Services\ACPI) with a value of Start = 0. This is telling the system to load and run Acpi.sys at phase 0.

More detailed information on the boot process will be provided in Chapter 6.

If the ACPI key isn't present, the machine isn't being run as an ACPI machine, even if it should be.

The UPS Tab

If Uninterruptible Power Supply (UPS) is present in your system, it can also be managed via Power Options. To configure and manage the UPS service, start the Power Options applet in Control Panel, and go to the UPS tab (Fig. 5.18) This tab displays the current power status, details on your UPS equipment, and the current status of the UPS service.

click to expand
Fig. 5.18: The UPS tab of the Power Options Properties window

Windows 2000/XP Power Management Tools

Having already discussed the power management tools provided by the Windows 2000/XP operating system, let's now discuss the basic concepts that made it possible to implement these tools. Some of the concepts discussed in this section are applicable to both Windows 2000/XP and Windows 98.

The topics covered here includes:

  • Power management policies and power schemes

  • Parameters included into the power scheme

  • How power management settings specified by the Power Options Control Panel applet are stored in the registry

Power Schemes

Windows 2000/XP power management configuration is based on the concept of power schemes. A power scheme is a group of preset power options that are passed to the Power Policy Manager component of the operating system to control the machine's power management behavior.

Each power scheme consists of a global power policy structure and a power policy structure.

  • Global power policy structures contain preset power options that are global across all power schemes.

  • Non-global power policy structures contain power options that are unique to a particular power scheme.

These power policy structures are further divided into machine structures and user structures.

  • Values in machine structures are stored in the HKEY_LOCAL_MACHINE registry key, and none of these values are exposed in the user interface. For example, you can't set any of these values using the Power Options applet in the Control Panel.

  • Values in user structures are stored in the HKEY_CURRENT_USER registry key and some of these values are displayed in the user interface. Some of these parameters can be set using the Power Options applet in Control Panel.

The data structures defining power management policy are listed below:

  • GLOBAL_POWER_POLICY—used to manage global power policies. This structure contains the data common across all power schemes. This structure is a container for a GLOBAL_USER_POWER_POLICY structure and a GLOBAL_MACHINE_POWER_POLICY structure, which contains elements that are read from and written to the registry.

  • GLOBAL_MACHINE_POWER_POLICY—this structure is a part of the GLOBAL_POWER_POLICY structure; it contains the data common across all power schemes and users. The elements in this structure are read from and written to the HKLM key in the registry.

  • GLOBAL_USER_POWER_POLICY—this structure is a part of the GLOBAL_POWER_POLICY structure; it contains the data common across all power schemes for the user. The elements in this structure are read from and written to the HKCU key in the registry.

  • POWER_POLICY—used to manage non-global power policies. This structure contains the data unique across power schemes. This structure is a container for the USER_POWER_POLICY and MACHINE_POWER_POLICY structures that contain the elements to be read from and written to the registry. There's one POWER_POLICY structure for each power scheme on a machine.

  • MACHINE_POWER_POLICY—this structure is a part of the POWER_POLICY structure; it contains the data unique to each power scheme, but common to all users. The elements in this structure are read from and written to the HKLM key in the registry.

  • USER_POWER_POLICY—this structure is a part of the POWER_POLICY structure; it contains the data unique to each user and power scheme. The elements in this structure are read from and written to the HKCU key in the registry.

Registry Keys Intended for Power Management

In this section, we'll discuss the registry keys that are used for power management. You may edit any of them using one of the registry editors.

Note 

Changing registry entries responsible for power management won't have an immediate effect. Windows only reads settings from the registry when you log on, when you click OK in Control Panel, or when a Powerprof.dll function is called to read the registry.

The registry keys used for power management are listed below.

  • HKCU\AppEvents\EventLabels\LowBatteryAlarm—descriptive name of a low battery power alarm event.

  • HKCU\AppEvents\EventLabels\CriticalBatteryAlarm—descriptive name of a critical battery power alarm event.

  • HKCU\AppEvents\Schemes\Apps\PowerCfg\LowBatteryAlarm\. Current, HKCU\AppEvents\Schemes\Apps\PowerCfg\LowBatteryAlarm\.Default, HKCU\AppEvents\Schemes\Apps\PowerCfg\CriticalBatteryAlarm \.Current, HKCU\AppEvents\Schemes\Apps\PowerCfg\CriticalBatteryAlarm\.Default
    filenames of the WAV files that will play as a low and critical power alarm events.

  • HKCU\Control\Panel\PowerCfg\CurrentPowerPolicy—index of current user and machine power policy.

  • HKCU\Control Panel\PowerCfg\GlobalPowerPolicy\Policies—the user global power policy (binary encoded data).

  • HKCU\Control Panel\PowerCfg\PowerPolicies\n\Name—name of power scheme n, where n = 0, 1, 2,

  • HKCU\Control Panel\PowerCfg\PowerPolicies\n\Description—descriptive string for power scheme n, where n = 0, 1, 2,

  • HKCU\Control Panel\PowerCfg\PowerPolicies\n\Policies—user power policy n, where n = 0, 1, 2 etc. (binary encoded data).

  • HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\ PowerCfg\LastID—index of the last power policy in the lists of user and machine power policies (for example, if there are six user power policies and six machine power policies in the registry, the value of this key is 5).

  • HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\DiskSpinDownMax—the maximum disk spin down time that Control Panel will allow the user to set.

  • HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\DiskSpinDownMin—the minimum disk spin down time that Control Panel will allow the user to set.

  • HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls \Folder\PowerCfg\GlobalPowerPolicy\Policies—the machine global power policy (binary encoded data).

  • HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\ PowerCfg\PowerPolicies\n\Policies—machine power policy n, where n = 0, 1, 2 etc. (binary encoded data).



Windows XP Registry
Linux Enterprise Cluster: Build a Highly Available Cluster with Commodity Hardware and Free Software
ISBN: N/A
EAN: 2147483647
Year: 2000
Pages: 144
Authors: Karl Kopper

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