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.
- 11-19-2009 #1Just 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.
- 11-19-2009 #2
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.
Software that is not executed by the main processor (CPU) but instead by a custom chip.
lsmod should help here too.
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.
- 11-19-2009 #3Just 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.
- 11-19-2009 #4
USB devices rely on a couple of USB drivers too.
(usb_core, usb_hub? etc.)Debian GNU/Linux -- You know you want it.
- 11-19-2009 #5Just 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.
- 11-19-2009 #6
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.
- 11-19-2009 #7Just Joined!
- Join Date
- Nov 2009
- Posts
- 5
Actually i want to have a look at how they are coded, especially this driver.
J.
- 11-19-2009 #8
Well, install the package then
Debian GNU/Linux -- You know you want it.
- 11-19-2009 #9Just Joined!
- Join Date
- Nov 2009
- Posts
- 5
done, thanks!
- 11-19-2009 #10
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.


Reply With Quote

