Let me start by saying that here at OSR we love KMDF. Sure, there are still some rough edges. But we think KMDF is just about the best thing done for Windows driver development since the creation of Driver Verifier. There is, however, one key item missing that's keeping KMDF from fulfilling its full promise: Release of the source code.
KMDF is a wrapper -- A framework. Like MFC over Win32, KMDF makes using the WDF goo below it both more convenient and more reliable. And, like MFC, the sources for KMDF need to be made available to developers.
Why is it important for Microsoft to release the KMDF source code? Let me enumerate several reasons:
1) Debugging KMDF drivers would be easier. When you get back an error code from a KMDF function call, or your driver breakpoints in KMDF Verifier, it'd be pretty simple to check the sources to help identify the root of the problem.
2) With community review of the source code, KMDF bugs would be fixed sooner. Like they say in the open-source movement, lots of people looking at the code can only result in better code.
3) Sources would make it easier (er, possible) for KMDF drivers to take advantage of the many checks that Driver Verifier provides. Driver Verifier has been through years of development and enhancement. It's probably the single most important tool in ensuring quality driver development. Yet, using Driver Verifier with a KMDF driver is enough to try the skill and patience of even the most experienced driver dev. With KMDF source code, the underlying mechanics of KMDF will be visible, and Driver Verifier can once again be used to spot problems.
4) Source availability would remove one of the last existing barriers to KMDF adoption. Though it may be hard to believe, there are still those in the community that won't buy into another "black box" released by Microsoft. They say they've been burnt by alternative driver models in the past. But, with the release of the KMDF source code, this argument would evaporate.
5) People in the community should get a look at what real Windows code looks like. I've seen the KMDF sources. Like most of Windows, KMDF is darn well written. It's good code. The functions are properly limited in scope, the variable and function names are descriptive, and the in-line comments are excellent. Not at all like most of the slop code folks are used to seeing in the open source world. And, better than much of the code in the WDK sample drivers. It's time for the community to get a look at what properly written kernel-mode code should look like.
6) Good Will. Providing the sources to the community would generate vast amounts of good will for Microsoft in general and the groups responsible for WDF and the WDK in particular. Imagine Microsoft releasing source code as a way to help support its most valuable and strategically important partners: The driver development community. It would be a major, concrete, demonstration of how much Microsoft values our community.
The community isn't monolithic, and every member doesn't agree on the form that a release of KMDF sources should take. Some feel that the KMDF source code should be released freely, to all who are interested, just like MFC. Other community members feel that any release of KMDF source code will not be useful unless the sources are buildable into actual Framework libraries. Here are OSR, we seek more modest goals, at least for the initial KMDF source code release.
Here's what OSR proposes as reasonable guidelines for the initial iteration of a KMDF source code program:
First, we strongly believe that -- like MFC -- the sources that are released for KMDF should not be buildable into binary form. We can't imagine any worse scenario than having multiple, mutant, customized KMDF libraries floating around customer systems. OSR believes that the primary goal of releasing the KMDF sources should be to support the community's development efforts. This goal can be accomplished quite easily, without shipping a buildable version of the Framework.
Next, we think that it's reasonable to require some sort of "auxiliary" license for KMDF source code access. Sure, it would be great if you just got the KMDF sources when you installed the WDK. But, realistically, until Microsoft has gained some experience with this program, we think it's reasonable to require you to "opt in" and sign an NDA before you get access to the KMDF sources. It might even be reasonable to require folks to agree to not work on developing an operating system other than Windows for some period of time after viewing the source code (this is a provision that's traditionally present in Windows source code licenses).
Finally, it is our position that the source code must be released in a downloadable format, suitable for reviewing in your editor of choice and using with the debugger. Some alternate form of source code access via HTTPS on the web, or something like that, just won't work for KMDF.
Calling All Community Members: It doesn't matter if you agree or disagree with OSR's proposed guidelines. They're just our proposals. If you want Microsoft to release the KMDF source code, stop reading this article right now and send an email to firstname.lastname@example.org. Trust me on this: The number of emails they receive matters, getting emails from folks in multiple countries matters, emails from as many different types of people (dev, test, management) matters. You can write something simple, like "Please release the KMDF source code. This will help me write Windows drivers faster and with fewer bugs", you can write something long, reasoned and elaborate, or you can write something in between. If you really want to make an impact, get your VP or CEO to send a short email saying "Release of the KMDF source code will help our dev and test teams produce better quality Windows drivers" (and be sure they sign the email with their title).
But whatever you do, please send your opinion to email@example.com.
While I've never heard anybody at Microsoft be so foolish as to promise the release of KMDF source code, the mantra has always been "we'll try." Well, folks, it's time we returned this issue to the Microsoft radar-screen, and helped our friends in Redmond with the evidence they need to convince the powers that be that the community really wants this release. So, go send an email right now. C'mon!