Question:
How can I code a custom firmware driver?
2008-10-08 17:11:54 UTC
With Windows XP and Up, when you plug in a USB drive, or I think maybe a PCI Express Card too, it automatically installs a driver from the device so that it can be used. Is it possible to make a custom driver for a USB drive or maybe even a PCI Express (Video) Card? I would like to just plug in a USB Stick and for the computer to recognize it, and install the driver (preferably an exe of some sort) I understand this wouldn't be very easy and probably, for at least the PCI Card, I'd have to get additional soft/hardware to program it into the device. But is it possible?
Three answers:
Answers For Everything
2008-10-08 20:16:49 UTC
I've not played with this much but a good start might be to open the existing driver's .ini text file and see if there is anything you can change in that which would do what you want. That would be the easiest route. The .ini file is basically just the device's settings, some of which you can't access through XP's device manager. This isn't flawless though. If you enter a wrong setting, you could cause your computer to lose its ability to communicate with the device. Make sure you have a backup computer that you can use while you work on the one you're playing with drivers on. You may also risk damaging your hardware if, say, you write a driver for your CD drive which inadvertantly unlocks an unsupported experimental speed setting that was disabled because it causes the drive to spin so fast that the rotor breaks free of the housing and kills your drive. Other things like that can cause you to lose control of practically any part of your hardware and sometimes if the driver contains an incorrect hardware address or something you could end up with a situation where, for example, you send a draw command to the video card and it is rerouted to the hard disk and translated into a format command. You could lose all the software, files, and partitions on your hard disk. That is incredibly unlikely, but there is a good chance that you'll eventually wreck some piece of hardware on your system to the point that it will be a big hassle to fix.



As for .exe files, first you would need some sort of IDE/development software. Visual Studio is great, but pretty much any development program that can do .dll files should let you do drivers. Next you will need to know a programming language. Visual Basic .NET is really easy, but might not let you write drivers very easily because VB .NET is meant to do high level programming quickly.



C, C++ or Visual C# .NET might be a better bet since they allow you lower level contol of resources, but they are much more strict, long winded languages that often require you to spell out a lot of details and work around complex limitations. Languages based on C also have very inflexible "grammar" so you'll spend a lot of time trying to figure out problems related to missing semicolons, capitalization errors and stuff that is less common in VB .NET. Both .NET languages might be a bit picky about letting you access certain resources though since they run in something akin to an emulator that may or may not let you access non-generic hardware in a straight forward way. Visual Studio, like many IDEs, likes to know a fair amount about a device before it will let you build a program that will talk to it. I'm not sure about C#, but in VB, hardware Input/Output can be quite painful. It is the only thing I've given up on.



Java might work well too, but I have no experience with it. If you don't have any experience with programming, try downloading and playing with Microsoft QuickBasic. It is fairly limited, but you can still do some cool stuff with it.



I wish you luck with this, let me know how it goes, and PLEASE BE CAREFUL!
Psychic Computer RepairĀ® PEBKAC?
2008-10-09 00:32:52 UTC
Of course it is possible. The manufactures of the hardware do it all the time. But why would you want to? Is there something wrong with the driver you have now?



Building a driver is not an easy task and the rewards for doing it are almost nothing.



http://www.osronline.com/article.cfm?article=20
ELfaGeek
2008-10-09 12:16:16 UTC
This is NOT a firmware or device driver issue.



What EXACTLY, are you trying to do???



It sounds to me like you are trying to play a game DIRECTLY from a USB Flash Drive (UFD) without installing the game properly on the PC.



If so, only "portable versions", specifically written to run from a UFD, will do what you want. And, as far as I know, there are very few games designed to do that.



if you're trying to do something else, please re-post with specifics. Then, maybe we can help.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...