Re:What actually happens when you plug in a USB device? (2007)
by porsupah on Wednesday June 18, 2014 @09:00PM
(#7913858)
On a related note: back in a previous, embedded incarnation, I was once tasked with writing a USB driver. Not the kind that might first come to mind - this was for the /device/, for which documentation is rather less easily found. With the aid of this resource (no, no spam), I was able to make our gadget come up as a fully compliant composite HID/microphone device.
Re:What actually happens when you plug in a USB device? (2007)
by tcas on Wednesday June 18, 2014 @10:01PM
(#7914029)
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.
Re:What actually happens when you plug in a USB device? (2007)
by swetland on Wednesday June 18, 2014 @06:46PM
(#7913391)
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).
Re:What actually happens when you plug in a USB device? (2007)
by delsarto on Wednesday June 18, 2014 @09:13PM
(#7913889)
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)
Re:What actually happens when you plug in a USB device? (2007)
by tesseract on Thursday June 19, 2014 @05:09AM
(#7915285)
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?).
Re:What actually happens when you plug in a USB device? (2007)
by duskwuff on Wednesday June 18, 2014 @07:33PM
(#7913557)
Basically none of it, beyond the information in the "USB overview" section and a few scattered sentences elsewhere. This article is talking about the Linux USB stack in particular, not USB in general.
http://www.beyondlogic.org/usbnutshell/usb1.shtml
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/
Also, when I found that "SetupApi" was The Way you got to USB devices on Windows, I wanted to strangle somebody.
You say this like it's a Windows-specific thing. In Linux, a lot of the USB support is exposed through /sys—pretty much the same idea.
Then all this other stuff happens.
http://imgur.com/ZG4L1nc
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).
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" :)
This sort of form-factor came directly out of things calld "palmtop pc's" like http://en.wikipedia.org/wiki/HP_95LX
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.basterfield.com/pc110/pc110idx.htm