5 ms·
USB in a Nutshell (2010)
- vardump 3y agoNot perfect, but a pretty good resource. I referenced this a lot while developing a USB device driver and a USB stack on the device side.
- elwesties 3y agoI was 100% sure I was about to see a USB drive made out of a nut shell when I clicked on that link. Both disappointed and not :P
- dylan604 3y agoI thought it was a reference to the old skool O'Reilly books.
- zabzonk 3y agoooh, does anyone remember what it was like plugging in a device _before_ USB? even re-plugging a mouse (for example) would crash the whole system.
- Muromec 3y agoI’m pretty sure replugging ps/2 didn’t ever crash the system for me. Anything com-port related or vga didn’t either. Now hotplugging pci wasn’t the best idea, but it’s on the inside of the machine, so you naturally power it off.
- zabzonk 3y agoreplugging a mouse via ps2 either crashed the thing or just simply didn't work. same with keyboard
- Dylan16807 3y agoEvery computer where I've replugged a ps/2 mouse, it worked just fine. If I booted without one, then plugged one in, it wouldn't work, but that is a separate issue.
- lightedman 3y ago"Every computer where I've replugged a ps/2 mouse, it worked just fine." PS/2 is not a hot-swappable port, by design. Your hot-swap adventures mean you started out using more modern motherboards (2010-ish) which simply have an internal USB-PS/2 adapter for presenting PS/2 ports.
- Dylan16807 3y agoNo, most of my experience was something like 2004 Dells. If it was running off USB, then plugging in a mouse after boot would have worked. But it didn't. Only re-plugging worked.
- ranger_danger 3y agoMost PS/2 issues were already mitigated by that point. I specifically remember having a problem on our Windows 2000 Server box that would require a reboot any time the keyboard was un/replugged.
- serf 3y agoI remember serial mice being iffy. ps/2 didn't give me problems. parallel and scsi would cause crashes, but it was kind of expected.
- zabzonk 3y agoin my experience, having done lots of programming with it, rs232 serial ports are always repluggable without problems, unlike ps2.
- kragen 3y agoin theory hotplugging a ps/2 keyboard or mouse could blow your motherboard but it always worked fine for me
- garaetjjte 3y agoAbout that... Many years ago family member asked me how to transfer photos from their Symbian phone onto PC. Over the years they have been conditioned to absolutely never plug or unplug anything from the computer while it is turned on. It took quite some time to convince them that USB is designed for hotplugging. But the moment we connect it, computer totally freezes. With egg on my face I think, oh, probably just Windows XP crashed. Power-cycling doesn't help at all though, no POST, no beeps, absolutely nothing. Out of ideas I open the computer case, only to see there's a huge bulge on the chipset... I have no idea what happened there. Perhaps unlucky short when inserting connector, causing latch-up in the chip? Phone was totally fine after this, I connected it to different PC without issues.
- kragen 3y agooh man, condolences! i bet it took them a long time to start hotplugging usb after that
- lm411 3y agoAhh, the good ole days. I remember having an IRQ conflict between my 2400 baud modem and my serial connected mouse. I had to keep moving my mouse to use the modem until I changed one of the IRQs.
- zabzonk 3y agooh god, i remember the irq problems - having your mouse play sounds when it moved because of conflicts with the sound card. young un's today don't know they are born - and get off my lawn!
- ClumsyPilot 3y agoI have a GPS receiver that plugs into a PC thought USB. It creates a virtual serial port and is recognised by Windows as a serial mouse. You plug it into a random computer and watch the cursor go crazy. Great for pranks at the office!
- dylan604 3y agoI remember forgetting to terminate the SCSI chain or even double terminating. Forgetting to move the jumpers on internal drives was a pain as well.
- foofie 3y agoGreat callout. To me the biggest revolution came from USB mass storage devices. You either juggled 1.44MB floppy disks around, had to use CD-ROMs, or you had to open up your desktop and plug in a HDD. With USB, all you had to do was stick a small plastic widget in a USB socket and you were ready to go. How cool is that? Flash memory hammered home we lived in the future. Some USB flash drives fitted right into a USB type A plug, and stored hundreds of megabytes.
- vbezhenar 3y agoUSB is surprisingly simple. Not very simple, but it’s possible for a determined developer to understand and implement driver within a reasonable amount of time. At least early versions. Before I dive into it, I thought it was complete magic.
- yboris 3y agoI would love at least some vague estimate that is more descriptive than "a reasonable amount of time" :) Perhaps as a range (95% confidence interval perhaps) - estimate of total hours on task?
- dylan604 3y ago> I would love at least some vague estimate that is more descriptive than "a reasonable amount of time" :) SHOW HN: USB driver I created over the weekend
- AussieWog93 3y agoI've written a device and driver side USB stack, not even bare metal and it took several weeks of attempts and hundreds of pages of reading (mostly USB complete by Jan Axelson, this site is also good but just not as in-depth) to get right and there are still parts of it I don't fully understand. Call it 15 hours to get a "ping" signal across, and another 15 to get data travelling at full speed with proper SOF handling. Nowhere near as simple as something like I2C that you can get a complete understanding of in an afternoon.
- CableNinja 3y agoIts even more complicated now. USB4 has a lot of timing related things that the system has to do before you can even start sending data. More complicated, much of it is done in hardware, which might be nice for quickly slapping USB capabilities, buttttt is a bear if you're trying to build something thats not a computer. Theres cases where the device wont even power on unless you do everything just right hardware side. Gone are the days of simple signals and connections. USB isnt so universal anymore
- userbinator 3y ago2010, when USB was still relatively simple (3.0 had just came out, and it and subsequent revisions is when things started to get really crazy) and many more websites were still highly readable documents like this one.
- Macha 3y agoRegarding the article date, I'm pretty sure this is older than 2010, with the description of USB 2.0 as new and poorly adopted (USB 2.0 was released in 2000, 3.0 in 2008)
- FounderBurr 3y agoReading and understanding documentation is a true waste of time. I just press the ‘I can has usb?’ Button and it lays works well enough for me to sell to people.
- magnat 3y agoI also recommend USB Made Simple [1], which has similar vibe to this site, but also includes USB 2.0 description and is a bit more detailed on electrical/low level aspects. For an actual implementation, see V-USB [2] - surprisingly readable software library for bit-banging USB on AVR (Arduino/ATTiny/ATMega) [1] https://www.usbmadesimple.co.uk/index.html https://www.usbmadesimple.co.uk/index.html [2] https://github.com/obdev/v-usb https://github.com/obdev/v-usb
- foofie 3y ago> I also recommend USB Made Simple [1] What a treat. I hope that the page is eventually updated to feature major updates up until USB4. Thank you for posting this link.
- throwaway71271 3y agoI am trying to add usb floppy support for the esp32 host and this site is helping me a lot. The current esp32 mass storage driver supports only bulk only transfer scsi, but usb floppies (those with the uf001f chip) use CBI(control/bulk/interrupt) and also UFI has a bit different command set: https://www.usb.org/sites/default/files/usbmass-ufi10.pdf https://www.usb.org/sites/default/files/usbmass-ufi10.pdf By using this site, a cheap logic analyzer and usbpcap for windows, I am trying to go around reading all the usb docs :)
- ranger_danger 3y agoI just recently had to read this to understand enough to implement a USB device on a PIC32, but there's still some more clarifying info I'd like to see. For example, there's almost no information anywhere online on how the polling is supposed to work for noticing interrupt requests from the device. Is this typically handled at the OS level and the application writer does not mess with it? I still don't know. The reason I ask is because while trying to implement USB on my PIC32, I observed USB traffic via wireshark of another third party custom HID device that I was trying to mimic. This device, once you pressed a button on it, wireshark would show INTERRUPT IN requests coming from the device, without any programs open. However with my own USB device implementation, I couldn't get this to happen, no matter how hard I tried. I just happen to try opening the USB device from an application and trying to read from it, at which point my interrupt IN transfers magically showed up in wireshark and starting working. I still don't understand why that's necessary when my third-party device can do it all by itself.