Читаем Windows® Internals, Sixth Edition, Part 2 полностью

A device driver typically provides an I/O interface for a particular type of device. A driver is a software module that interprets high-level commands, such as read or write, and issues low-level, device-specific commands, such as writing to control registers. Device drivers receive commands routed to them by the I/O manager that are directed at the devices they manage, and they inform the I/O manager when those commands are complete. Device drivers often use the I/O manager to forward I/O commands to other device drivers that share in the implementation of a device’s interface or control.

The PnP manager works closely with the I/O manager and a type of device driver called a bus driver to guide the allocation of hardware resources as well as to detect and respond to the arrival and removal of hardware devices. The PnP manager and bus drivers are responsible for loading a device’s driver when the device is detected. When a device is added to a system that doesn’t have an appropriate device driver, the executive Plug and Play component calls on the device installation services of a user-mode PnP manager.

The power manager also works closely with the I/O manager and the PnP manager to guide the system, as well as individual device drivers, through power-state transitions.

Windows Management Instrumentation support routines, called the Windows Driver Model (WDM) WMI provider, allow device drivers to indirectly act as providers, using the WDM WMI provider as an intermediary to communicate with the WMI service in user mode. (For more information on WMI, see the section “Windows Management Instrumentation” in Chapter 4 in Part 1.)

The registry serves as a database that stores a description of basic hardware devices attached to the system as well as driver initialization and configuration settings. (See “The Registry” section in Chapter 4 in Part 1 for more information.)

INF files, which are designated by the .inf extension, are driver installation files. INF files are the link between a particular hardware device and the driver that assumes primary control of the device. They are made up of script-like instructions describing the device they correspond to, the source and target locations of driver files, required driver-installation registry modifications, and driver dependency information. Digital signatures that Windows uses to verify that a driver file has passed testing by the Microsoft Windows Hardware Quality Labs (WHQL) are stored in .cat files. Digital signatures are also used to prevent tampering of the driver or its INF file.

The hardware abstraction layer (HAL) insulates drivers from the specifics of the processor and interrupt controller by providing APIs that hide differences between platforms. In essence, the HAL is the bus driver for all the devices soldered onto the computer’s motherboard that aren’t controlled by other drivers.

Figure 8-1. I/O system components

The I/O Manager

The I/O manager is the core of the I/O system because it defines the orderly framework, or model, within which I/O requests are delivered to device drivers. The I/O system is packet driven. Most I/O requests are represented by an I/O request packet (IRP), which travels from one I/O system component to another. (As you’ll discover in the section Fast I/O, fast I/O is the exception; it doesn’t use IRPs.) The design allows an individual application thread to manage multiple I/O requests concurrently. An IRP is a data structure that contains information completely describing an I/O request. (You’ll find more information about IRPs in the section I/O Request Packets later in the chapter.)

The I/O manager creates an IRP in memory to represent an I/O operation, passing a pointer to the IRP to the correct driver and disposing of the packet when the I/O operation is complete. In contrast, a driver receives an IRP, performs the operation the IRP specifies, and passes the IRP back to the I/O manager, either because the requested I/O operation has been completed, or because it must be passed on to another driver for further processing.

In addition to creating and disposing of IRPs, the I/O manager supplies code that is common to different drivers and that the drivers can call to carry out their I/O processing. By consolidating common tasks in the I/O manager, individual drivers become simpler and more compact. For example, the I/O manager provides a function that allows one driver to call other drivers. It also manages buffers for I/O requests, provides timeout support for drivers, and records which installable file systems are loaded into the operating system. There are close to one hundred different routines in the I/O manager that can be called by device drivers.

Перейти на страницу:

Похожие книги

Веб-аналитика: анализ информации о посетителях веб-сайтов
Веб-аналитика: анализ информации о посетителях веб-сайтов

Компании в веб-пространстве тратят колоссальные средства на веб-аналитику и оптимизацию своих веб-сайтов, которые, в свою очередь, приносят миллиарды долларов дохода. Если вы аналитик или работаете с веб-данными, то эта книга ознакомит вас с новейшими точками зрения на веб-аналитику и то, как с ее помощью сделать вашу компанию весьма успешной в веб. Вы изучите инструментальные средства и показатели, которые можно использовать, но что важнее всего, эта книга ознакомит вас с новыми многочисленными точками зрения на веб-аналитику. Книга содержит много советов, приемов, идей и рекомендаций, которые вы можете взять на вооружение. Изучение веб-аналитики по этой уникальной книге позволит познакомиться с проблемами и возможностями ее современной концепции. Написанная практиком, книга охватывает определения и теории, проливающие свет на сложившееся мнение об этой области, а также предоставляет поэтапное руководство по реализации успешной стратегии веб-аналитики.Эксперт в данной области Авинаш Кошик в присущем ему блестящем стиле разоблачает укоренившиеся мифы и ведет по пути к получению действенного понимания аналитики. Узнайте, как отойти от анализа посещаемости сайта, почему основное внимание следует уделять качественным данным, каковы методы обретения лучшего понимания, которое поможет выработать мировоззрение, ориентированное на мнение клиента, без необходимости жертвовать интересами компании.- Изучите все преимущества и недостатки методов сбора данных.- Выясните, как перестать подсчитывать количество просмотренных страниц, получить лучшее представление о своих клиентах.- Научитесь определять ценность показателей при помощи тройной проверки "Ну и что".- Оптимизируйте организационную структуру и выберите правильный инструмент аналитики.- Изучите и примените передовые аналитические концепции, включая анализ SEM/PPC, сегментацию, показатели переходов и др.- Используйте решения с быстрым началом для блогов и электронной торговли, а также веб-сайтов мелкого бизнеса.- Изучите ключевые компоненты платформы экспериментирования и проверки.- Используйте анализ конкурентной разведки для обретения понимания и принятия мер.Здесь также находятся:- Десять шагов по улучшению веб-аналитики.- Семь шагов по созданию управляемой данными культуры в организации.- Шесть способов замера успеха блога.- Три секрета создания эффективной веб-аналитики.- Десять признаков великого веб-аналитика.

Авинаш Кошик

ОС и Сети, интернет