For his Computers Are Hard blog, Wojtek Borowicz recently interviewed Linux maintainer Greg Kroah-Hartman to learn about how computer peripherals work. The conversation evolved into a short history of USB, a tour of the inner workings of a computer mouse, and an in-depth look at how the Linux operating system drives modern hardware.
“There is a tiny processor in your USB mouse,” Kroah-Hartman explained. “The code it’s running is very small and compact. It’s responsible for two things: reading the state of the mouse movements and button clicks, and responding to the computer when it’s asked if it has done anything different since the last time it was asked.”
Kroah-Hartman said that, when the USB protocol was created, a primary goal was to be able to make a mouse for less than $1. “Because of this, a processor that controls a mouse can be made very cheaply and all of the harder computations involved in dealing with mice are done by the operating system: Linux in our case,” he said.
Part of the USB specification process involved creating standard definitions for different types of devices, such as mice, keyboards, disk devices, cameras, etc. “Once the code was written for the operating system to talk to one USB mouse, all USB mice that followed the specification would instantly work. That was a huge step forward in standardization of devices and has done more to make systems easier to use than almost anything else in the past few decades,” Kroah-Hartman said.
Read the complete article at Computers Are Hard.