Windows Driver Model

http://en.wikipedia.org/wiki/Windows_Driver_Model

In computing, the Windows Driver Model (WDM) — also known at one point as the Win32 Driver Model — is a framework for device drivers that was introduced with Windows 98 and Windows 2000 to replace VxD, which was used on older versions of Windows such as Windows 95 and Windows 3.1, as well as the Windows NT Driver Model.

Contents

[hide]

Overview[edit]

WDM drivers are layered in a complex hierarchy and communicate with each other via I/O request packets (IRPs). The Microsoft Windows Driver Model unified driver models for the Windows 98 and Windows 2000 product lines by standardizing requirements and reducing the amount of code that needed to be written. WDM drivers will not run on operating systems earlier than Windows 98 or Windows 2000, such as Windows 95, Windows NT 4.0 and Windows 3.1. By conforming to WDM, drivers can be binary compatible and source-compatible across Windows 98, Windows 98 Second Edition, Windows Me, Windows 2000, Windows XP, Windows Server 2003 and Windows Vista (for backwards compatibility) on x86-based computers. WDM drivers are designed to be forward-compatible so that a WDM driver can run on a version of Windows newer than what the driver was initially written for, but doing that would mean that the driver cannot take advantage of any new features introduced with the new version. WDM is generally not backward-compatible, that is, a WDM driver is not guaranteed to run on any older version of Windows. For example, Windows XP can use a driver written for Windows 2000 but will not make use of any of the new WDM features that were introduced in Windows XP. However, a driver written for Windows XP may or may not load on Windows 2000.

WDM exists in the intermediary layer of Windows 2000 kernel-mode drivers and was introduced to increase the functionality and ease of writing drivers for Windows. Although WDM was mainly designed to be binary and source compatible between Windows 98 and Windows 2000, this may not always be desired and so specific drivers can be developed for either operating system. WDM drivers can be classified into the following types and sub-types:

Device function drivers[edit]

A function driver is the main driver for a device. A function driver is typically written by the device vendor and is required (unless the device is being used in raw mode). A function driver can service one or more devices.

  • Class drivers: These are a type of function drivers and can be thought of as built-in framework drivers that miniport and other class drivers can be built on top of. The class drivers provide interfaces between different levels of the WDM architecture. Common functionality between different classes of drivers can be written into the class driver and used by other class and miniport drivers. The lower edge of the class driver will have its interface exposed to the miniport driver, while the upper edge of top level class drivers is operating system specific. Class drivers can be dynamically loaded and unloaded at will. They can do class specific functions that are not hardware or bus-specific (with the exception of bus-type class drivers) and in fact sometimes only do class specific functions like enumeration.
  • Miniport drivers: These are also function drivers for USB, audio, SCSI and network adapters. They should usually be source and binary compatible between Windows 98 and Windows 2000 and are hardware specific but control access to the hardware through a specific bus class driver.

Bus drivers[edit]

A bus driver services a bus controller, adapter, or bridge. Microsoft provides bus drivers for most common buses, such as PCI, PnPISA, SCSI, USB and FireWire. Each software vendor can create their own bus drivers if needed. A bus driver can service more than one bus if there is more than one bus of the same type on the machine.

Filter drivers[edit]

Filter drivers are optional drivers that add value to or modify the behavior of a device and may be non-device drivers. A filter driver can also service one or more devices. Upper level filter drivers sit above the primary driver for the device (the function driver), while lower level filter drivers sit below the function driver and above the bus driver.

VxD, WDM and Windows 98[edit]

Windows 98 based operating systems (Windows 98, Windows 98 Second Edition, and Windows Me) are able to use both WDM and VxD (Virtual device driver) driver standards. Both drivers models can provide unique and different features for the same hardware. However, usually the newer WDM standard provides more features. For example, if a TV tuner card using a VxD driver is able to capture images at a resolution of 384 x 288 pixels, the same TV Tuner card with the WDM driver model may be able to capture at a resolution of 768 x 576 pixels. This can be attributed to the new Broadcast Driver Architecture model which is part of WDM.

Criticism[edit]

The Windows Driver Model, while a significant improvement over the VxD and Windows NT driver model used before it, has been criticised by driver software developers [1], most significantly for the following:

  • Interactions with power management events and plug and play are difficult. This leads to a variety of situations where Windows machines cannot go to sleep or wake up correctly due to bugs in driver code.
  • I/O cancellation is almost impossible to get right.
  • Thousands of lines of support code are required for every driver.
  • No support for writing pure user-mode drivers.

There were also a number of concerns about the quality of documentation and samples that Microsoft provided.

Because of these issues, Microsoft has released a new framework to replace WDM, called the Windows Driver Foundation, which includes Kernel-Mode Driver Framework (KMDF) and User-Mode Driver Framework (UMDF). Windows Vista supports both WDM and the newer Windows Driver Foundation. KMDF is also available for download for Windows XP and even Windows 2000, while UMDF is available for Windows XP and above.

See also[edit]

References[edit]

External links[edit]

  • Kernel Survival guide - Free lecture notes book fragment detailing basic creation of Windows Drivers, Kernel Mode programming, and Memory management
时间: 2024-10-27 05:04:00

Windows Driver Model的相关文章

Windows Driver—IOCtl的三种数据交互方式(buffer,direct,other)

http://www.hgy413.com/1319.html 简介DeviceIoControl的三种通信方式 Windows Driver-IOCtl的三种数据交互方式(buffer,direct,other),布布扣,bubuko.com

微软职位内部推荐-SDE2 (Windows driver)

微软近期Open的职位: SDE2 (Windows driver) Job title: Software Development Engineer 2 Location: Shanghai, China Do you want to join Microsoft and work on the latest Windows devices? Do you want to impact hundreds of millions of Windows customers together wit

SqlCmd -Windows Cluster Model

前提条件 1存储lun 划分完毕并且挂载到其中一台机器上 2 需要加入群集的节点机器加入域完毕,并设置好心跳线 .加域部分可以参考 之前 Sqler Cmd 加域部分. 1检查Feature 更新 SqlerCmdWinClusterInstallFeature 再需要按装cluster的 节点机器上面运行 SqlerCmdWinClusterInstallFeature cat C:\CheckInstallClusterLog.Log 如果节点机器已安装 PS C:\Users\xwj> c

Windows Driver—自旋锁(SpinLock)

http://hgy413.com/1335.html 简介自旋锁的注意点和自旋锁实现原型代码 Windows Driver-自旋锁(SpinLock),布布扣,bubuko.com

U-Boot Driver Model领域模型设计分析

需求分析 在2014年以前,uboot没有一种类似于linux kernel的设备驱动模型,随着uboot支持的设备越来越多,其一直受到如下问题困扰: 设备初始化流程都独立实现,而且为了集成到系统,需要修改核心公共代码(如init_sequence) 很多子系统只允许一个驱动,比如无法同时支持USB2.0和USB3.0 子系统间的交互实现各异,开发难度大 没有个统一的设备视图(如linux的/sys) uboot driver model(U-Boot驱动模型,以下简写dm)的提出就是为了解决这

驱动开发利器Microsoft Windows Driver Kit 7.1.0下载

在Windows 2000 与Windows XP 系统采用是WINDDK来开发WINDOWS驱动程序,我手头也有WINDDK,可是从Windows Vista开始之后,一般采用Microsoft Windows Driver简称(WDK).这段时间刚好项目有用到USB HID,需要用到HID.lib库文件,因此下载了这个WDK7.1.0版本,采用HID.LIB,以及采用USB HID的目的,就是省去了PC端的驱动程序的编写,直接采用Windows内置的驱动程序,只需要了解USB HID通信数据

Windows Driver Frameworks

MSDN原文:https://msdn.microsoft.com/zh-cn/library/windows/hardware/ff557565(v=vs.85).aspx

Windows Driver Foundation-User-Mode Driver Framework 服务不能启动(错误31)问题解决

这个错误是由于WudfPf这个服务没有启动有关,导致开机时出现SVCHOST.EXE出现,内存不能"Written"的错误, http://answers.yahoo.com/question/index?qid=20110614111435AATsgp9 Run these commands one by one in 'command prompt' sc config wudfpf start= auto net start wudfpf net start wudfsvc

PCI/PCIe接口卡Windows驱动程序(1)-WDF概述及开发环境搭建

本科毕业设计是这方面的工作,所以想开几篇博客来介绍使用WDF开发PCI/PCIe接口卡的驱动程序方法. 这个系列的博客将首先用一个篇幅为不懂Windows 下PCI/PCIe驱动开发的介绍WDF和开发环境搭建,接下来几篇将直接讲述程序编写, 看完这几篇后,希望能够帮助读者了解如何通过500行左右的代码实现一个标准的PCIe接口卡驱动程序. 毕设题目的PCIe板卡是BAR0下映射两个5K的内存,偏移地址为0x20000和0x22000,源代码在: https://github.com/luluji