IRQ’s, DMA’s and Memory Addresses

Posted Mar 23, 2001 by David Risley  

There are three things that the
CPU uses as communication lines to cards, etc. They are IRQs, DMAs, and base memory
addresses.

An IRQ is basically a "stop
and do this" message given to the CPU–an interrupt request. For
example, each time you hit a key on your keyboard, the keyboard controller sends an IRQ to
the CPU demanding that it stops and throws down the letter on the screen. Your computer
stops what it is doing and follows your demands. While it does this, it is also handling
IRQs from your mouse and various cards. It can handle thousands of IRQs per second.

Each component of the computer
must have its own line of communication to the CPU. This is an IRQ line. But the CPU only
has one IRQ line to get its demands, so the nerds invented a programmable interrupt
controller (PIC) to split up this one line amongst the various parts. Each one can handle
8 lines, so we link two together to give the typical amount of IRQs in today’s PCs, 14
(two are reserved). Each part must have its own IRQ line, so if you set two
pieces of hardware to the
same IRQ line, your computer will have an IRQ conflict and more than
likely one of the pieces of hardware involved in the conflict will not
work. The way to fix it is to assign each piece of hardware it’s own
IRQ channel to avoid conflicts. Some people make an art of jiggling
IRQs around in their systems. This one concept is the
basis of many headaches involved with installing new expansion cards.

When your CPU responds to an IRQ,
it usually sends data back to the part that asked for it. Often, the card will ask for the
same data again and again, so to save the CPU the time of re-thinking the information and
sending it over, DMA, or direct memory access, was invented. DMA is usually composed of a
message sent to the card saying where to look in the memory for the data. This makes
things faster. But once again, these can conflict. Since DMA reserves a little section of
memory for the cards, each card’s part can’t overlap onto another card’s territory.
Fortunately, not many cards can even use DMAs, so there are rarely such conflicts.

Base memory addresses are
sometimes called I/O ports or port addresses. What are they? Well, CPUs respond to IRQs.
CPUs can’t respond down the same line that it is getting IRQs from. So, a different
route is set up for the responses. Its a kind of go-between so that the CPU and the
components can talk directly. Well, as usual, there are a certain amount of ports
available. They usually look something like 02E8, or 03E8. For the typical layout of IRQs
and DMAs in a computer, see here:


Interrupt What
component gets it (usually)
IRQ0 System Timer
IRQ1 Keyboard
IRQ2 Some video cards
IRQ3 COM2, COM4
IRQ4 COM1, COM3
IRQ5 Sound Card
IRQ6 Floppy drive controller
IRQ7 LPT1 (printer port)
IRQ8 CMOS Clock
IRQ9 Redirected to IRQ2
IRQ10 Free
IRQ11 Free
IRQ12 Free
IRQ13 Math Coprocessor
IRQ14 Hard Drive Controller
IRQ15 Free

There are many software
applications which allow you to see which parts are using what IRQs and port addresses.
You can get this info from the Windows Control Panel System
Properties, or for DOS, use MSD. There are many Windows programs out there
that do the same thing.

Which Of These Traits Applies To YOUR Computing Life?...

Leave a Reply