Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what happens when you plug in a new USB device?

I have an embedded device with a USB connection. When the user plugs the device into their PC (Windows, OSX), how does the operating system discover what drivers to install? How do I get my drivers to be selected? Can they reside on some central server (run by the OS vendor)?

like image 869
Will Avatar asked Jun 10 '10 09:06

Will


People also ask

Why is nothing happening when I plug in my USB?

Check that the USB port is not defective. If you have multiple devices connected, it can happen that your USB port does not deliver enough power to the flash drive, in that case, try using a USB HUB having external power supply.

How do you safely plug in a USB?

If you see a USB stick lying out in open, public places, do NOT plug it into your computer to see what's on it. Use secure USB drives. Some newer models have safety features such as fingerprint authentication that help protect the device from hackers.


1 Answers

This is for Windows :

When a USB device is plugged into the system, the USB bus driver is notified. The bus driver sends a standard USB request (USB_DEVICE_DESCRIPTOR) to the device. With this the device reports its name and type. (bDeviceClass/bDeviceSubClass/bDeviceProtocol).

With this information, Windows creates an device entry in the system. This the Hardware-ID. The system now tries to find either a generic driver which can handle the device (HID/UVC) or a driver which specifically registered itself to support this Hardware-ID.

To register a driver as the handler for a specific device, you have to install the driver into the system, or you must supply Microsoft with one, which they can provide on their servers.

like image 116
Christopher Avatar answered Oct 01 '22 20:10

Christopher