I just want to know whether and, if so, how it is distinguished which drivers an OS needs to have built into it, and which doesn't, even a little bit about communication between CPU and perihepals.
Let me explain - an OS must have drivers (maybe they aren't called even drivers because they are so elementary) to do very basic stuff like display something (but I believe the BIOS routines are used for this) and accessing keyboard, HDD.
But how are these devices connected? Let's take HDD for example. It's integrated into an Intel system through the South Bridge. But how can an OS access it? Because with the CPU you can do only port IO operations, and memory-mapped IO. Through this I believe it contacts the North Bridge, which has its internal way to further contact the South Bridge and other peripherals.
And to make this even more difficult, a few years back there were even separate controllers for keyboard, interrupts, etc. So how did it work back then? Were all of these controllers connected to the portIO bus of the CPU and responded only on their address, or were they connected into the North Bridge which filtered out requests?
I have another example on this. Let's say I type something on the keyboard. Now the keyboard controller sends interrupts to the interrupt controller, which sends interrupts to the CPU. Then the CPU has to read which interrupt was triggered from the interrupt controller using PortIO. If it reads, for example, IRQ 5 and finds it is connected with the keyboard, then it must contact the keyboard controller for the key code. Am I right?
Please help me sort this a bit. Thanks.