IRQ’s, DMA’s and Memory Addresses

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:


InterruptWhat
component gets it (usually)
IRQ0System Timer
IRQ1Keyboard
IRQ2Some video cards
IRQ3COM2, COM4
IRQ4COM1, COM3
IRQ5Sound Card
IRQ6Floppy drive controller
IRQ7LPT1 (printer port)
IRQ8CMOS Clock
IRQ9Redirected to IRQ2
IRQ10Free
IRQ11Free
IRQ12Free
IRQ13Math Coprocessor
IRQ14Hard Drive Controller
IRQ15Free

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.

Free eBook!

Like what you read?

If so, please join over 28,000 people who receive our exclusive weekly newsletter and computer tips, and get FREE COPIES of 5 eBooks we created, as our gift to you for subscribing. Just enter your name and email below:

Post A Comment Using Facebook

What’s Your Preference?

Daily Alerts

Each day we send out a quick email to thousands of PCMECH readers to notify them of new posts. This email is just a short, plain email with titles and links to our latest posts. You can unsubscribe from this service at any time.

You can subscribe to it by leaving your email address in the following field and confirming your subscription when you get an email asking you to do so.

Enter your email address for
Daily Updates:

Weekly Newsletter

Running for over 6 years, the PCMECH weekly newsletter helps you keep tabs on the world of tech. Each issue includes news bits, an article, an exclusive rant as well as a download of the week. This newsletter is subscribed to by over 28,000 readers (many who also subscribe to the other option) - come join the community!

To subscribe to this weekly newsletter simply add your email address to the following field and then follow the confirmation prompts. You will be able to unsubscribe at any time.

Enter your email address for
Free Weekly Newsletter: