Writing Drivers

chrstrbrts

Senior member
Aug 12, 2014
522
3
81
Hello,

I have a new laptop, and I wiped the drive to put an older OS on it. Unfortunately, I cannot find any drivers for my USB 3.0 that work with my OS. I searched for hours online and could not find any options.

I've decided to try and write one myself. I have limited computer / software experience.

How arduous a task is it to write a driver? What languages are they written in? I know that I have to link my OS with the USB device and I have to know how my processor handles threads, interrupts, etc. But, do I have to consider my computer's design also?

Thanks.
 

code65536

Golden Member
Mar 7, 2006
1,006
0
76
ROTFL.

No. Drivers are hard. They are written in C and require intimate knowledge of the hardware and of kernel-level programming. Not to mention, you need to get a code-signing certificate capable of signing device drivers, and those things are very expensive, but given the enormity of the task, that's probably the least of your concerns.

Why don't you start by saying what laptop you have? (Or, better yet, stop drinking the FUD around Windows 8.1 and just use that instead of loading up an aging Windows 7 that really needs to die. 8.1 really isn't that bad, offers a number of enhancements on the desktop side, and you'd be surprised, if you gave it a proper chance.)
 
Last edited:

lxskllr

No Lifer
Nov 30, 2004
57,653
7,882
126
just use that instead of loading up an aging Windows 7 that really needs to die.

A little hasty, no? I agree Win8's alright, but 7 isn't exactly a creaking antique yet. I'm guessing he loaded XP or earlier. I would never run something like that unless I absolutely had to. I have 2kpro in a vm at work for some ancient software. I really like that startup sound. It's relaxing, and futuristic.
 

chrstrbrts

Senior member
Aug 12, 2014
522
3
81

Thank you for respecting my question. I see that you're a patient, understanding fellow who encourages others to grow through challenge.

No. Drivers are hard. They are written in C and require intimate knowledge of the hardware and of kernel-level programming.

Yes, I'm aware of that. It won't dissuade me; I like a challenge. My question is: for someone with the right knowledge, how long would it take? A year? A month? An afternoon?

Not to mention, you need to get a code-signing certificate capable of signing device drivers, and those things are very expensive

Why do I need one? Are they issued by some central authority? Why can't I just write the program and run it on my system?

(Or, better yet, stop drinking the FUD around Windows 8.1 and just use that instead of loading up an aging Windows 7 that really needs to die. 8.1 really isn't that bad, offers a number of enhancements on the desktop side, and you'd be surprised, if you gave it a proper chance.)

I tried it and hated it. They're trying to give the computer the feel of a smart phone; I didn't like it.

Besides, I loved removing the hard drive, wiping it, changing the partitioning, adjusting the BIOS, etc. It's the first time I've ever done anything like that, and I learned a lot.

In truth, I don't really care about the drive or the computer. I can afford 10. It's no big deal. I want to learn about computers. If I have to tear this one up in the process, so be it.

I'm guessing he loaded XP or earlier.

No, I loaded 7. Just cant find a driver.
 

lxskllr

No Lifer
Nov 30, 2004
57,653
7,882
126
Thank you for respecting my question. I see that you're a patient, understanding fellow who encourages others to grow through challenge.



Yes, I'm aware of that. It won't dissuade me; I like a challenge. My question is: for someone with the right knowledge, how long would it take? A year? A month? An afternoon?

USB is probably fairly easy as far as drivers go, but some things are completely undocumented. "The right knowledge" is stacking the deck in your favor from the start, when in reality, reverse engineering is necessary before you even get going. I'd look into hacking around on Linux if you're serious about giving it a go. You'll have source code to look at so you can get an idea of what needs to be done.
 

code65536

Golden Member
Mar 7, 2006
1,006
0
76
Thank you for respecting my question. I see that you're a patient, understanding fellow who encourages others to grow through challenge.
"Growing through challenge" is going off and writing a little command-line utility for yourself in C.

This is the equivalent of asking, "How hard would it be to build a modern tank from scratch, because I've got this annoying mouse that I want to kill?" I.e., you've grossly underestimated the complexity of the task, esp. in relation to the problem that you're trying to solve. Even a seasoned C programmer would consider this a fool's errand.

You may not have intended it to be funny, but your question was damn hilarious.

Yes, I'm aware of that. It won't dissuade me; I like a challenge. My question is: for someone with the right knowledge, how long would it take? A year? A month? An afternoon?
A better question would be how long would it take for someone to acquire the "right knowledge"? Systems programming with C is not exactly something a beginning programmer dips their toes in--if you ever saw the struggles that many 2nd and 3rd-year CS majors have when they first come across C, you'll know what I mean. And acquiring the "right knowledge" in its entirity in many cases may not be possible, without proprietary technical information available only to the manufacturer.

A little hasty, no? I agree Win8's alright, but 7 isn't exactly a creaking antique yet.
Mind you, I started out hating 8 and screaming that you can pry 7 from my cold dead hands. But the more I use 8 and get used to the improvements that were made, the more I want to tear my hair out when I am forced to use a computer that still has 7. So IMHO, yes, it is a decrepit dinosaur. And all it takes is a few minutes to turn off the Metro nonsense.
 
Last edited:

Ketchup

Elite Member
Sep 1, 2002
14,546
238
106
Why don't you give us the laptop model number (go ahead and verify the cpu in it) and we'll try to help. I know you did a lot of searching, but you never know.

BTW, I tried 8.1, wasn't quite to the level of hate, but would not take it over 7 if the option was available.

I am surprised you are missing the USB driver though. I wonder if you don't have the best chipset driver installed. CPU-Z should tell you what chipset you have, which may make the search easier.
 

chrstrbrts

Senior member
Aug 12, 2014
522
3
81
Why don't you give us the laptop model number (go ahead and verify the cpu in it) and we'll try to help. I know you did a lot of searching, but you never know.

BTW, I tried 8.1, wasn't quite to the level of hate, but would not take it over 7 if the option was available.

I am surprised you are missing the USB driver though. I wonder if you don't have the best chipset driver installed. CPU-Z should tell you what chipset you have, which may make the search easier.

I have a new Toshiba c55d-b5212 with an AMD A8-6410 APU processor.

Incidentally, what's a chipset?
 

stinger608

Senior member
Mar 6, 2009
951
2
81
Here is a similar topic being discussed over at Bleeping Computer forums.

http://www.bleepingcomputer.com/for...installation-on-toshiba-satellite-c55d-a5170/

Give a read through on that page and you might find a solution to your issue.

And, here is the main page for the newest AMD Chipset drivers:
http://support.amd.com/en-us/download/chipset?os=Windows+8+-+32

Downloading and installing the latest AMD chipset drivers may fix your problem.

Also, if you don't understand what a "Chipset" is I don't foresee you having the programming ability to write your own driver set. Not trying to sound like an a$$hat or anything but that would seem to be more difficult of a task than what your capable of......Now of course I could be totally off base with that opinion. If I am then I apologize.
 
Last edited:

chrstrbrts

Senior member
Aug 12, 2014
522
3
81
Found it already online. Thanks.

Also, if you don't understand what a "Chipset" is I don't foresee you having the programming ability to write your own driver set. Not trying to sound like an a$$hat or anything but that would seem to be more difficult of a task than what your capable of......Now of course I could be totally off base with that opinion. If I am then I apologize.

I looked it up. A chipset is a constituent of the motherboard that helps the processor interact with I/O devices.

Other than that, I'm clueless.

I agree with you; I have a ways to go. I'll get there one day, though.
 

Elixer

Lifer
May 7, 2002
10,376
762
126
You keep saying you are clueless, and well, that is why everyone has been saying you have a very, very long way to go.
By the time you get there, you would have already purchased quite a few machines over the years, and many new versions of windows would have been made.

Not only do you have to know how to program, you have to know the API, and also the chipset specs. If you are lucky, there might be drivers available for linux, so, you can at least get some grasp on how they are done, but, getting them done on windows is not trivial, and can get very expensive.

This isn't meant to burst your bubble, this is just giving you a sample on what it is like doing what you are asking.
 

Binky

Diamond Member
Oct 9, 1999
4,046
4
81
Simple answer: You can't write your own drivers from scratch.

More complicated answer: You might be able to find a driver that works, or tweak an existing driver made for win8 to work with (I assume you installed) Win7. If you don't know what you're doing, you might corrupt your windows installation.

Easy solution: Put Win8 back on and install the start menu app of your choice, and set it to boot right to the desktop. There's really no need to use Win7 unless you run some old legacy software that requires it. This is by FAR your best solution.
 

smakme7757

Golden Member
Nov 20, 2010
1,487
1
81
I agree with you; I have a ways to go. I'll get there one day, though.
Writing device drivers requires dedication because just understanding the programming language isn't enough. Learning to write device drivers as a hobby won't cut it unless you will be happy writing a driver for windows 7 when windows 15 is out

As the people above have mentioned a device driver makes use of a large specter of components, both software and hardware.

If you spent every evening after work learning C and current computing architecture you might be able to write a device driver within a year. That's if you're talented and that's not expecting much more than getting a device recognized.

Many programmers have been programming since their teens, have a degree and have worked for 5 years before a manufacturer will let them near their drivers.

A quick summary of what you need to know to write a device driver:


  • The difference between wait locks versus spin locks, and why spin locks might be used in an Operating System
  • Threads and processes: What these are in the Windows world versus the Unix world
  • What we mean by "thread safe", fully re-entrant, and MP safe
  • Processor modes -- What's the difference between Ring 0 and Ring 3 in an x86 architecture system
  • Memory management - User mode, versus Kernel Mode. What we mean by "demand paged virtual memory"
  • What are multiple, nested, interrupt levels
  • The difference between I/O port space and memory space
  • Something about how devices work: What a device register looks like, why/when devices interrupt
  • The definition of "direct memory access" (DMA) and the basic differences between DMA and programmed I/O relevant to a driver

More
 
Last edited:

Red Squirrel

No Lifer
May 24, 2003
67,898
12,365
126
www.anyf.ca
Is there a way you can get that USB device to work on another machine? If yes you could maybe try to "sniff" it using an oscilloscope. That would be a bare minimum start to knowing how it communicates. You'd need to basically take the wave form and convert to "packets" then try to interpret them. Not an easy task by any means. I've never done it or seen it done myself, it's just a thought.

Also what is this certificate thing? I never heard of this, what stops someone from writing a driver if they want to figure out how to? Or is this some kind of weird windows thing where the code will fail to execute if Microsoft can't approve it?

I'd trash the whole setup and go with Linux if that's the case. I don't want software that I paid for to dictate what I can or cannot do on my own machine.

Writing a driver would be a fun task actually, the hard part is trying to find the resources to read and learn how to do it. I wish they would teach at this level in school instead of making text based programs that ask your age.
 
Last edited:

smakme7757

Golden Member
Nov 20, 2010
1,487
1
81
Also what is this certificate thing? I never heard of this, what stops someone from writing a driver if they want to figure out how to? Or is this some kind of weird windows thing where the code will fail to execute if Microsoft can't approve it?
I forget when it all began (Maybe with Vista?), but current versions of Windows will only install signed drivers. That means that a manufacturer who devlops a driver will have to cryptographically sign the code with a Code Signing Certificate. This is to ensure that the code isn't tampered with between compiling and when you install it on your system.

It's primarily for security to ensure integrity of the driver when it's installed. You can disable this check if you need to for whatever purpose:

Code:
bcdedit -set loadoptions DISABLE_INTEGRITY_CHECKS
bcdedit -set TESTSIGNING ON

All major SSL root authorities will be able to provide one at varying costs.
Example: http://www.symantec.com/code-signing

Stuxnet used a stolen Real Media code signing certificate to help keep it hidden. If you try to install an unsigned driver on windows you would get the following popup:
 

inf1nity

Golden Member
Mar 12, 2013
1,191
3
0
Thank you for respecting my question. I see that you're a patient, understanding fellow who encourages others to grow through challenge.

The man is giving you solid advice. Just because he said ROTFL doesn't mean you have to go all sarcastic on him.

Drivers are not easy to code. You need a deep knowledge of Computer Science as well as an intricate understanding of the Windows environment.

Trust me, a guy who goes to a forum and asks, "How can i write a driver for my computer" is probably not going to be able to write one. The only way to do this is to study Computer Science. Or go to college to get a degree in it.
 

VirtualLarry

No Lifer
Aug 25, 2001
56,448
10,117
126
Uhm, as someone that coded direct-to-the-metal x86 assembly programming (as well as C / C++ / BASIC / Pascal), I will tell you that it isn't simple or easy. Writing a Windows application is a walk in the park compared to driver stuff. One reason for that is, it's a lot easier to debug application-level code than driver-level code.

I've never written a device driver for Win32 / NT, although I probably possess enough ASM knowledge to do so, if I had some tuts on what's needed to interface with Windows' driver stack.

I would probably need 6-12 months to get back up to speed with programming though.

It was fun writing interrupt routines for real-mode DOS though, and playing with "real flat mode" on 386 CPUs.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |