Ever wondered how device drivers are reverse engineered?
linuxvoice.com
linuxvoice.com
I learned things like needing to detach the kernel driver the hard way. And because I didn't know anything about USB (and still don't), I was stumbling my way through libusb. There I still missing features that I need to revisit once I learn how to use USB properly.
I was a bit confused when it got to the part about > detach (unbind) the kernel driver Does this mean there is a default kernel driver on the interface and we must detach it first to make it available?
Every other class (including serial ports) will need at least Full-Speed USB (12 MBit) increasing the cost of the USB Rocket Launcher by 10¢ ;-).
Yes. Sometimes, and most prominently: A lot of cheap gizmos register themselves as "HID" (human interface devices) which is a class normally reserved for keyboards and mice. Windows, Linux, OSX, ... have default drivers, and the HID protocols implements a channel for arbitrary data to be passed to/from the device (/dev/hidraw* in Linux). In turn it allows people to talk to the "USB rocket launcher" providing a simple executable application, without needing to register a driver.
If you want to talk to the usb device using libusb (or the python bindings) you have to unbind this generic driver. You can either do it from within libusb, or for example, in the sys filesystem.
For a USB ethernet adapter (which I happen to have laying around):
$ cd /sys/bus/usb/drivers/ax88179_178a
$ ls
(...)
lrwxrwxrwx 1 root root 0 Mar 20 20:33 2-1.1:1.0 -> ../../../../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0
(...)
...so it's bound to device 2-1.1:1.0 ... $ sudo sh -c "echo 2-1.1:1.0 >unbind"
...ethernet interface is now gone, I can, theoretically, now talk to the device using libusb.Another example: Some programming cables for microcontroller development (similar to, e.g. the Arduino stuff) might have use a standard USB-to-Serial bridge chip. But as you have to talk to it in a non-standard way you'd have to unbind the default usb-to-serial kernel module and talk directly to the usb device.
Article is already in web.archive.org:
http://web.archive.org/web/20150320100539/http://www.linuxvo...
http://www.amazon.com/Dream-Cheeky-USB-Mini-Car/dp/B000XGQ9L...
http://mirror.linux.org.au/pub/linux.conf.au/2011/2011-01-28...