From: Peter S. <pe...@st...> - 2009-01-27 17:55:14
|
Hi again, Venkatesh Rao wrote: > We have read and got ourselves familiarised with the USB interface > by reading Jan Axelson - USB Complete. While that book is an easy read, it can not replace reading the USB specification document itself. I would recommend starting with the USB 2.0 Specification. Go to usb.org. 3.0 was released a month or two ago, and is the latest and greatest, but it is simply too new to be useful at this point. Very few products, if any, support USB 3. > We are also reading the third edition of Writing device drivers by > Oreilly Publications. Great. > also we are reading all about urbs, craeting, cancelling, > submitting them etc. It sounds like you are making progress. > as these things go on side by side there is some confusion > regarding the line of distinction between them. I understand. It would perhaps be helpful to first study the relevant background information (including existing drivers) first, and then move on to writing your own driver. > sir, it would be of great help if we could get some example > programs for kernel mode drivers, All kernel mode drivers are available as part of the Linux source code. It should be possible to install a kernel source package in your RHEL system. You could have asked Red Hat "where can we get source code", or you could have tried a web search for "linux kernel source code." I think you would have found http://kernel.org/ which is the main web location (but there are literally thousands of other locations) where you can download the Linux source code. Note that the prominent links on the start page lead to patch files that are relative to the previous version only. Look for a link to the full source code, a file named linux-something as opposed to patch-something. Unpack and look in drivers/usb/misc/ where you can find some simple drivers as well as more complex ones. > libusb examples or libusb tutorials. and also information on how to > run those programs There is no libusb tutorial. A libusb tutorial for beginners would have to include a full education about USB, which is not at all the purpose of the libusb project. That would be a nice resource though, so I encourage you to start such a project! A large number of open source applications are available that use libusb. Again, web search is your friend. Here's a fun one: http://code.google.com/p/pymissile/ It uses pyusb, Python bindings to libusb. > when i try to compile programs there is always an error with header > files not being found. i am using red hat enterprise linux > 2.6.18-8.el5. Kernel drivers need to be built in a certain way. There are many examples of out-of-tree kernel drivers available online and the device driver book should also be helpful. > we are happy to venture out and write usb drivers and ready to work > towards this goal. Great! I like USB a lot, but it does take some time to learn everything. > as rightly pointed out by most people what we lack is a target to > write drivers for. as a pendrive was most accesible, we thought of > it initially. > but now will have to change that plan. Yes. Again, you want to work with a very simple device. //Peter |