writing device drivers

Sharky Forums


Results 1 to 3 of 3

Thread: writing device drivers

  1. #1
    Reef Shark biosx's Avatar
    Join Date
    Jun 2001
    Location
    Chicago, IL, USA
    Posts
    448

    Question writing device drivers

    Just out of curiosity, I am wondering if anybody here writes (or knows how to write device drivers).

    Where did/do you learn the parameters for each device? What language(s) do you primarily use?

    I'm not really saying "teach me how to program device drivers," I'm just most interested on where most people get their info and what programming techniques they use.

    Thanks for replying

    ------------------
    ## root is the greed of all evil ##

    /* Navi Specs */
    Abit KT7-RAID
    Duron 800 @ 1GHz
    Geforce 2 GTS
    512MB Micron/Crucial SDRAM
    SB Live! 5.1 w/ Live! Drive
    Maxtor ATA100 40GB
    Pioneer 16x DVD
    HP 9300 series CD-RW
    Netgear FA311 NIC
    ## root is the greed of all evil ##

  2. #2
    Tiger Shark
    Join Date
    Mar 2001
    Posts
    615

    Post

    Well, you need documentation from the hardware manufacturers to write device drivers. Mostly in ASM, possibly C with inline ASM. Programs then access your drivers by calling whatever functions you wrote (eg, if you wrote drivers for a printer, then you may have a "printchar" function, and a program calling it could print one character at a time to your printer).
    System specs:


    | Core i5 750 | GA-P55A-UD3 | 4.0 GB G.skill DDR3 1600 | eVGA 470 GTX |
    | Intel X25-M 80 GB SSD | WD 5000AAKS | Lian Li PC-7FN | Corsair TX750W |
    | Windows 7 Home 64-bit |

  3. #3
    Expensive Sushi
    Join Date
    Mar 2001
    Location
    Dallas, TX, USA
    Posts
    23

    Post

    You can write device drivers using C/C++ more easily than in assembly. If you are writing Windows device drivers, you'll need to understand WinAPI (or use MFC) in order to access memory-mapped I/O, which is protected memory in Windows. One exception is the parallel port, LPT1 (usually base address 0x378) which is not protected and can be accessed directly without making Windows calls. Linux is an entirely different beast, but you would definitely want to write drivers in C. I agree with Zoma's comment: you will indeed need to know manufacturer specific details of the hardware in order to write drivers. The whole point of the device driver is to take hardware-independent OS calls (in the case of Windows) and translate them into the proper hardware-level calls to the device.

    Ex: Windows may have a call to "write the information stored in buffer x to the printer." The OS calls your driver's "write" function, which then takes care of the hardware specifics of your printer.

    You will definitely need to understand Windows API or MFC if you are going to write drivers.

    I don't profess to write drivers myself, but I work with some driver gurus and I know this is how they do it.

    Good luck,
    Oefinger

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •