Find the answer to your Linux question:
Results 1 to 10 of 10
Hello, I am tempted to write a device driver and I would like to better understand how these work before embarking on this adventure. I recently purchased a usb tv ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2009
    Posts
    5

    Basic question about device drivers


    Hello,

    I am tempted to write a device driver and I would like to better understand how these work before embarking on this adventure.

    I recently purchased a usb tv tuner card i.e. a nova hauppage and followed the instructions given on linuxtv website and finally got a working tv on my Ubuntu box.

    What I don't understand is:

    -How many layers/drivers are there between the kernel and my hauppage tuner card? Just one or several?
    -How do modules relate to each other?
    -How would you define what the firmware is?

    I also have a logitec webcam that was picked up automatically on installation by Ubuntu.
    -Where is the driver for that specific webcam located on the hard drive?
    -Can a given driver server several devices?

    Any reply, albeit partial is welcome.

    Thanks in advance,

    Julien.

  2. #2
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    Quote Originally Posted by balteo View Post
    -How many layers/drivers are there between the kernel and my hauppage tuner card? Just one or several?
    -How do modules relate to each other?
    Not sure about the number of layers. But usually there are several drivers involved, from a more general to one very specific. This is because code can often be shared, i.e. one module is used by two similar drivers. Type "lsmod" to get an idea about which modules depend on which. I assume the haupage driver at least depends on some PCI driver which in turn depends on ide_core itself.

    Quote Originally Posted by balteo View Post
    -How would you define what the firmware is?
    Software that is not executed by the main processor (CPU) but instead by a custom chip.

    Quote Originally Posted by balteo View Post
    I also have a logitec webcam that was picked up automatically on installation by Ubuntu.
    -Where is the driver for that specific webcam located on the hard drive?
    lsmod should help here too.


    Quote Originally Posted by balteo View Post
    -Can a given driver server several devices?
    Yes. For example, a driver for a filesystem is loaded only once, even if several harddrives are in place. On the other hand, you can write a driver that knows how to talk to different type models. (Most drivers have a list in their header files where they check which models they can work with.)
    Debian GNU/Linux -- You know you want it.

  3. #3
    Just Joined!
    Join Date
    Nov 2009
    Posts
    5
    I should have mentioned I am using a usb tv tuner card and not a pci one.
    thanks for your reply!
    J.

  4. #4
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    USB devices rely on a couple of USB drivers too.
    (usb_core, usb_hub? etc.)
    Debian GNU/Linux -- You know you want it.

  5. #5
    Just Joined!
    Join Date
    Nov 2009
    Posts
    5

    by the way...

    ...how can I obtain the sources for the device drivers? I am looking for the sources of usb-storage and on my ubuntu distrib the following folder:
    /usr/src/linux-headers-2.6.28-16-generic/drivers/usb/storage
    does not contain any .c files...
    Any idea?
    J.

  6. #6
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    These are just the header files. You need them when you built applications that need certain values from the driver, but no actual code.

    The kernel sources should be in some package. linux-source-$VERSION or similar.
    Debian GNU/Linux -- You know you want it.

  7. #7
    Just Joined!
    Join Date
    Nov 2009
    Posts
    5
    Actually i want to have a look at how they are coded, especially this driver.
    J.

  8. #8
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    Well, install the package then
    Debian GNU/Linux -- You know you want it.

  9. #9
    Just Joined!
    Join Date
    Nov 2009
    Posts
    5
    done, thanks!

  10. #10
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    When you are more proficient with this, you will get the most up-to-date kernel sources directly upstream.
    The Linux Kernel Archives

    They are however not yet adapted for your specific system and require some knowledge to work with.
    Debian GNU/Linux -- You know you want it.

Posting Permissions

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