Registry and Plug and Play Subsystem
At the end of Chapter 1, there was a simple example providing a general understanding of
the process used by the system to install new devices and resolve hardware conflicts.
However, this example was overly simplistic and, more importantly, covered the process
of hardware installation only from the user's point of view. But what actually happens
when the system installs new hardware? What components are required to accomplish
this task? How should we configure hardware and resolve hardware conflicts? These are
clearly topics of great interest to anyone who is initiating full-scale support for Windows
XP and Windows Server 2003. With the release of Windows 95, Microsoft introduced a
new concept for simplifying PC usage: Plug and Play (or PnP). What is Plug and Play? A
standard, a specification, or a concept? Actually, Plug and Play is a combination of the
general approach to designing PCs and a set of specifications describing the hardware
architecture. Strictly speaking, it is a combination of the system BIOS, hardware devices,
system resources, device drivers, and the operating-system software.
All Plug and Play components have the same purpose: to facilitate the automatic
functioning of the PC, peripheral devices, and their drivers, with a minimum of
intervention from the user. Users working with systems that meet all Plug and Play
requirements don't have to spend time wondering if a newly installed device will create
hardware conflicts with another device. The registry provides the basis for developing
such a system.
The HKEY_LOCAL_MACHINE/HARDWARE registry key contains a description of
the system hardware and the relationship between hardware devices and their drivers.
Before we go any further, you should note that this key is volatile and that all of the
information it contains is re-created every time the operating system is booted.
The hardware recognizer (Ntdetect.com) collects information related to system hardware,
and the OS kernel stores the information under the
HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION registry key. As the drivers
are loading, they pass their information on to the system so that it can associate the
hardware devices and their appropriate drivers. The operating system saves this
information under the HKLM\HARDWARE\DEVICEMAP registry key. Finally, all the
necessary information related to resources for the hardware devices (including ports,
DMA addresses, IRQs) is stored under HKLM\HARDWARE\RESOURCEMAP.
With the arrival of Windows 2000, two new Executive subsystems were introduced: Plug
and Play Manager and Power Manager. Plug and Play Manager is integrated with the I/O
Manager and doesn't participate in the initialization process. However, the drivers are
initialized in such a way that Plug and Play drivers recognize some hardware devices.
Windows NT 4.0, on the other hand, uses only Ntdetect.com to recognize hardware
devices, because of its limited Plug and Play support.
Though Windows XP and Windows Server 2003 are based on the Windows NT/2000
kernel, the Plug and Play support provided by these newer operating systems has been
further enhanced, improved, and optimized. The general idea of this design was to
combine the respective advantages of the two lines of Windows products — Windows
NT/2000 and Windows Millennium Edition (Windows ME). The approach has been a
success, providing greater stability in the OS and delivering better device compatibility.
For the moment, Windows XP and Windows Server 2003 include Plug and Play support
for hundreds of devices not recognized by Windows 2000, including scanners, cameras,
audio devices, storage devices, and media (CDs and DVDs). At the same time, these
systems also provide better support for Universal Serial Bus (USB), IEEE 1394,
Peripheral Component Interconnects (PCI), and other buses. Improvements introduced in
the Plug and Play subsystem have lead to better stability and performance. This is
especially true with regard to the device-installation process, which has been streamlined
and automated, as shown in the example in Chapter 1. Beside this, power-management
support has also been improved, which is of benefit to both desktop and mobile computer
users.
Plug and Play Historical Overview
Plug and Play is a technology that allows the automatic configuration of the PC and all of
the devices installed on the system. It allows you to start using newly installed hardware
(for example, a sound card or modem) immediately after installation, and without having
to configure the device manually. Plug and Play operates at the hardware level, the
operating-system level and in the device drivers and BIOS.
The introduction of Plug and Play was the result of cooperation between software and
hardware vendors, who created an industrial committee in order to unite their efforts.
This committee was founded in May of 1993, and initially included three corporations:
Microsoft, Intel, and Compaq. By the end of 1995, a number of vendors were already
producing hundreds of hardware devices complying with this standard.
Microsoft® Windows® 95 was the first operating system that implemented Plug and
Play support. However, since then, PnP standards have undergone a significant evolution,
mainly as a result of the efforts of the members of the OnNow industry initiative. OnNow
is aimed at identifying a standardized approach to controlling both the operating system
and hardware-device configuration. The main achievement of OnNow has been the
Advanced Configuration and Power Interface (ACPI) Version 1.0 specification, which
defines the basic interface between the motherboard and the system BIOS. This interface
expands Plug and Play capabilities, allowing the operating system to control power and
provide other extended configuration capabilities.
Windows 2000, Windows XP and Windows Server 2003 all provide extended Plug and
Play functionality. Windows 2000 was the first operating system from the Windows NT
family that provided full-featured support for Plug and Play and power management.
However, those of you who want all of the advantages of Plug and Play and power-
management support need to ensure that both the system BIOS and the computer system
as a whole meet ACPI specification requirements. More detailed information concerning
this topic will be provided later in this chapter.
At present, Plug and Play technologies are defined for USB, IEEE 1394, PCI, ISA, SCSI,
ATA, LPT, COM, and Card/CardBus. Each Plug and Play device must have the
following capabilities:
Be uniquely identifiable
Be able to provide a list of services that it supports and resources it requires
Be able to identify the driver that supports it
Be able to provide the software capabilities for its configuration
Plug and Play Implementation in Windows 2000, Windows XP, and Windows
Server 2003
Plug and Play systems require interaction between the PC BIOS, hardware components,
device drivers, and operating-system software. In contrast to all the previous versions of
Windows NT, Windows 2000/XP and Windows Server 2003 provide improved reliability
and decreased downtime. These improvements are the result of an extended range of
supported hardware and full-featured Plug and Play support. The introduction of all of the
new capabilities is part of the Microsoft Zero Administration initiative, which is aimed at
minimizing Windows downtime. For example, Plug and Play devices can often be
plugged in or removed while Windows is running, and the system detects the change
automatically. Devices that can be removed while the system is running include any USB
device and a number of IEEE 1394.
Decreasing the frequency of required reboots is one of the most significant advantages
here, as it simplifies the procedure of installing both the operating system and hardware
components. In most cases, new devices can be added dynamically; that is, without
rebooting the system. The Hardware Compatibility List has also been extended
significantly. Now, the HCL includes hundreds of new printers, modems, tape devices,
floptical drives, and other devices. All of this is possible thanks to full-featured Plug and
Play support and Power Management features.
Removing a device from a computer without prior notifying the operating system is
known as a surprise removal. Typically, Windows XP and Windows Server 2003 can
handle this situation effectively, since device drivers developed according to the Windows
XP/Windows Server 2003 Logo Requirements specification must notify the operating
system when the device is removed. For such devices, the removal of the device does not
affect the system. However, surprise removal is not always recommended. Particularly,
the surprise removal of some storage devices, modems, and network adapters causes the
operating system to display an Unsafe Removal of Device screen (Fig. 5.1), which tells
the user to use the Safe Removal application when unplugging the device the next time.
The user can manually disable the message for devices that can withstand surprise
removal. The Safe Removal application is used to notify the operating system that a
device is going to be unplugged, and can be found in the notification area (Fig. 5.2), if
such a device is installed on the system.
Figure 5.1: The Unsafe Removal of Device window
Figure 5.2: To remove a hardware device safely, it is necessary to notify the OS that a
device is going to be unplugged using the Safe Removal application, which can be found
in the notification area
N
ote Some devices must be installed or removed only when the system is turned off.
When the device requires internal installation on the computer, this is the case.
Also, if data transfers are in progress while certain devices are removed or if the
operating system tries to access particular types of devices that have been removed,
data loss, data corruption, or even a system failure might result. For example,
surprise removal of a PC Card, a CardBus, or parallel or COM-port devices while
the device driver is attempting to write to its ports can freeze the system or cause a
STOP error, which requires you to reboot the system.
In contrast to Windows 95, Plug and Play implementation in Windows 2000, Windows
XP, and products of the Windows Server 2003 family isn't based on Advanced Power
Management (APM) BIOS or Plug and Play BIOS. These two legacy Plug and Play
functions are supported for backward compatibility only. Actual Plug and Play support in
Windows 2000, Windows XP and Windows Server 2003 is based on the ACPI interface.
Some ACPI-compliant types of system BIOS may cause STOP errors in Windows 2000,
Windows XP and Windows Server 2003. To minimize this possibility, Microsoft
developers have included a special function with a text-based phase of the OS installation
procedure. This capability allows for the disabling or activating of ACPI mode support
based on the following lists:
Good BIOS list. This list is used for activating ACPI mode for some types of
BIOS' dated earlier than 01/01/1999. If the system BIOS ACPI tables match any
entries in the Good BIOS List, ACPI mode will be enabled. Microsoft isn't adding
any new entries to the "Good BIOS List".
Incompatible BIOS list. This list is used to disable the ACPI mode for certain
BIOSs dated 01/01/1999 or later. If the system BIOS ACPI tables match any
entries in the "Windows Non-Compliant ACPI List", the ACPI mode will be
disabled. BIOSs are added to this list if they have been found by the Microsoft test
teams or the BIOS developers to cause system-stability problems. If a system
doesn't pass the ACPI Hardware Compatibility Test (HCT), fails to boot, or
doesn't provide minimal functionality operating on Windows 2000, then Microsoft
will place the machine's BIOS on the "Windows Non-Compliant ACPI List". The
ACPI HCT is available on the Web at
http://www.microsoft.com/hwdev/acpihct.htm.
If a system's BIOS isn't on either of these lists, the ACPI mode will be enabled if the
BIOS presents itself as an ACPI BIOS that is dated later than 01/01/1999. The date that's
used by the operating system is the standard PC-AT date, which is found at F000:FFF5.
N
ote If the ACPI BIOS is detected as non-compliant in the Windows 2000, Windows XP
or Windows Server 2003 pre-setup system check, then the BIOS must be updated to
ensure complete Plug and Play and power-management functionality. Complete
information on this topic is available at http://www.Hardware-Update.com.