What actually happens when you plug in a USB device? (2007)(technovelty.org)
technovelty.org
What actually happens when you plug in a USB device? (2007)
https://www.technovelty.org/linux/what-actually-happens-when-you-plug-in-a-usb-device.html
21 comments
That is a great link. Also USB Made Simple is good addition to that.
It's pretty amazing that the protocol works in the first place. It's a multi-driver, differential bus with 3 valid states (not including bus arbitration). It does all sorts of dirty things, like in order to identify a device as a USB1.0 or USB1.1 device, a resistor is either applied to D- or D+. In order to determine if the host/device should switch to USB2.0 mode, the host computer will drive both lines to low (SE0) and the device will send high current "chirps" back to the host. Essentially having multiple hosts driving the line at the same time.
http://www.usbmadesimple.co.uk/
It's pretty amazing that the protocol works in the first place. It's a multi-driver, differential bus with 3 valid states (not including bus arbitration). It does all sorts of dirty things, like in order to identify a device as a USB1.0 or USB1.1 device, a resistor is either applied to D- or D+. In order to determine if the host/device should switch to USB2.0 mode, the host computer will drive both lines to low (SE0) and the device will send high current "chirps" back to the host. Essentially having multiple hosts driving the line at the same time.
http://www.usbmadesimple.co.uk/
... and then, on Windows, you get to the Plug-and-Play stack, and horrible, eldritch things happen, many of which involve registry entries.
Also, when I found that "SetupApi" was The Way you got to USB devices on Windows, I wanted to strangle somebody.
Also, when I found that "SetupApi" was The Way you got to USB devices on Windows, I wanted to strangle somebody.
The first thing that happens when you plug in a USB device is you sigh in relief that the thing finally went in, on the third attempt.
Then all this other stuff happens.
Then all this other stuff happens.
No you have to observe the plug first, then it'll go in:
http://imgur.com/ZG4L1nc
http://imgur.com/ZG4L1nc
So true :-)
Oddly (for how detailed it is in other places) this skips the actual wire protocol side of enumeration -- reset device, read descriptors, assign address, etc.
Enumeration is an interesting process -- newly reset devices accept transfers to address zero, until the host assigns a non-zero addres. Then the next device (if their are additional devices detected on a hub, or if the just-enumerated device is a hub with devices below it) can be enumerated (initially responding at 0 after reset), walking the entire tree of hubs and devices (and revisiting it as necessary when hubs report connections and disconnections).
Enumeration is an interesting process -- newly reset devices accept transfers to address zero, until the host assigns a non-zero addres. Then the next device (if their are additional devices detected on a hub, or if the just-enumerated device is a hub with devices below it) can be enumerated (initially responding at 0 after reset), walking the entire tree of hubs and devices (and revisiting it as necessary when hubs report connections and disconnections).
(original author here)
Yeah, it was done after I was asked to run a short course on writing drivers, so the focus was on understanding that sort of layer.
But you want to know how old this is? I actually used the word "palmtop" :)
Yeah, it was done after I was asked to run a short course on writing drivers, so the focus was on understanding that sort of layer.
But you want to know how old this is? I actually used the word "palmtop" :)
Related is this talk on reverse engineering USB devices from 28c3: http://media.ccc.de/browse/congress/2011/28c3-4847-en-revers...
Ok, I', not that young but WTF is a "palmtop" and when did such a thing exist?
How about an IBM PC-110?
http://www.basterfield.com/pc110/pc110idx.htm
http://www.basterfield.com/pc110/pc110idx.htm
Palmtop is typically used interchangeably with PDA.
like "lap top" but it goes on top of the palm of your hand (at least that's my revisionist version)
[deleted]
When I wrote this, I'm not sure if the iPhone had been released; certainly at that point if you were carrying around something computer-like in your (large :) pocket (more powerful than a PalmPilot) it was something like a Jornada http://en.wikipedia.org/wiki/Jornada_(PDA)
This sort of form-factor came directly out of things calld "palmtop pc's" like http://en.wikipedia.org/wiki/HP_95LX
This sort of form-factor came directly out of things calld "palmtop pc's" like http://en.wikipedia.org/wiki/HP_95LX
To me "palmtop" strongly connotes something handheld, with a clamshell or a slide-out keyboard, and running a desktop-style OS. That HP 95LX is a good example; the OQO was a more recent one (2005 ish?).
A device with a similar form factor but running a mobile OS would have been called a "MID" (mobile internet device) or possibly a tablet - https://en.wikipedia.org/wiki/Nokia_770_Internet_Tablet for example.
A device with a similar form factor but running a mobile OS would have been called a "MID" (mobile internet device) or possibly a tablet - https://en.wikipedia.org/wiki/Nokia_770_Internet_Tablet for example.
http://www.beyondlogic.org/usbnutshell/usb1.shtml