Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

closed as not a real question by nhinkle, Mehper C. Palavuzlar, BinaryMisfit Nov 7 '10 at 9:58

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

It is very difficult to tell what exactly you are asking here, but you may find Wikipedia to be a valuable resource for this. Their articles on motherboards and computer hardware and related articles would be useful for you. – nhinkle Nov 6 '10 at 21:17

I think you are talking about DMA, Direct memory access. That is what all fast devices use now a days. Not sure what you are asking though. If you want to learn about the theoretical things of a computer you could start at wikipedia or google?

share|improve this answer

Consider this: When Intel developed CPUs for PCs after the original 8088, they didn't delete any existing features, but "bolted on" additional features. This why you have powerful multigigahertz 8-core 64-bit SSE4+ processors that still boot up in 16-bit 640KB 8088 mode just in case you still want to run DOS.

A lot of stuff is like that in PC hardware; graphics cards are a prime example. VGA is additional features bolted on to EGA, CGA and MDA, and modern GPUs still boot up and look like a VGA card, complete with text mode support, until the driver activates the advanced features.

In the old days, almost everything except the video card used standardized I/O ports. The video card's RAM was connected to A000:0000 up to AFFF:FFFF depending on how much RAM was in the card, and it had specific I/O ports it responded to as well. The floppy drive used DMA to transfer data from disk to RAM.

So, when your BIOS-based PC boots up, a lot of the hardware in it is recreating that old IBM 5150 PC, until certain other ports are touched (usually when the driver loads and initializes) which kick the devices out of compatibility and into "native" mode.

Ideally, there is just one IRQ assigned to a device. The keyboard is IRQ 1, so the CPU can assume any interrupt from IRQ 1 is the keyboard, and it can then read the appropriate I/O ports to get the keycode.

Google "IBM 5150 BIOS Disassembly" or "IBM 5150 BIOS Source Code." IBM included the source code to the original BIOS in one of their technical manuals. It's fascinating reading, will teach you a lot, and will answer a lot of your questions.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.