Hacker News new | past | comments | ask | show | jobs | submit login

TL;DR: Android only needs winusb to work, before Windows 8 (2012) windows only used Vendor ID and Product ID to decide what driver to load, so you had to install a new .inf driver file for every new device. Newer versions ask the device for a Microsoft OS Descriptors (MOD) payload that tell windows what drivers to load, usually winusb and MTP. The devices need to support this, the author says the pixels started supporting this since the Pixel 2 (2017).



> windows only used Vendor ID and Product ID to decide what driver to load

Even if you plug in standard device classes like HID?


No, Windows has a list of specific "generic device classes" where it will automatically load a generic driver. Mass storage and HID are the primary users of this.

But if it doesn't fall into one of those buckets Windows just doesn't enable the device whatsoever.

As noted in the article macOS and Linux do the opposite. They allow userspace programs to enumerate unknown USB devices and manually communicate with them.


How would userspace programs communicate with usb devices without a driver. Does adb itself on Linux internally contain a driver?


On macOS you open the IOKit device and post/receive messages or use transfer buffers. Only one program can do that at once since the OS doesn't know anything about the protocol, but it works without a driver.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: