How Windows XP's Device Driver Verifier Works

By Louis Columbus

Date: Jul 6, 2001

Article is provided courtesy of Sams.

Return to the article


Facing the task of upgrading device drivers for even a few PCs can be a time-consuming process marked by trial and error. Looking to further differentiate from Linux and UNIX, Microsoft's Windows XP's Device Verifier makes migration of previous device driver settings and the correct installation of device drivers more predictable. This article by expert Louis Columbus explains how Windows XP handles the process at the architectural level.

Windows XP's second beta shows positive signs of being able to quickly ascertain device driver attributes and migrate device settings to the new operating systems' operation. Microsoft first introduced the Device Driver Verifier during Windows 2000, and has expanded on its functionality in the first two beta releases of Windows XP Professional. The intent of this article is to define how the Device Driver Verifier works, and what the implications are for Windows XP developers and users.

Responding to the problems with memory management on device driver installation and operation, Microsoft has chosen to architect the Device Driver Verifier to do the following:

How the Device Driver Verifier Works

At the kernel mode of Windows XP, the Device Driver Verifier monitors device driver installation routines during installation to make sure that their respective system calls don't impede overall system performance. As was discussed in the article on Device Driver Rollback and the broader reliability features of Windows XP, the Device Driver Verifier completes this process of checking the validity and compatibility of drivers transparently to the user. Developing for Windows XP, many companies building device drivers with their applications will most likely opt for checking multiple drivers at once—a feature that is new to Windows XP's development environment.

Microsoft has isolated device drivers from memory used by typical application tasks, specifically by taking driver tasks away from the normal memory heap manager. Allocations of memory for the Driver Verifier and the resultant drivers it works with are driven through an allocation or special pool of memory. Also, to minimize conflicts over virtual addresses, Microsoft has increased the lag time between the use of virtual addresses overall. One of the other key design criteria with the Verifier is its capability to run in low-resource scenarios. Developers for the Windows XP platform, for example, can create simulated low-resource environments in which both random driver allocation and operating system functions fail. This will be especially useful for those companies targeting entry-level applications using the Windows XP Professional and Windows XP Home versions.

Key Is Monitoring IRPs in the System

Operating systems arbitrate which resource will be used during processing of tasks through the use of Interrupt Requests, or IRPs for short. Device Verifier actually monitors all IRPs in the system looking for mistakes in device drivers, including common processing errors and conflicts over IRP assignment. The Driver Verifier, acting within the kernel mode, checks the IRPs being completed; and sees whether incorrect values are being sent, whether the I/O processes between IRPs are correct or not, and most importantly, whether the IRPs for plug-and-play, power and WMI functionality are being completed accurately. Clearly, with the integration of plug-and-play in the kernel mode of Windows 2000 and in Windows XP now as well, the role of IRPs as communication points between kernel mode subsystems in the broader operating environment is accentuated. Figure 1 shows an example of the Windows 2000 kernel and user mode subsystems. The architectural differences to Windows XP are minimal on the plug-and-play in addition to the IRP role definition. What's significantly different is the role the Driver Verifier plays in the overall development of system stability.

Figure 1 The Windows 2000 kernel and user modes resemble Windows XP.

Intricacies of the Device Verifier

When looking in greater detail at the Device Driver Verifier, there are several features that many developers are looking to include in both their Windows 2000 and Windows XP device drivers. Windows XP Professional's initial driver sets include many of these features, with the device drivers themselves being in beta:

What About System Administrators?

If you're responsible for keeping tens, hundreds, or thousands of PCs up and running, and you're currently evaluating WindowsXP, definitely take the time to work with Verifier from both the command line. The executive Verifier.exe is delivered with both Windows XP Professional and Windows XP Home. As with any executable, you can embed this command in a shellscript so it can be run at startup across a network as well. Keep in mind that Verifier is disabled during safe mode, often initiated during troubleshooting mode or when a system is booted up using the F8 key. By default, Microsoft loads Verifier.exe in the windows/system32 subdirectory. This executable also relies on the ADVAPI32.DLL, a common dynamically linked library used by system-level resources throughout both Windows 2000 and Windows XP.

What Microsoft Needs to Include Before Launch

With Device Verifier now in its second generation and the integration of key performance checkpoints such as SCSI integration and driver testing, there are still several areas that Microsoft has yet to address with Driver Verifier. Here's a short list of the areas that will most likely be completed in the coming months before the Windows XP launch:

Summary

The Device Verifier shows significant promise in being able to short-circuit common and difficult problems to resolve with device drivers once they are installed. The role of device drivers and their innate capability to use the same resources in completing tasks makes for challenging complex configurations and the support of them. Taking the Device Verifier and making in effect a defined memory pool is a step in the right direction, as is the support of multiple Device Verifier sessions for drivers on the same system.