Windows Driver Model
In
Overview
WDM drivers are layered in a stack and communicate with each other via
WDM exists in the intermediary layer of Windows 2000
Device kernel-mode drivers
With the Windows Drivers Model (WDM) for devices Microsoft implements an approach to
While WDM defines three types of device drivers, not all driver stacks for a given device contain all types of device drivers. The three WDM device driver types are:[2]
Bus driver: For every
Function driver: this is the principal driver for a device and it provides the operational interface for a device by handling read and write operations. Function drivers are written by the device vendors, and for their interaction with the hardware they depend on a specific bus driver being present in the Windows operating system.[4]
Filter driver: This driver is optional, and can modify the behaviour of a device, such as input and output requests. These drivers can be implemented as lower-level and upper-level filter drivers.[5]
Object-oriented driver stack
Function drivers and bus drivers are often implemented as driver/minidriver pairs, which in practice is either a class or miniclass, or a port or miniport pair.[6]
Bus drivers for devices attached to a bus are implemented as class drivers and are hardware-agnostic. They will support the operations of a certain type of device. Windows operating systems include a number of class drivers, such as the kbdclass.sys driver for keyboards. Miniclass drivers on the other hand are supplied by the vendor of a device, and only support device specific operations, for a particular device of a given class.[7]
Port drivers support general
Each driver that processes an I/O request for a device has a corresponding object, which is loaded into
Device drivers for different Windows operating systems
The WDM framework was developed by Microsoft to simplify the communication between the operating system and drivers inside the kernel. In Windows operating systems, drivers are implemented as
A device driver that is not designed for a specific hardware component may allow another device to function. This is because the basic functionality of a hardware device class is similar. The functionality of the video card class, for example, allows the Microsoft Basic Display Adapter driver to work with a wide variety of video cards. However, installing the wrong driver for a device will mean that the full functionality of the device can not be used, and may result in poor performance and the destabilization of the Windows operating system. Hardware device vendors may release updated device drivers for particular Windows operating systems, to improve performance, add functionality or fix bugs. If a device is not working as expected the latest device drivers should be downloaded from the vendor website and installed.[14]
Device drivers are designed for particular Windows operating system versions, and device drivers for a previous version of Windows may not work correctly or at all with other versions. Because many device drivers run in kernel mode installing drivers for a previous operating system version may destabilise the Windows operating system. Migrating a computer to a higher version of a Windows operating system therefore requires that new device drivers are installed for all hardware components. Finding up to date device drivers and installing them for Windows 10 has introduced complications into the migration process.[15]
Common device driver compatibility issues include: a
Device Manager
The Device Manager is a Control Panel applet in Microsoft Windows operating systems. It allows users to view and control the hardware attached to the computer. It allows users to view and modify hardware device properties, and is also the primary tool to manage device drivers.[17]
Criticism
The Windows Driver Model, while a significant improvement over the
- Interactions with power management events and plug and play are difficult. This can lead to situations where Windows machines cannot enter or exit sleep modes correctly due to bugs in driver code.
- I/O cancellation is difficult to get right.[19]
- Complex boilerplate support code is required for every driver.
- There is no support for writing pure user-modedrivers.
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 set of frameworks on top of WDM, called the Windows Driver Frameworks (WDF; formerly Windows Driver Foundation), which includes Kernel-Mode Driver Framework (KMDF) and User-Mode Driver Framework (UMDF). Windows Vista supports both pure WDM and the newer WDF. KMDF is also available for download for Windows XP and even Windows 2000, while UMDF is available for Windows XP and above.
See also
- Windows Driver Frameworks (WDF)
- Kernel-Mode Driver Framework (KMDF)
- User-Mode Driver Framework (UMDF)
- Windows Display Driver Model (WDDM)
References
- ISBN 9783642387890.
- ISBN 9783642387890.
- ISBN 9783642387890.
- ISBN 9783642387890.
- ISBN 9783642387890.
- ISBN 9781449661229.
- ISBN 9781449661229.
- ISBN 9781449661229.
- ^ "Introduction to the Windows Driver Foundation". Microsoft Developer Network. 2006-10-13. Retrieved 2010-12-06.
The device class-specific driver models are typically structured as a port driver written by Microsoft paired with a miniport driver written by an independent hardware vendor. The port driver does much of the work required for the device class, and the miniport driver supports device-specific characteristics.
- ISBN 9781449661229.
- ISBN 9783540687245.
- ISBN 9783540687245.
- ISBN 9783540687245.
- ISBN 9781285868578.
- ISBN 9781285868578.
- ISBN 9781285868578.
- ISBN 9781285868578.
- ^ Oney, Walter (May 6, 2003). "Introducing Windows Driver Framework". Windows Driver Developer's Digest. Vol. 1, no. 3. Archived from the original on 2016-01-25.
- ^ "I/O Completion/Cancellation Guidelines". MSDN. Microsoft. May 5, 2003. Retrieved 2018-02-08.
- Finnel, Lynn (2000). MCSE Exam 70-215, Microsoft Windows 2000 Server. ISBN 1-57231-903-8.
- Oney, Walter (2003). Programming the Windows Driver Model, ISBN 0-7356-1803-8.
External links
- WDM Input Output Concepts - This article gives a high level overview of the I/O concepts as defined in the Windows Driver Model.
- Windows driver API basics - This article informs you about the basics behind sound card drivers such as WDM, MME, DirectX, etc.
- Channel 9 Video - Interview with the Device Management and Installation team at Microsoft, primarily covering Plug-and-play.
- Lecture Notes on Windows Kernel Programming at the Wayback Machine (archived March 3, 2016) - Free lecture notes book fragment detailing basic creation of Windows Drivers, Kernel Mode programming, and Memory management