PDA

View Full Version : how to program device drivers


Bmxpunk86pl
12-29-01, 07:44 PM
yea how would you program a device driver with C++. How would you declare it to do something with hardware?

XprincoX
12-30-01, 02:19 AM
well device drivers IMO usually are programmed in assemble, as u can optimize performace much easier than with a high lvl language like c++. :D

Vovan
12-30-01, 04:28 AM
Originally posted by Xprincox
well device drivers IMO usually are programmed in assemble, as u can optimize performace much easier than with a high lvl language like c++. :D
C++ IS NOT A HIGH LANGUAGE!
It translates its codes in asm and does the linkage.


Generaly you can write drivers in C because normal realizations allow writing asm{} and _asm{} code inline, but also a linkage with any ASM .OBJ file(s). Consider some info from Microsoft MSDN on WDMs and other driver types.


P.S.
I hope you are not going to write a driver for your processor ;) ;) ;) ;)

XprincoX
12-30-01, 01:51 PM
"C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup :D

XWRed1
12-31-01, 04:21 AM
yea how would you program a device driver with C++. How would you declare it to do something with hardware?

Err... making a device driver is supposed to be fairly daunting. MS probably has an SDK for it somewhere, I hear its a real nightmare in Windows. You'd probably be using C or C++ to interface with the OS, with some inline assembler sprinkled in to talk to the hardware.

What exactly are you trying to write a driver for? I'd imagine the company making the hardware has already provided a Windows driver. Gonna try writing some Linux device drivers?

Bmxpunk86pl
12-31-01, 10:06 AM
NO i was just wondering, im not gonna write a device driver, i was only curious on how to.

6502kid
01-05-02, 04:24 AM
Take 2 or 3 college courses in assembler, and you will
begin to get an idea of what is involved in coding a
device driver.

Not for the timid....

XprincoX
01-05-02, 04:38 AM
Originally posted by 6502kid
Take 2 or 3 college courses in assembler, and you will
begin to get an idea of what is involved in coding a
device driver.

Not for the timid....

you got that right.... :eek: