Click here to learn
about this Sponsor:
Home  |  News  |  Articles  |  Polls  |  Forum  |  Directory

Keywords: Match:
Maximizing driver quality in Windows XP Embedded -- Part 2
by Nick Nehrhood (July 2, 2007)

Foreword: This is part 2 of a two-part series about tools that help developers assess device driver code quality. In Part 1, the author described how to use the Verifier tool; here he explains what to do when Verifer reports a problem.



Maximizing Driver Quality in Windows XP Embedded

Part 2: Using PFD and SDV


by Nick Nehrhood

This is a continuation of the article I wrote here. This part focuses on the utilities that you can add to your toolbox, which will help you ensure quality for drivers for which you do have source code access. Both of these tools are used during compile time of your driver and are available from the Windows Driver Development Kit. Please see the first article to find out how to procure the kit.

PREfast for Drivers (PFD)

The first tool is PREfast for Drivers -- which I'll call PFD in this article. PFD is a compile-time static verification tool that analyzes your C or C++ code and looks for common basic coding errors that the compiler may have missed. This utility does not actually execute any code that it's validating but instead tries to detect come of the compile issues that the compiler itself may ignore and would probably be pretty difficult to debug. In addition -- PFD has an additional module which is designed to detect errors in the kernel-mode driver code.

If you're interested in seeing one example of the tool's output then here's a MSDN sample for PFD called "Uninitialized Variables and NULL Pointers". If you want to read more about PFD, check out this link.

PFD was designed to analyze 32-bit code written for either the x86 or the x86-64 architecture (commonly called 'x64' -- not to be confused with the IA64 architecture). I also recommend that you check out the PREfast Step-by-Step page, here. Finally, I found that Channel 9 has done a video about PREfast for Drivers. One of the developers, Donn Terry, is interviewed on the topic of PFD and even provides some insight as to what benefits and differences (at a high level) exist between PREfast for Drivers and PREfast.

Static Driver Verifier (SDV)

The second tool is Static Driver Verifier -- which I'll call SDV in this article. SDV takes a systematic approach to verifying the driver code, in order to ensure that your driver code, which is written in C, doesn't cause any interoperability issues with the Windows OS kernel. This utility will examine all code paths within the code and even has the ability to find errors in obscure code paths which may or may not be exercised even with through testing.

SDV can validate File System Filter drivers as well as device drivers which are in compliance with the Windows Driver Model (WDM). It can validate function drivers, filter drivers, and bus drivers in the x86 as well as the x86-64 environment.

If you're interested in seeing one example of the tool's usage and output then you can check out this article, titled "Verifying Fail_Driver1." If you want to read more about SDV, you can visit this link.

What to do with these tools

So, you may ask, "Nick, what would you do?" Well, I would run both utilities if my code was written in C, and if my code was written in C++ or managed code (.NET) then I would only use PFD.

Yes -- that's right. You read that correctly. PFD can even verify drivers written in managed code! Also, if you're interested in the normal PREfast (the version used against your applications), then you can get it by purchasing Visual Studio 2005 Team Edition for Software Developers or Visual Studio 2005 Team Suite. For more information on either of those please see this link (search for the words "Static Code Analyzer" to find where PREfast applies).

Ultimately it is up to you, the drivers' developers and testers, to ensure that the drivers that are shipping on/in your company's products are of the utmost quality. After all is said and done, you definitely don't want users to be greeted with a blue screen. *Grin*


Copyright (c) 2007 Microsoft Corp. All rights reserved. Reproduced by WindowsForDevices.com with permission. This article was originally published on the Windows XP Embedded team blog, here.



About the author: Nick Nehrhood's fascination with computers started at age 10 when his uncle showed him an Amiga. He is known as the "hardware guru" of the XP Embedded Team where he has been since 2001. Still a "child at heart," Nick's spare time interests include gaming, software development, and being a "Wikipedia addict."



Related stories:

(Click here for further information)


7 Advantages of D2D Backup
For decades, tape has been the backup medium of choice. But, now, disk-to-disk (D2D) backup is gaining in favor. Learn why you should make the move in this whitepaper.

4 Legal Reasons to Control Internet Access
The Internet is obviously a valuable resource for many organizations. However, many are exposed to legal liability concerns because they fail to control Internet access. Learn if you're safe in this white paper.

Rapidly Resolve J2EE Application Problems
Whether you are in the process of building J2EE applications or have J2EE applications already running in production, you must ensure that they deliver the expected ROI. Learn how in this white paper.

Load Testing 2.0 for Web 2.0
There are many unknowns in stress testing Web 2.0 applications. Find out how to test the performance of Web 2.0 in this white paper.

Build Better Games Online
For the game infrastructure providers, life is complex. Making money from games has become more complicated. Why? Find out in this white paper.

Building a Virtual Infrastructure from Servers to Storage
This white paper discusses the virtual storage solutions that reduce cost, increase storage utilization, and address the challenges of backing up and restoring Server environments.

Gaining Faster Wireless Connections with WiMAX
Welcome to what is quickly becoming the hyperconnected world where anything that would benefit from being connected to the network will be connected. Learn more in this white paper.

Is Your Desktop a Security Threat?
The new wave of sophisticated crimeware not only targets specific companies, but also targets desktops and laptops as backdoor entryways into those business’ operations and resources. Learn how to stay safe in this white paper.

Increasing SAN Reliability by 100 Percent
Storage area networks (SAN) are a strong part of storage plans. Learn how to increase your reliability and uptime by 100 percent in this case study.

 


Got a HOT tip?   please tell us!
Free weekly newsletter
Enter your email...
Click here for a profile of each sponsor:
PLATINUM SPONSORS
(Become a sponsor)

ADVERTISEMENT
(Advertise here)

HOT TOPICS
2006 Windows Embedded retrospective
Windows CE 6 Arrives
Shared source contest winners
Ultra Mobile PCs
Spotlight on SPOT
Embedding Windows is 4X cheaper than Linux
CE "core" reduced to $3

...in our 2007
Windows Embedded Market Survey
Check out the latest Windows-powered...

mobile phones!

other cool
gadgets

REFERENCE GUIDES
Windows Device Showcase
Intro to Windows Embedded
Intro to Shared Source
Real-time Windows Embedded
Windows Embedded books

BREAKING NEWS

• Windows XP leaps onto OLPC laptop
• "1-Watt" x86 processor powers pico-ITX board
• Webcast covers Windows Mobile development
• "Software-only" GPS supports WIndows
• Atom-based ECX board runs Windows
• $7 SoC runs Windows CE
• April XPe chat transcript available
• Little thin client runs Windows CE or XP Embedded
• Microsoft releases VS 2008, NET Framework 3.5 betas
• E-reader boasts 6-inch EPD display, Windows CE
• Thin clients bulk up on software
• Microsoft warns of Windows CE 5.0 security hole
• New COM design claims extra robustness
• Windows Mobile 6.1 phone has sportscar styling
• SDIO controller supports multiple memory cards


Join our Windows Embedded discussion forums:
Windows XP Embedded
Windows CE
Windows Mobile


Windows Embedded developer newsgroups
Windows CE
XP Embedded
PocketPC
Smartphone

Microsoft's Windows Embedded resources
Embedded dev center
Mobile dev center
Windows CE tutorials
XP Embedded tutorials
Windows Embedded seminars
Windows Embedded application categories
3rd-party partners

Also visit our sister sites:


Sign up for WindowsForDevices.com's...

news feed

Home  |  News  |  Articles  |  Polls  |  Forum  |  Directory  |  About  |  Contact
 
Use of this site is governed by our Terms of Service and Privacy Policy. Except where otherwise specified, the contents of this site are copyright © 1999-2008 Ziff Davis Enterprise Holdings Inc. All Rights Reserved. Reproduction in whole or in part in any form or medium without express written permission of Ziff Davis Enterprise is prohibited. Windows is a trademark or registered trademark of Microsoft Corporation in the United States and/or other countries and is used by WindowsForDevices under license from owner. All other marks are the property of their respective owners. WindowsForDevices is an independent publication not affiliated with Microsoft Corporation.