Posted By: Charles | Sep 18th, 2006 @ 1:33 PM

In Windows Vista, we have moved many drivers out of the kernel and up into user mode, which will greatly decrease the potential for blue screens and other bad things. As always, we love making Frameworks for developers that enable them to get things done faster, even for low level stuff like drivers.

You've learned about the Kernel Mode Driver Framework. In this video, we meet Peter Wieland who is the Development Lead for the User Mode Driver Framework (UMDF) team.  We have a conversation about many topics, but one of particular interest is why we are investing so much effort in making it easier to write drivers. Driver development is a very specialized programming niche, which requires deep knowledge of the underlining system as well sophisticated programming skills. Why open it up to the masses? Peter explains...

For more info:

WHDC’s site on UMDF - It has some white papers and WinHEC 2006 presentations including Peter's “Technical Synopsis” which has a PPT animation of how I/O flows through UMDF  (slides 10 and 11 show I/O flow for a kernel stack and then a user-mode stack.)

The UMDF beta is part of the Windows Drivers Kit (WDK) beta which can be joined at http://connect.microsoft.com.  Peter posted some instructions a while back on his blog about how to get into the WDK beta. 

Peter's blog is http://blogs.msdn.com/peterwie.  "I’m not as active as I’d like to be, but there’s a long series there on DMA and drivers that folks seem to like."

Tags:
Rating:
0
0
Great interview, always good to hear more about driver dev and making it harder to crash the system!

The only thing that does worry me is the eagerness to get managed code going. In one sense obviously it would be great to make drivers in a (relative to C) easy language. You get less errors and thus hopefully a better quality product but at what cost.

I had a company laptop with a few managed services and they were certainly draining the memory. When this is taken into consideration with vista using 500MB (yeah I know its beta but still) even when idle and the fact the drivers will surely be slower anyway running in user mode it does make me a bit concerned.

Fingers crossed for an easy to use and performant driver framework Smiley


Wait, running drivers in user mode slows down processes?
Massif
Massif
aim stupidly high, expect to fail often.
I'm sure I noticed that when I installed WMP11 one of the install steps was registering the User-Mode Driver Framework.

Or words to that affect.

Does this mean that the UMDF can be taken downstream, or is the installer talking rubbish? (Or me, it could be me talking rubbish)
CRPietschmann
CRPietschmann
Chris Pietschmann
Is UMDF a set of .NET libraries? I mean, can you write device drivers in C#/VB.NET using UMDF? Or, does it still require writing device drivers in C++?

:)Lon,

We're also concerned about the performance aspects of allowing managed drivers.  Keeping the footprint of an idle managed driver host low would be a priority of ours.  The best driver doesn't consume any resources when it's idle.

One of the reasons i'm eager to get mangaged drivers working is actually to help with some of our performance issues.  Right now we run one host per device to provide isolation.  Iff the work the CLR team has done to improve app domains is as good as they say ( Smiley ), then we could potentially use those to isolate device stacks from each other and reduce the number of host processes required on a machine.

Not that it's the only option for pooling, but it's an attractive one for a number of reasons.

-p

The WMP 11 installer is speaking the truth.  UMDF is also being used by WMP on XP.

The 1.0 version is for XP only (SP2 or later, or Windows Professional 2003 SP1 for x64) and it's used by the Media Transfer Protocol drivers that WMP ships.  The plan is that this will RTM in late Sept/early Oct of this year.  Although it's general release, it's an early snapshot of UMDF and i suggest anyone who really wants to use it wait for UMDF 1.5.

The 1.5 version is for XP (same limitations as 1.0) and Vista and the redistributables will ship as part of the Vista WDK.

-p

Currently UMDF requires that you write native code.  I have hopes that we'll be able to enable managed in the future, but for now it's C or C++.

I imagine you could put together a native shim that would let you write a managed driver.  I don't honestly know if the interfaces we've defined will work through COM Interop or if you'd have to provide hand-built wrappers.

staceyw
staceyw
Before C# there was darkness...
Charles wrote:

stunna wrote: Wait, running drivers in user mode slows down processes?


What do you mean? Running drivers in user mode will incur some amount of performance cost given there's an extra step to getting data through the kernel which ultimately communicates with hardware...

Great work has been done to proxy data from user to kernel extremely efficiently in Vista. Check out the video with Darryl Havens and other senior Windows architects here where this user-kernel communication process is explained.


Given that a kernel trans needs to happen either way, I wonder if usermode may (under some operations) be faster as it could possibly (with proper driver design) reduce the number of kernel transistions.  Just a thought.