Foundation of WDM driver design
(Author: Su Jinguo, 2000 at 13:26 on November 9)
WDM (Win32 Driver Model), the WIN32 driver model, is a new driver pattern for Microsoft force to simplify the development of drivers by providing a flexible way, reduces the new hardware support. Reduce the number and complexity of the drivers that must be developed.
In addition to the general platform service and extension, WDM also implements a modular, hierarchical type miniature driver structure (see Figure 1). The type driver implements the functional interface that supports universal bus, protocol, or device classes. The general feature of the type driver is to provide the necessary conditions for the command settings, protocols, and code reuse required by the protocol, and code reuse. WDM supports the number and complexity of the device driver required for Windows 95 and Windows NT on the standard interface. Windows 2000 also introduces the WDM driver architecture. Although WDM is currently not much, it is believed that in the near future, on the Windows platform, WDM will become the mainstream drive mode of the 21st Century. (1) Windows operating system Windows 98 is unlikely to process I / O operations as WINDOWS 2000 (see Figure 2). The application calls the WIN32 API, and only the corresponding Win32 API is called only when the hard disk file, the communication port, and the WDM driver is read, and the corresponding Win32 API must use a specific mechanism. All Windows 2000 kernel mode I / O operations use a common data structure (IRP), Windows 98 does not have this feature, and the application request does not reach kernel mode. However, when it comes to the WDM driver, the architecture within Windows 98 is very similar to Windows 2000. System module (Ntkern.vxd) includes a large number of Windows NT kernel support functions that complete the creation of request pack IRPS, send them to WDM drivers, from which there is no difference between the two environments. Figure 1 Flexible unified interface in WDM features in WDM and drivers in WDM features, enabling operating systems to dynamically configure different driver modules to support specific devices. A typical driver stack consists of a bus class driver coupled to a miniature driver of a particular bus with a general purpose device, protocol, and a miniature driver of a particular bus. Dynamic Construction WDM Driver Stack is the key to implementing plug and playing device support. The WDM service enables a model for Windows NT and Windows 95 to quickly react to the WINDOWS NT and Windows 95. WDM provides multiple execution priorities, including core states and non-core state threads, IRQ levels, and delayed programs (DPCs). All WDM classes and microves are used as privileged threads of the core state (Layer 0) (not being interrupted by the CPU scheduler). 32 IRQ grades can be used to distinguish between hardware interrupt services. For each interrupt, the DPC is discharged into the queue to wait until the IRQ service routine that is enabled is completed. DPCS makes the system greatly improved the interrupt response by effectively reducing interrupt. For X86-based PC systems using multiprocessors, the interrupts of interrupts are based on Intel's multiprocessor specification 1.4 version. For streaming media applications, WDM provides a fast-reactive interface to handle I / O streams at the core state. The WDM flow interface is provided through a standard WDM class interface. Figure 2 Windows 98 Architecture (3) WDM Working Principles WDM support USB, IEEE 1394, ACPI and other new hardware standards. And in the past two platforms, two truncated drivers need to be written, and now you can write a WDM driver. The WDM driver is also hierarchical, that is, drivers on different layers have different priorities, and VXD under Windows 9X does not have this structure.