4 ms·
Really cool and impressive work! I'm more on the software (high level) side than on the hardware, but I always wondered how USBs and other ports were truly work
by Kydlaw 2y ago
Really cool and impressive work! I'm more on the software (high level) side than on the hardware, but I always wondered how USBs and other ports were truly working. It is an area of knowledge that I'm shamefully lacking...
Does anyone have nice resources to share like this one that focuses on a specific port/connection and implement a driver/reader/parser? I'd very like to learn more of this.
- nielsole 2y agoBen eater has videos on USB, SPI and rs232. Bitluni has a couple of easily consumable videos about VGA.
- virtue3 2y agosecond on ben eater; the USB one showing inputs on a keyboard and such with an oscilloscope blew my mind. I was like -> oh, it really just is a huge bus and there's A LOT happening.
- MisterTea 2y agoPlan 9 and C but there is some good info in these videos: https://www.youtube.com/@adventuresin9797/search?query=usb https://www.youtube.com/@adventuresin9797/search?query=usb
- ajross 2y ago"Big" hardware like a USB3 controller or the NVMe controller in the linked article actually looks more like software than hardware anyway, to be truthful. The devices have their own processors and accept commands that look like a software protocol: you put a linked list of these structs/headers/commands into memory, which reference buffers at these addresses via pointer, then turn the device on by writing to this register over here. As the device finishes, it signals completion with a given struct by putting a message into this output buffer (or by setting its "active" field to false, maybe), etc... The only bits you need to worry about that looks like hardware are getting the correct physical addresses filled in, and on some platforms worring about memory ordering and/or cache management to be sure the device sees the same memory state you think it does.