Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

High Level language not suitable for writing hardware device driver???

Status
Not open for further replies.

pirigyi

Technical User
Apr 26, 2001
11
US
I'm new to programming and I was wondering if...

someone can please provide a few reasons why a High Level language is not suitable for writing a hardware device driver.

1. I understand it makes too much executable code causing it to run slow.

2. It's difficult to access hardware.

Anything else...

Thanks a million!
 
There are some machine instructions which may be essential to the proper operation of a driver that a high-level language may not be capable of generating. Jay
 
3. Drivers have a special format which HLL's can't generate. (very important)

4. HLL's can't do inport and outport operations without calling separate functions.

5. HLL's use DOS a lot. However, when it is called, the driver IS DOS! It can't call itself!

NOTE: While HLL's can't be used as the BASIS for a driver, they (mostly C) CAN be used as SUPPORT for the driver (e.g. to output the driver's name on-screen using BIOS functions). Also, in theory you can make a "driver stub" in Assembly and use an HLL to fill the important parts - although you certainly will contend with low speeds and high mem usage.
 
AmkG, can you not do inport/output operations with inline assembly?
 
There's still consideration 3 to consider even if you can avoid considerations 4 and 5. I mentioned #3 is VERY important, at least in DOS. In theory, incidentally, you can make an asm header which handles the special header format, and link in your own HLL driver to that asm header. It may have been done already, in fact.

And if you're gonna dabble in ASM anyway, why not go ALL the way? "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top