Worth noting that, this approach is limitted on newer macOS systems: can't build libusb "userspace USB drivers" for devices that are supported by macOS. Without manually disabling some Security features, can't override drivers for system-recognized USB devices.
USB for Software Developers: An introduction to writing userspace USB drivers
31–40 of 57 posts
Re: USB for Software Developers: An introduction to writing userspace USB drivers
#32Re: USB for Software Developers: An introduction to writing userspace USB drivers
#33If you are interested in doing this in golang I wrote a library to avoid needing cgo: https://github.com/kevmo314/go-usb I use this to access UVC devices correspondingly without cgo: https://github.com/kevmo314/go-uvc
Re: USB for Software Developers: An introduction to writing userspace USB drivers
#34Nice article, happen to have been working on a usbip system for my Macbook M3 using similar tech. Worth noting that, this approach is limitted on newer macOS systems: can't build libusb "userspace USB drivers" for devices that are supported by macOS. Without manually disabling some Security features, can't override drivers for system-recognized USB devices.
Re: USB for Software Developers: An introduction to writing userspace USB drivers
#35Does the adb tool use libusb or a kernel driver?
Re: USB for Software Developers: An introduction to writing userspace USB drivers
#36Ages ago when I was trying to create a simple USB device, I found that there is very much zero information how to do it - e.g. how to correctly write descriptors and so on. The typical advice was: find similar device to what you want to make, copy its descriptors and adapt to your own device using trial and error. Sounds like USB is a wonderful standard. Am I wrong?
The device descriptor is easy enough to get right as it doesn't have too many fields and every USB class just defines in the specification which Class and SubClass it uses for its interface descriptor as well as which endpoints that interface needs to have. And that's, for the most part, all you need for the host to recognize your device
Re: USB for Software Developers: An introduction to writing userspace USB drivers
#37Ages ago when I was trying to create a simple USB device, I found that there is very much zero information how to do it - e.g. how to correctly write descriptors and so on. The typical advice was: find similar device to what you want to make, copy its descriptors and adapt to your own device using trial and error. Sounds like USB is a wonderful standard. Am I wrong?
Re: USB for Software Developers: An introduction to writing userspace USB drivers
#38Dumb question.. do USB devices support DMA? Is it done through the host? Or does the USB device always push/pull data to host memory?
Re: USB for Software Developers: An introduction to writing userspace USB drivers
#39Does the adb tool use libusb or a kernel driver?
ADB uses libusb or WinUSB directly from userspace too yeah. On Windows you still need a .inf driver though because the WinUSB driver isn't getting loaded by default for Android devices because they're lacking the MS OS Descriptor
I don't think anyone uses the "native" usb way on either windows or mac os, when it's so much easier to go through libusb.
I've personally done a custom DFU updater for Mac OS some time ago by using libusb. It worked just fine(tm). I don't want to try and evaluate how long it would have taken to do it with the mac api.
Re: USB for Software Developers: An introduction to writing userspace USB drivers
#40Ages ago when I was trying to create a simple USB device, I found that there is very much zero information how to do it - e.g. how to correctly write descriptors and so on. The typical advice was: find similar device to what you want to make, copy its descriptors and adapt to your own device using trial and error. Sounds like USB is a wonderful standard. Am I wrong?