Hello everyone. I feel that I'm about to answer my own question, but I just want to be sure that I'm right. I know computers all use, at a very low level, the IRQ system of interrupting the CPU when it needs something. My questions are as follows:
Does the device in question, say.. a mouse, need to use the interrupt wire every single time, I use it? Say if the CPU is potentially idle, and I tap a few keys, even though the CPU wasn't busy, will it still use the interrupt feature? Or intteruppting the CPU only done when it has other things it's busy with?
How can there only be 16 IRQ devices? Also considering that 3 of them are already taken, (timer, keyboard, and clock) and that 2 & 9 are the same. Doesn't this mean that if I plug in 16 devices into a 20port usb hub that I'd be out of device room? Or does the usb bus count as 1 device? Same goes for SATA ports? I have 4 SATA ports on my motherboard. if I plug in 4 SATA hard drives, does that mean i'm filling up 4 seperate IRQ slots?
The CPU is able to temporarily ignore interrupts if it's busy doing something really important, like a device driver or an even higher-priority interrupt. Otherwise, yes, it does get interrupted very often. In the old days, if you left a stapler on your keyboard, it could waste a lot of CPU time!
Of course, the CPU gets interrupted frequently even if you don't. The clock interrupt cannot be ignored. (Some OSes like modern Linux are 'clockless', doing away with the 18-times-a-second interrupt and adjusting the timer on the fly. This gives a little efficiency boost.)
This is fine, not much performance loss, because interrupts are a hardware feature. The CPU does all the legwork.
If you remember computers having ISA slots, they couldn't share IRQ's, which made installing anything a maddening struggle of jumpers. ISA plug-and-play was even more of a joke; slow, unreliable, and most hardware couldn't do anything but tell you which hardwired IRQ it was demanding anyway.
PCI changed everything -- IRQ's can be shared! It has a built-in mechanism to tell the computer not just which interrupt, but which card on which interrupt. Resource conflicts mostly don't happen any more, and good riddance. Only the lowest-number IRQ's you mention are unshared now. I'll show you cat /proc/interrupts from my machine:
It doesn't show individual USB ports, it shows individual USB controllers, each of which handles a couple of ports. The number is inflated because of the three differing kinds of USB, which apparently call different interrupts? Not sure.