Hi. I have a few question about USB on linux. Firstly, how do I know which file descriptor in the /dev/ section is USB? Secondly, how can I write raw code to it? Would I have to write a kernel level driver?
Printable View
Hi. I have a few question about USB on linux. Firstly, how do I know which file descriptor in the /dev/ section is USB? Secondly, how can I write raw code to it? Would I have to write a kernel level driver?
USB devices begin with "s", eg storage devices are sd. Stuff like this is listed here:
http://www.kernel.org/pub/linux/docs...vices-2.6+.txt
Pretty sure there is a copy in with the kernel source.
Yep.Quote:
Secondly, how can I write raw code to it? Would I have to write a kernel level driver?
examples of writing a USB driver?
Heh-heh.
Linux Device Drivers, Third Edition [LWN.net]
Major issue will be the nature of the device itself. You communicate via "endpoints" that functional aspects of the hardware, so you almost certainly need the specifications for it. You can get the standards for such here:
USB.org - Documents
but the actual specific ones you need to get from the manufacturer. The above link will help you to understand them, once you have read up enough about (usb) drivers. So this is a fairly serious undertaking.
Actually there is something known as "scsi pass through", that uses ioctl calls to send scsi control messages to usb devices available on Linux. It gives you kernel space control over a usb device from user space.