Thread: hardware driver

  1. #1
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429

    hardware driver

    I asked this a while ago and never got a response so I'll ask again. I'm being asked to get training on a certain hardware driver and it's written in C.

    1) I've never written a driver so I don't know what is involved.

    2) It has even been a while (~ 1 year) since I actually used C, so I'm wondering what I should brush up on. I still remember the basics, but I'm not too keen on memory allocation or working with hardware.

    Does anyone have ANY experience in this stuff and could you even point me in a direction of any sort?

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >1) I've never written a driver so I don't know what is involved.
    It depends on the target environment and the device. Search google's Usenet archives and you'll find plenty of information.

    >I'm wondering what I should brush up on
    If you remember the basics then you should only need to brush up on your low level bit work. Refresh your memory on the bitwise operators and how they can be combined to do anything you want. You'll find yourself using them a great deal in a device driver.
    My best code is written with the delete key.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Most OS's have a standard way of representing drivers (Eg. MS-DDK)
    Finding a driver for a similar device to the one you're looking at is perhaps a good place to start.

    Other issues
    - interrupt handlers and latency issues.
    - privilege levels, direct hardware access.
    - failures and timeouts.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Registered User scrapedbr's Avatar
    Join Date
    May 2003
    Posts
    19

    Smile drivers for linux

    Linux Device Drivers is a good book to start.
    cscience.org
    gobolinux.org
    Gobolinux user: 00101100

  5. #5
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    OK... that should get me started. Does anyone know where I can actually look at some driver code? Maybe some open source stuff?

    This driver will most likely be running on a Windows OS. It is an RTP driver communcating with different sensors and controls.

    edit: and yes, I've tried google.
    Last edited by ober; 03-09-2004 at 11:48 AM.

  6. #6
    Registered User linuxdude's Avatar
    Join Date
    Mar 2003
    Location
    Louisiana
    Posts
    926
    sure kernel.org The kernal has all the drivers in them. Just don't compile it. go through and look for the driver that is closest to what you want. If you are in windows all you need is something to extract a .tar.gz or .tar.bz Don't you just love Linux

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 21
    Last Post: 06-24-2009, 09:49 AM
  2. Writing a linux hardware driver
    By nexusone in forum Linux Programming
    Replies: 1
    Last Post: 08-12-2008, 07:33 PM
  3. Registers, C++
    By yanol in forum C++ Programming
    Replies: 6
    Last Post: 06-05-2008, 02:07 AM
  4. Hardware driver
    By ober in forum C Programming
    Replies: 5
    Last Post: 11-19-2003, 08:18 AM
  5. Diving into hardware device driver in Windows
    By AsAdi in forum Windows Programming
    Replies: 1
    Last Post: 02-01-2003, 03:30 AM