Introductory driver writing resources
After having finished with the initial resources on the windows internals, it is time for a developer to start learning about windows drivers. The goal of this post is to provide a list of links that can be used by somebody to get accustomed with the idea of a driver, the tools that he needs to use, etc.
A very important url for this case is http://www.osronline.com. At the top of that page it says "Everything (About) Windows Driver Development" and this is (almost :) ) the case. In fact, this site has a lots of resources that are really useful both to new and to more experienced developers. The first thing that I suggest that you should do, after visiting this website is to become a member (by clicking on the "Join" button). Membership is free and it gives you access to a lot of additional helpful resources:
- First of all (and maybe most important for now) you'll find a list of "fundamental" resources at http://www.osronline.com/section.cfm?section=26. This list is consisted of several interesting subjects, like Getting Started with Windows Drivers (which is the very first document that you should read, in order to get answers to lots of your questions about drivers), Exactly what is a Driver (which gives a simple technical overview of a driver) and also some basic information about what are the threads, the rings, page fault and real mode (even though I hope that you've learned these by looking at the resources that I mentioned in my previous posts).
- Another important link in the website is the listserv. There are 3 lists that are being maintained by OSR: ntdev (various windows system-level topics), windbg (windows debugger or windbg is a really important tool for driver debugging) and ntfsd (file systems and file system filter drivers). The range of the members in these lists is pretty wide, from beginners to veterans. MOST IMPORTANTLY, there are many Microsoft employees, who participate actively in the list and answer the questions. All of the lists are a MUST-join (especially the 2 first ones, if you are not interested in file system drivers).
- Apart from the above very important links there are some more like the NT Insider (similar to an online magazine that covers articles relative to driver development), Downloads (includes many useful utilities like the Driver loader) and Hector's Memos (another interesting blog about driver development).
In addition, Microsoft also offers a lot of really valuable resources:
- By clicking here, you'll get redirected to an article that provides all the introductory information that you need about drivers: types of drivers, development environment, debugging tools (windbg rocks!), etc. It's more technical than the corresponding OSR paper, but it remains an all-encompassing easy-to-read paper.
- All the current windows drivers (excluding the legacy ones) are written in a way that is called the Windows Driver Model (WDM). However, the new model (from Windows Vista and afterwards it is the default model, however there will be versions for previous operating systems, too) is the Windows Driver Foundation (WDF). This model is much much simpler than WDM and is the model that will be used for drivers in the future (i.e. that's the model that a new driver developer should become accustomed with!). This model allows both the creation of kernel-mode and user-mode drivers. The former framework is called Kernel-Mode Driver Framework (KMDF) and you can find an introduction here. The latter framework is called User-Mode Driver Framework (UMDF) and you can find an introduction here. Also, the UMDF Beta, which includes sample code, documentation, development tools, etc can be downloaded from here.
- Another very useful website with videos from Microsoft employees is https://channel9.msdn.com/. I think that the most interesting videos for driver developers are the ones in the "Going Deep" series and the ones marked with the "Drivers" tag. Some interesting relevant topics are (I'll try to update this list int the future):
- Windows Vista's internal architecture by Rob Short (corporate vice president)
- Windows I/O manager part 1 by Nar Ganapathy (architect)
- Windows I/O manager part 2 by Nar Ganapathy (architect)
- Windows Vista I/O by Nar Ganapathy (architect)
- User-Mode Driver Framework by Peter Wieland (UMDF Dev Lead)
- Kernel-Mode Driver Framework by Doron Holan (KMDF Dev Lead)
- PreFAST for Drivers by Donn Terry (Software Developer)
- I/O cancellation (whole team)
- The Windows Driver Kit (try visiting the link with IE), which is an all-in-one driver development kit. It is the definitive source for driver development, since it includes Microsoft's public documentation about the driver model, as well as all the public APIs. The information in the WDK is relatively easy to read (up to a point). I suggest that you read "Getting started with Windows Drivers" and the "Kernel-Mode Driver Architecture Design Guide" (As much as possible. Most of the information there should be familiar after reading the Windows Internals book, too). After that, depending on the type of the driver that you are interested in (kernel-mode or user-mode) you should look at the "Kernel-Mode Framework Design Guide" or the "User-Mode Framework Design Guide" respectively. The former is more complete, but I think that the latter is written in a more simple style. Generally, the WDK is a valuable reference, so you can also find available tools, installation techniques, etc. Peter Wieland has written a post with extensive instructions on how to download the WDK (warning: it's 2.3GB!), which will allow you to take advantage of the development environment, the samples, etc.
- The public Microsoft newsgroups can be found at the newsgroup server msnews.microsoft.com (you'll need a newsgroup reader like Outlook Express to read them). The most important ones are Microsoft.pulbic.development.device.drivers, Microsoft.public.win32.programmer.kernel and Microsoft.public.windowsxp.device_driver.dev.
Comments
Anonymous
September 28, 2006
http://jasonhaley.com/blog/archive/2006/09/28/136991.aspxAnonymous
September 28, 2006
Excellent blog, very useful for those like me, whos interesting in dd development but got no clue to start. Keep up the good work. Thanks againAnonymous
October 03, 2006
oh , can u tell me about MP-safe ?Anonymous
October 03, 2006
zarob, what exactly do you need to know about MP-safe? If you want to learn about the synchronization primitives that will help you write MP-safe code, then you will find lots of useful information at http://www.microsoft.com/whdc/driver/kernel/locks.mspx as I mention in my next post.Anonymous
October 04, 2006
im not sure really . but thx anyway ~.~Anonymous
December 30, 2006
Hey, Thanks for information!Anonymous
August 30, 2007
Thanks for the article. Very useful information. One small correction required. When you introduce osronline, you are giving links to the articles ("...also some basic information about what are the threads, the rings, page fault and real mode (even though... "), the links to real should be ...article=224. The present link takes you to article=225 which is the page for Real Mode.Anonymous
August 30, 2007
In my previous comment, I made a typo. Actually the link to "rings" is not correct. I made a typo as "real" instead of rings. :)Anonymous
June 11, 2008
i want to know how to write a printer driver