WINDOWS 1002000 PROFESSIONAL RESOURCE KIT [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

WINDOWS 1002000 PROFESSIONAL RESOURCE KIT [Electronic resources] - نسخه متنی

Chris Aschauer

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید







Plug and Play Device Detection


Plug and Play is a combination of the system BIOS, hardware devices, system resources, device drivers, and operating system software. This combination provides dynamic installation and configuration of new system hardware components and Plug and Play devices that require little or no manual intervention. For more information about the Windows 2000 implementation of Plug and Play, see "Device Management" in this book.

System BIOS


The basic input/output system (BIOS) starts the computer by providing a basic set of instructions. It performs all necessary startup tasks, including POST and starting an operating system from a floppy disk or hard disk. The BIOS uses a library of interrupt handlers to provide the operating system with an interface to the underlying hardware. For instance, each time a key is pressed, the CPU performs an interrupt to read that key. This is similar for other input/output devices, such as serial and parallel ports, video cards, sound cards, hard disk controllers, and so on. Some older computers cannot cooperate with modern hardware because the operating system cannot call a BIOS routine to use it. You can solve this problem by replacing the BIOS with a newer one that supports your hardware or by installing a device driver for the hardware.

How the BIOS interacts with Plug and Play devices varies, depending on whether the system BIOS or the operating system is responsible for configuring the hardware device. Taking this into consideration, you have three possible scenarios:

Only the initial program load or boot devices are controlled by the BIOS

Initial program load (IPL) devices are required to start the system. They can be embedded on the system board or on added devices.

This scenario also supports dynamic configuration, where a non-boot device, such as a PCMCIA card, is installed while the power is on. Each time the system is started in a dynamic configuration, the devices are reexamined. In theory, the assigned resources can be rearranged at restart whether devices have been added or removed.

All devices are configured by the BIOS

If Enable Plug and Play operating system is disabled and the device has a static configuration, you can not remove the device without turning off the system. In addition, you must first turn off the system before you remove almost any device. The exceptions are external port devices and bus types that are Plug and Play by nature, such as universal serial bus (USB) and IEEE 1394.

No devices are configured by the BIOS

In the Advanced Configuration and Power Interface (ACPI) of Windows 98 and Windows 2000, the operating system configures almost all devices. The exceptions are those devices that are needed to start the operating system and bus types that handle it on their own, such as Peripheral Component Interconnect (PCI), USB, and IEEE 1394.

System Resources


System resources are made up of the BIOS, interrupt request lines (IRQs), direct memory access (DMA), input/output (I/O) port addresses, and reserved memory. They allow the individual hardware components to signal and gain access to the CPU without conflicting with other hardware devices. Before Plug and Play, each resource had to be configured manually, which could be difficult.

The Plug and Play Manager determines the hardware resources requested by each device (for example, I/O ports, IRQs, DMA channels, and memory locations) and assigns them appropriately. The Plug and Play Manager can reconfigure resource assignments when necessary, such as when a new device is added that requires resources that are already in use. It can also maintain ISA detection and configuration that is non–Plug and Play.

IRQs


IRQs are channels or switches that are used by hardware devices to signal the CPU. The traditional architecture has 16 IRQs, some of which are used for onboard devices such as the system clock, keyboard, and mouse. The remaining IRQs can be used by expansion cards that are added to the computer.

When you have used all your IRQs, you can share them. In addition, methods have been devised that do not require IRQs. Some new bus types, such as USB and IEEE 1394, require at least one IRQ for the bus controller itself because they reside over the PCI bus. It is possible to share available IRQs, On ACPI systems, all PCI devices can share IRQ 9 by default. Most of the problems created by sharing IRQs are related to bandwidth. To share IRQs, the system places these IRQs on a stack and manages them in first in, first out (FIFO) fashion. The more sharing, the longer it takes to traverse the stack and the more opportunity for time-outs and other problems.

I/O Port Address


After a device signals the CPU by using its assigned IRQ, the device needs to pass information between it and the CPU. This is done through memory. An I/O port address is an area of memory that is reserved by the device to pass required information to the device driver, which in turn passes the information to the CPU. These are not linear memory locations but numerical pointers or representations of physical memory locations. On each hardware device, a read-only memory (ROM) chip stores a collection of device descriptors as hardware registers or on the PCI bus, as the configuration memory space. I/O port addresses serve as a special "lens" that isolates one register from another. There are 65,535 of these ports available in current systems, but as with IRQs, the ports are already reserved for specific devices. In addition, I/O ports can be segregated according to bus type, with some I/O addresses reserved for PCI and others for ISA.

DMA


The device can access physical memory either through the CPU or by bypassing the CPU entirely. Direct memory access (DMA) channels allow devices to write to physical memory without placing a load on the CPU. There are usually eight DMA channels; existing devices reserve a number of channels, leaving approximately five channels free to be used with additional devices. The exception is the PCI bus, in which the DMA is replaced by bus mastering.

Detecting Plug and Play Devices


The Plug and Play detection process in Windows 2000 works similarly to Plug and Play in Windows 98. Each device that is attached to the computer is identified when Windows 2000 Professional starts. Devices that are not required to start the computer remain inactive until the operating system has started.

After identifying each device, Plug and Play determines the system resources that each device requires, stores the configuration in memory, and assigns those resources to the device. After the devices have been configured, Plug and Play identifies and loads the drivers that each device requires.

Plug and Play continues to provide an interface between the system and the device drivers, which consist of I/O routines, Interrupt Request Packets (IRPs), driver entry points, and the registry. In addition, Plug and Play handles power management events and hardware detection, such as removing a portable computer from a docking station or adding or removing a hardware device. Plug and Play also allows applications to control certain power management events.

For more information about Plug and Play devices, see "Device Management" in this book. For more information about power management, see "Power Management" in this book.

Building the Device Tree


The device tree contains information about the devices attached to the system. The operating system uses information from drivers and other components to build this tree when the computer starts, and it updates the tree as devices are added or removed. The device tree is hierarchical, with devices on a bus represented as subcomponents of the bus adapter or controller.

To view the hierarchy of devices in the device tree


    In Device Manager, click the View menu, and then click Devices by connection.


Figure 6.1 shows the structure of the device tree.


Figure 6.1 Device Tree Structure

Each node of the device tree is a device node, which consists of the device objects for the drivers and internal information maintained by the operating system.

The hierarchy of the device tree reflects the structure in which the devices are attached to the computer. The operating system uses this hierarchy as it manages the devices. For example, if a user requests to unplug the USB controller from the computer represented in Figure 6.1, the Plug and Play Manager asks the drivers for the USB controller to remove the controller, and the Plug and Play Manager queries the drivers for any descendants of the controller. The Plug and Play Manager determines that this action would cause the USB hub, the joystick, and the camera to become unplugged.

Plug and Play Detection on Non-ACPI Systems


Before installing Windows 2000 on a non-ACPI system, disable Plug and Play Operating System support in the system BIOS.

When a non-ACPI computer is started, Plug and Play is configured by the system BIOS and not the operating system. The BIOS performs the following steps:


    Isolates any Plug and Play ISA devices for configuration.

    Builds a resource allocation map of the resources consumed by non-Plug and Play devices.

    Optionally maintains a list of the previous resource configuration in non-volatile storage or memory.

    Selects and enables the input and output devices that are required during the startup process.

    Initializes the device ROM if the device encountered is a boot device.

    Allocates conflict-free resources to devices that have not yet been configured.

    Activates all devices.

    Initializes any option ROMs that have been encountered.

    Starts the bootstrap loader.


One requirement of Plug and Play is the ability to isolate individual cards for configuration. PCI cards are isolated by the PCI architecture itself. Because the original ISA specification provided no method for isolating one card from another, either the operating system or the system BIOS can perform these steps.

The detection process remains largely unchanged under the ACPI architecture, except that on an ACPI system, the operating system and not the BIOS is responsible for device detection and configuration.

Plug and Play Detection on ACPI Systems


ACPI combines and enhances both Plug and Play and power management. On an ACPI computer, Plug and Play is configured by the operating system and not the system BIOS.

In the following example, a user installs a Plug and Play USB joystick into a USB hub on a USB host controller. The USB hub is a Plug and Play bus device because it can have other devices attached to it. In this example, the USB supports hot-plug notification, and the function driver for the USB is notified that its subcomponents have changed. The operating system performs the following steps:


    The function driver for the device determines that there is a new device on its bus.

    The function driver for the bus device notifies the Plug and Play Manager that its set of devices has changed.

    The Plug and Play Manager queries the drivers for the bus for the current device tree.

    The Plug and Play Manager sends an Interrupt Request Packet (IRP) to the device stack for the bus asking for the current list of devices on the bus.

    When the main driver of the USB hub (the USB host controller class or miniclass driver pair) completes the IRP, the IRP travels back through the device stack by means of any completion routines registered by the hub drivers.

    When the Plug and Play Manager has the current list of devices on the bus, it determines if any devices have been added or removed. In this example, there is one new device, and the only driver that is configured for the joystick is the main USB hub driver. Any optional bus filter drivers are also present in the device stack.

    The Plug and Play Manager gathers information about the new device and begins configuring the device.

    The Plug and Play Manager checks the registry to determine if the device has been installed on this computer before.

    The Plug and Play Manager stores information about the device in the registry.

    The kernel-mode Plug and Play Manager attempts to find and load the function and filter drivers for the device, if any exist.

    The Plug and Play Manager assigns resources to the device, if needed, and issues an IRP to start the device.


For more information about device detection during Setup, see the Driver Development Kits (DDKs) link on the Web Resources page at http://Windows.microsoft.com/Windows2000/resourcekit/webresources.

/ 335