Suggestions for getting started with driver development

Greetings!

I have an obscure piece of hardware (a PowerFile R200 200-disc DVD jukebox, http://amzn.to/cGOCiO) which is no longer supported by the manufacturer. While 32bit versions of the drivers are available, there’s nothing for 64bit systems which is what I want to attach the box to. The device, which attaches via IEEE 1394, is AFAIK, relatively simple, most likely needing only to support next-disk/prev-disk/load/unload and inventory operations. However, as I doubt anyone will step up to update the medium changer driver, I thought this might be a good first step in learning Windows internals (I used to develop in ANSI C++ and with CORBA on Solaris, but that was a long time ago, in a galaxy far away).

Based on my research, it looks like I would be fine writing a filter driver using WDF, and while I’ve ordered the Windows 7 Device Driver book which should serve my purposes, it doesn’t ship until later in December and I’d like to get started studying now.

While I’ve found lots of information about driver development, I haven’t yet come across a “start here to get to there” sort of guide that applies to my problem above. Furthermore, apart from the one 1394 sample in the DDK, there seems to be precious little documentation about interfacing with 1394 devices and the Microsoft Driver Development Introduction seems to be purely focused on tools and not techniques.

I was considering ordering the OSR USB FX2 Learning Kit just for getting started, but I don’t believe it has any sort of accompanying tutorials apart from the code samples, so I was wondering, as a pure beginner faced with the problem above, is there a recommended learning path that I should follow?

As an aside, this is a hobbyist project and, as such, I do not have the budget to take the OSR training (though I wish I did), nor do I have access to MSDN to pull down checked builds of Win7 or Server 2008 R2. So it’ll be even more difficult for me to proceed, though hopefully not impossible.

I’ve searched, and read articles under The Basics on OSR, but I thought I’d consult the expert community for guidance. If I’ve overlooked something obvious, you have my apologies.

Thank you in advance for your guidance and suggestions!

The first thing that I would recommend that you do is get a hold of a copy
of ‘Windows Internals’ and read it. It won’t tell you how to write drivers,
but it will give you a good introduction to the Windows architecture, which
is important.

Good luck,

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@leydenjar.com
Sent: Wednesday, November 03, 2010 4:01 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Suggestions for getting started with driver development

Greetings!

I have an obscure piece of hardware (a PowerFile R200 200-disc DVD jukebox,
http://amzn.to/cGOCiO) which is no longer supported by the manufacturer.
While 32bit versions of the drivers are available, there’s nothing for 64bit
systems which is what I want to attach the box to. The device, which
attaches via IEEE 1394, is AFAIK, relatively simple, most likely needing
only to support next-disk/prev-disk/load/unload and inventory operations.
However, as I doubt anyone will step up to update the medium changer driver,
I thought this might be a good first step in learning Windows internals (I
used to develop in ANSI C++ and with CORBA on Solaris, but that was a long
time ago, in a galaxy far away).

Based on my research, it looks like I would be fine writing a filter driver
using WDF, and while I’ve ordered the Windows 7 Device Driver book which
should serve my purposes, it doesn’t ship until later in December and I’d
like to get started studying now.

While I’ve found lots of information about driver development, I haven’t yet
come across a “start here to get to there” sort of guide that applies to my
problem above. Furthermore, apart from the one 1394 sample in the DDK, there
seems to be precious little documentation about interfacing with 1394
devices and the Microsoft Driver Development Introduction seems to be purely
focused on tools and not techniques.

I was considering ordering the OSR USB FX2 Learning Kit just for getting
started, but I don’t believe it has any sort of accompanying tutorials apart
from the code samples, so I was wondering, as a pure beginner faced with the
problem above, is there a recommended learning path that I should follow?

As an aside, this is a hobbyist project and, as such, I do not have the
budget to take the OSR training (though I wish I did), nor do I have access
to MSDN to pull down checked builds of Win7 or Server 2008 R2. So it’ll be
even more difficult for me to proceed, though hopefully not impossible.

I’ve searched, and read articles under The Basics on OSR, but I thought I’d
consult the expert community for guidance. If I’ve overlooked something
obvious, you have my apologies.

Thank you in advance for your guidance and suggestions!


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

xxxxx@leydenjar.com wrote:

I have an obscure piece of hardware (a PowerFile R200 200-disc DVD jukebox, http://amzn.to/cGOCiO) which is no longer supported by the manufacturer. While 32bit versions of the drivers are available, there’s nothing for 64bit systems which is what I want to attach the box to. The device, which attaches via IEEE 1394, is AFAIK, relatively simple, most likely needing only to support next-disk/prev-disk/load/unload and inventory operations. However, as I doubt anyone will step up to update the medium changer driver,…

Do you have a specification for the device that describes the command
you need to send? If not, you’d pretty much be shooting in the dark.

Removable Storage Manager has been removed from Win 7, so there’s not
much operating system support for this kind of device any more.

Based on my research, it looks like I would be fine writing a filter driver using WDF, and while I’ve ordered the Windows 7 Device Driver book which should serve my purposes, it doesn’t ship until later in December and I’d like to get started studying now.

What would you be filtering? Does the device do anything at all when
you plug it in? Does it appear as a standard one-slot DVD drive?

While I’ve found lots of information about driver development, I haven’t yet come across a “start here to get to there” sort of guide that applies to my problem above. Furthermore, apart from the one 1394 sample in the DDK, there seems to be precious little documentation about interfacing with 1394 devices and the Microsoft Driver Development Introduction seems to be purely focused on tools and not techniques.

Well, 1394 is a standard, so the details about how 1394 devices work is
in the specifications. IEEE charges for the 1394 documents, although
there are books you can buy that describe the basic functionality.

I was considering ordering the OSR USB FX2 Learning Kit just for getting started, but I don’t believe it has any sort of accompanying tutorials apart from the code samples, so I was wondering, as a pure beginner faced with the problem above, is there a recommended learning path that I should follow?

Interesting path. USB and 1394 have much in common, so the knowledge
would not be wasted, although I think you have issues beyond the simple
mechanics of drivers and 1394.

As an aside, this is a hobbyist project and, as such, I do not have the budget to take the OSR training (though I wish I did), nor do I have access to MSDN to pull down checked builds of Win7 or Server 2008 R2. So it’ll be even more difficult for me to proceed, though hopefully not impossible.

You don’t need a checked build. You do need the WDK and the debuggers.
You will need two computers, so you can run the kernel debugger.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Mr. O’Brien,

Thank you very much for the suggestion. While the book seems quite the tome (1,264 pages!) it seems to be a top-tier resource and I’ll pick it up. Thankfully, it seems to have exercises rather than just being pure reference, as I’m a do-a-thing-to-learn-a-thing kind of guy.

Mr. Roberts,

Thank you very much as well, and I’ll do my best to answer (A) your questions (Q) and respond (R)to your comments (C).

Q: “Do you have a specification for the device that describes the command
you need to send? If not, you’d pretty much be shooting in the dark.”
A: Sadly, no. However, I was thinking about using the free version of Bus Hound to see if I could decipher the traffic being passed. Also, I was hoping to reach out to the manufacturer, though that’s a serious long shot.

C: “Removable Storage Manager has been removed from Win 7, so there’s not
much operating system support for this kind of device any more.”
R: I don’t think I necessarily need the OS to fully support the device; at a minimum, just a command line or basic GUI app that can issue the limited set of commands (next/prev/eject/load/status) should be sufficient.

Q: “What would you be filtering? Does the device do anything at all when
you plug it in? Does it appear as a standard one-slot DVD drive?”
A: Good question. I know next-to-nothing about drivers, so I don’t know what would need to be filtered, although from this article (http://www.osronline.com/article.cfm?article=489) where it says “You need to write a filter driver to modify or add-value to the behavior of (most any) device stack in Windows.” I assumed that I would be adding value to the 1394 device stack and thus a filter driver was the correct approach, though I am most likely mistaken. When the device is plugged in, the dual DVD drives mount normally (and discs in them can be accesses) and the medium changer shows up in the Device Manager (NB: this is on a 2008 R2 system).

C: “Well, 1394 is a standard, so the details about how 1394 devices work is
in the specifications. IEEE charges for the 1394 documents, although
there are books you can buy that describe the basic functionality.”
A: I think I’m more concerned about the API for interfacing with the stack at the appropriate level, though what constitutes “appropriate” remains a mystery. The IEEE docs I have seen appear to be much lower level than I might need, though they were free and perhaps not the ones you were referring to.

C: “You don’t need a checked build. You do need the WDK and the debuggers.
You will need two computers, so you can run the kernel debugger.”
R: Thankfully, I have that much ready to go (although I only have one 1394 card, so I’ll have to serial-debug).

Much obliged!

You can get another 1394 card for about $20 to use for debugging.  It’s well worth it.

----- Original Message -----
From: xxxxx@leydenjar.com
To: “Windows System Software Devs Interest List”
Sent: Wednesday, November 3, 2010 2:45:14 PM
Subject: RE:[ntdev] Suggestions for getting started with driver development

Mr. O’Brien,

Thank you very much for the suggestion. While the book seems quite the tome (1,264 pages!) it seems to be a top-tier resource and I’ll pick it up. Thankfully, it seems to have exercises rather than just being pure reference, as I’m a do-a-thing-to-learn-a-thing kind of guy.

Mr. Roberts,

Thank you very much as well, and I’ll do my best to answer (A) your questions (Q) and respond (R)to your comments (C).

Q: “Do you have a specification for the device that describes the command
you need to send? If not, you’d pretty much be shooting in the dark.”
A: Sadly, no. However, I was thinking about using the free version of Bus Hound to see if I could decipher the traffic being passed. Also, I was hoping to reach out to the manufacturer, though that’s a serious long shot.

C: “Removable Storage Manager has been removed from Win 7, so there’s not
much operating system support for this kind of device any more.”
R: I don’t think I necessarily need the OS to fully support the device; at a minimum, just a command line or basic GUI app that can issue the limited set of commands (next/prev/eject/load/status) should be sufficient.

Q: “What would you be filtering? Does the device do anything at all when
you plug it in? Does it appear as a standard one-slot DVD drive?”
A: Good question. I know next-to-nothing about drivers, so I don’t know what would need to be filtered, although from this article (http://www.osronline.com/article.cfm?article=489) where it says “You need to write a filter driver to modify or add-value to the behavior of (most any) device stack in Windows.” I assumed that I would be adding value to the 1394 device stack and thus a filter driver was the correct approach, though I am most likely mistaken. When the device is plugged in, the dual DVD drives mount normally (and discs in them can be accesses) and the medium changer shows up in the Device Manager (NB: this is on a 2008 R2 system).

C: “Well, 1394 is a standard, so the details about how 1394 devices work is
in the specifications. IEEE charges for the 1394 documents, although
there are books you can buy that describe the basic functionality.”
A: I think I’m more concerned about the API for interfacing with the stack at the appropriate level, though what constitutes “appropriate” remains a mystery. The IEEE docs I have seen appear to be much lower level than I might need, though they were free and perhaps not the ones you were referring to.

C: “You don’t need a checked build. You do need the WDK and the debuggers.
You will need two computers, so you can run the kernel debugger.”
R: Thankfully, I have that much ready to go (although I only have one 1394 card, so I’ll have to serial-debug).


Much obliged!


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

If you do decide to get one, be sure to get one that is known to work with windbg. Something based on the TI chipset is best.

https://www.osronline.com/store/moreinfo.cfm?Product_ID=92

Good luck,

mm

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@comcast.net
Sent: Wednesday, November 03, 2010 5:05 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Suggestions for getting started with driver development

You can get another 1394 card for about $20 to use for debugging. It’s well worth it.

----- Original Message -----
From: xxxxx@leydenjar.com
To: “Windows System Software Devs Interest List”
Sent: Wednesday, November 3, 2010 2:45:14 PM
Subject: RE:[ntdev] Suggestions for getting started with driver development

Mr. O’Brien,

Thank you very much for the suggestion. While the book seems quite the tome (1,264 pages!) it seems to be a top-tier resource and I’ll pick it up. Thankfully, it seems to have exercises rather than just being pure reference, as I’m a do-a-thing-to-learn-a-thing kind of guy.

Mr. Roberts,

Thank you very much as well, and I’ll do my best to answer (A) your questions (Q) and respond (R)to your comments (C).

Q: “Do you have a specification for the device that describes the command
you need to send? If not, you’d pretty much be shooting in the dark.”
A: Sadly, no. However, I was thinking about using the free version of Bus Hound to see if I could decipher the traffic being passed. Also, I was hoping to reach out to the manufacturer, though that’s a serious long shot.

C: “Removable Storage Manager has been removed from Win 7, so there’s not
much operating system support for this kind of device any more.”
R: I don’t think I necessarily need the OS to fully support the device; at a minimum, just a command line or basic GUI app that can issue the limited set of commands (next/prev/eject/load/status) should be sufficient.

Q: “What would you be filtering? Does the device do anything at all when
you plug it in? Does it appear as a standard one-slot DVD drive?”
A: Good question. I know next-to-nothing about drivers, so I don’t know what would need to be filtered, although from this article (http://www.osronline.com/article.cfm?article=489) where it says “You need to write a filter driver to modify or add-value to the behavior of (most any) device stack in Windows.” I assumed that I would be adding value to the 1394 device stack and thus a filter driver was the correct approach, though I am most likely mistaken. When the device is plugged in, the dual DVD drives mount normally (and discs in them can be accesses) and the medium changer shows up in the Device Manager (NB: this is on a 2008 R2 system).

C: “Well, 1394 is a standard, so the details about how 1394 devices work is
in the specifications. IEEE charges for the 1394 documents, although
there are books you can buy that describe the basic functionality.”
A: I think I’m more concerned about the API for interfacing with the stack at the appropriate level, though what constitutes “appropriate” remains a mystery. The IEEE docs I have seen appear to be much lower level than I might need, though they were free and perhaps not the ones you were referring to.

C: “You don’t need a checked build. You do need the WDK and the debuggers.
You will need two computers, so you can run the kernel debugger.”
R: Thankfully, I have that much ready to go (although I only have one 1394 card, so I’ll have to serial-debug).

Much obliged!


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Regarding a secondary card, it’s just that the dev box that I’m working on only has one PCIe slot, which is occupied by the card connected to the external device. Is serial debugging that terrible?

To all: I very much appreciate your assitance. I’ve worked on getting this project underway, but I’d be at a dead end were it not for this forum. Now, off to the bookstore to pick up Windows Internals!

Generally, speaking no, serial debugging is not terrible, though it can be a
little slow sometimes; however, there are a few operations (like creating a
crashdump) that are basically insufferable over serial.

Good luck,

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@leydenjar.com
Sent: Wednesday, November 03, 2010 5:19 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Suggestions for getting started with driver development

Regarding a secondary card, it’s just that the dev box that I’m working on
only has one PCIe slot, which is occupied by the card connected to the
external device. Is serial debugging that terrible?

To all: I very much appreciate your assitance. I’ve worked on getting this
project underway, but I’d be at a dead end were it not for this forum. Now,
off to the bookstore to pick up Windows Internals!


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Serial debugging is not that terrible, but I prefer 1394 just because I don’t need to think too hard about what kind of cable to get.

While you’re at the book store, you might consider Walter Oney’s book from Microsoft Press.  “Developing Drivers with the Windows Driver Foundation”, also from Microsoft Press, covers the latest dialect of driver devlopment API. 

Good luck,

----- Original Message -----
From: xxxxx@leydenjar.com
To: “Windows System Software Devs Interest List”
Sent: Wednesday, November 3, 2010 3:18:30 PM
Subject: RE:[ntdev] Suggestions for getting started with driver development

Regarding a secondary card, it’s just that the dev box that I’m working on only has one PCIe slot, which is occupied by the card connected to the external device. Is serial debugging that terrible?

To all: I very much appreciate your assitance. I’ve worked on getting this project underway, but I’d be at a dead end were it not for this forum. Now, off to the bookstore to pick up Windows Internals!


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

xxxxx@leydenjar.com wrote:

Q: “What would you be filtering? Does the device do anything at all when
you plug it in? Does it appear as a standard one-slot DVD drive?”
A: Good question. I know next-to-nothing about drivers, so I don’t know what would need to be filtered, although from this article (http://www.osronline.com/article.cfm?article=489) where it says “You need to write a filter driver to modify or add-value to the behavior of (most any) device stack in Windows.” I assumed that I would be adding value to the 1394 device stack and thus a filter driver was the correct approach, though I am most likely mistaken.

No. The 1394 bus driver will create a “device object” specifically for
your device (as it does for each device it finds). That device object
that needs a function-specific driver. If it is already appearing as a
DVD drive, then that’s the function driver, and that’s where you’ll need
to focus. That would be the driver that “owns” this 1394 device.

When the device is plugged in, the dual DVD drives mount normally (and discs in them can be accesses) and the medium changer shows up in the Device Manager (NB: this is on a 2008 R2 system).

Is that how it appears on a 64-bit system? If so, then you may be right
that all you need is a filter driver. But if it comes up as an
“unrecognized device”, then you have a more significant problem.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.