Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement a USB device driver for Windows?

How should I approach implementing a USB device driver for Windows? How should I take into account different versions of windows e.g: - Windows XP - Windows Vista - Windows 7

Is there open source solutions which could be used as a starting point? I'm a total newbie to windows driver development.

We have an embedded device with USB device port and we would like to have as low latency communication from the application level to the device as possible without sacrificing the data throughput. The actual data transferred is ADC/DAC data. Basically there is a lot of data which we need to transfer to a Windows machine as fast as possible.

like image 559
Velho Kerho Avatar asked Oct 13 '09 21:10

Velho Kerho


People also ask

How do I create a device driver in Windows 10?

Select and hold (or right-click) the driver project and choose Properties. Under Configuration Properties->Driver, verify that Target Platform is set to Windows Drivers. To build a driver that runs on Windows 10 for Desktop editions only, select Desktop. Build the driver.


2 Answers

We need more information about the device to point you in the right direction, but here are a few steps to get you started:

  • register with Microsoft Connect so you can download the Windows Driver Kit
  • register with osr-online as you'll find great articles, plenty of information, and a newsgroup dediciated just to Windows drivers -- this place is a goldmine
  • buy Developing Drivers with WDF, which will help you make sense of driver development on Windows and give you a good foundation to read articles from OSR and Microsoft
  • Hope that you can use UMDF (user-mode drivers) as you can use C++ and just write COM code. If you're doing anything with USB that requires kernel-space....you've got a lot of reading and learning to do for the next year!

To answer your question on versions, the Driver Kit has tools that will help you manage creating different drivers. If you write a good driver, it should run on all three OS with no problems, and the differences will just be in the config area (not the binary)

Basically, it depends on how complex your device is. What type of driver are you trying to write? File system? MP3 player? Camera? Modem?

If you end up having to write a kernel mode driver, let me know and I can point you to some good articles and what not.

I should also add that for around US $5,000, you can buy a license for WinDriver, a tool that takes all of the hard stuff out of driver development. You can use C++ or C# user-mode code to communicate with their driver that is custom generated for your device. This is the way to go if you have a tight deadline.

like image 138
Dr. Watson Avatar answered Oct 25 '22 15:10

Dr. Watson


You can take a look at windows variant of libusb *here*. There are wrappers for many programming languages on official libusb site and on the web.

like image 42
avra Avatar answered Oct 25 '22 15:10

avra