I have been reading about computer architecture and device drives and it is very fascinating on how a processor functions and how are operating systems created to abstract the low level details of the CPU. I was able to understand about the processor, memory and basic devices (like the Hard Disk and Display) using the Writing a simple operating system from scratch book (https://www.cs.bham.ac.uk/~exr/lectures/opsys/10_11/lectures/os-dev.pdf) shared recently on HN (https://news.ycombinator.com/item?id=30800715). Understanding this provides a good grasp of the fundamentals of the hardware and software.<p>But, even after this, I am not really sure on an Operating System can support such a massive number of devices, that just simply work on plug and play basis. If feels like magic. I understand that the operating system has in build drivers to a lot of these devices, but still don't understand how are such a massive number of devices covered using just by the inbuild drivers. Also, how does this related to PCI Express and other kinds of busses ? What there the generic interfaces which enable such massive number of devices to be able to work with the operating system ?<p>Does anyone have any good resources for explaining this from first principles, for eg. How would one go about designing a system that can work with so many devices out of the box at runtime ? It'll be really great is anyone has analogies for understanding the various parts involved in such a system.<p>Thank you!
I think you overestimate how “well” things work.<p>I’ve had cases where hardware worked great with Linux and was buggy or unusable with Windows and vice versa. I’ve even had some hardware problems on Macs. Hardware can have bugs, revisions, or interpret a standard in their own way that causes problems. Just look at hibernation, it is often buggy on Linux and sometimes even on Windows.<p>Rare hardware is likely to be problematic on any os.
New hardware is likely to not have a Linux driver yet.
Old hardware is unlikely to have a modern Windows driver at all.
Drivers can have bugs and crash. (I’ve had cases on Windows where I needed to instal the MS driver because the Vendor driver crashed or vice versa)<p>You notice a lot of this stuff if you build your own computer, try different OSes and distros, are into retro computing etc...
It is easy to forget misbehaving hardware/drivers because until you have a solution, you are not using that computer.
<a href="https://www.slideshare.net/kerneltlv/hardware-probing-in-the-linux-kernel" rel="nofollow">https://www.slideshare.net/kerneltlv/hardware-probing-in-the...</a> provides a good overview of how it is done in Linux.