Skip to main content
gamedev.net
🔒 Locked

Custom Mouse Driver Help

Started by digital_phantom 3 replies 1.4k views
Original Post
digital_phantom
digital_phantom
I have a question that has to do with device drivers. I plan on modifying a spare mouse I have laying around to act a little different, and to do this I need to be able to make my own device driver for the mouse (it's a usb mouse), by any chance does anyone know anything about creating device drivers, and more helpful, mouse drivers All I need is a generic usb mouse driver source code or know how to do so, and then I can modify it from there. Thanks in advance.
Extrarius
Extrarius
If you're doing it on windows, you'll need to purchase either the Driver Development Kit(being phased out) or the Windows Driver Kit(the DDK replacement).

To put it simply, driver development is probably the messiest, most hackish coding you'll ever see. It's not really the kind of thing you do for fun unless you have a _LOT_ of spare time to read up on everything and even more time to repeatedly bluescreen your PC (or a secondary machine, if you're lucky enough to have one). As long as you make sure you only temporarily install your test drivers (meaning you cause them to run now, but not on every restart), you should be fine, but the far better way to do it would be to get an MSDN subscription so you can get a checked version of windows, which has extra support for debugging and kernel-mode development (consider it the debug build).

You can find several examples of drivers in the DDK (and presumably the WDK), but most of them require understanding of most of the DDK and driver development, so don't expect to be able to copy/paste/modify without understanding the whole system because you're not likely to get it to work that way.

Finally, know that making drivers is not easy. There is a reason that just about every single company gets it wrong, and it's not (entirely) incompetence.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Emmanuel Deloget
Emmanuel Deloget
Quote:
Original post by Extrarius
If you're doing it on windows, you'll need to purchase either the Driver Development Kit(being phased out) or the Windows Driver Kit(the DDK replacement).

To put it simply, driver development is some of the messiest, hackish coding you'll probably ever see. It's not really the kind of thing you do for fun unless you have a _LOT_ of spare time to read up on everything and even more time to bluescreen your PC (or a secondary machine, if you're lucky enough to have one). As long as you make sure you only temporarily install your test drivers (meaning you cause them to run now, but not on every restart), you should be fine, but the far better way to do it would be to get an MSDN subscription so you can get a checked version of windows, which has extra support for debugging and kernel-mode development.

Finally, know that making drivers is not easy. There is a reason that just about every single company gets it wrong, and it's not (entirely) incompetence.


It is not that messy - if you have the correct tools. The WDK or the DDK are C interfaces, and they are quite painfull (a minimum driver using the DDK is way too long to implement - something like 1000 lines of code IIRC). But some companies are selling very interesting products (such as Numega's DriverStudio (3000$)).

Note that you'll still have to understand key concepts of windows device driver development (what an IRQL is, how to handle an interruption and so on). This is not easy - I experienced this during three years, and I really had problems to get a correct grasp on everything, including the difficult memory handling scheme).

Regards,
digital_phantom
digital_phantom
Thanks everyone who has posted in here, I will look up the user-mode drivers, I just finished downloading them and the kernel-mode drivers as well.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.