IRQ DMA and IO Ports Introduction IRQ Interrupt

  • Slides: 19
Download presentation
IRQ, DMA and I/O Ports - Introduction -

IRQ, DMA and I/O Ports - Introduction -

IRQ – Interrupt Request • Stands for "Interrupt Request. " PCs use interrupt requests

IRQ – Interrupt Request • Stands for "Interrupt Request. " PCs use interrupt requests to manage various hardware operations. • IRQs are hardware lines over which devices can send interrupt signals to the microprocessor

 • Devices such as sound cards, modems, and keyboards can all send interrupt

• Devices such as sound cards, modems, and keyboards can all send interrupt requests to the processor • For example, when you press a key on your keyboard it sends a signal to the processor via an IRQ channel (usually IRQ 1) to let it know that it needs to process some data.

 • IRQ conflicts can occur when new hardware is installed using the same

• IRQ conflicts can occur when new hardware is installed using the same channel of another hardware. For example, it can cause problems if you have your mouse on COM 1 (IRQ 4) and a modem on COM 3 (IRQ 4) both using the same IRQ channel. • You may find you cannot manually change your IRQ settings (the Use automatic settings will be greyed out), this is usually related to the ACPI (Advanced Programmable Interrupt Controller) function in Windows according to the Intel APIC Architecture. • In later version of Windows , fully automated device detection and configuration is used (Pn. P-Plug and Play) but could still fall back to manual settings if necessary.

Default ISA (Industry Standard Architecture) IRQ Allocation: • IRQ 0 — system timer (cannot

Default ISA (Industry Standard Architecture) IRQ Allocation: • IRQ 0 — system timer (cannot be changed); • IRQ 1 — keyboard controller (cannot be changed); • IRQ 2 — cascaded signals from IRQs 8– 15; — any devices configured to use IRQ 2 will actually be using IRQ 9 • IRQ 3 — serial port controller for COM 2 (shared with COM 4, if present); • IRQ 4 — serial port controller for COM 1 (shared with COM 3, if present); • IRQ 5 — LPT port 2 or sound card; • IRQ 6 — floppy disk controller; • IRQ 7 — LPT port 1 or It is used for printers or for any parallel port if a printer is not present. • IRQ 8 — RTC Timer • IRQ 9 — The Interrupt is left open for the use of peripherals. open interrupt / available or SCSI host adapter; — any devices configured to use IRQ 2 will actually be using IRQ 9 • IRQ 10 — The Interrupt is left open for the use of peripherals. open interrupt / available or SCSI or NIC; • IRQ 11 — The Interrupt is left open for the use of peripherals. open interrupt / available or SCSI or NIC; • IRQ 12 — mouse on PS/2 connector; • IRQ 13 — math co-processor or integrated floating point unit or inter-processor interrupt (use depends on OS); • IRQ 14 — primary ATA channel; • IRQ 15 — secondary ATA channel;

 • When a signal arrives on an IRQ channel, that is a message

• When a signal arrives on an IRQ channel, that is a message to the CPU. The IRQ Controller is told that a unit wants to get on the bus. Which unit is to be identified through the IRQ number. • Next the unit is admitted to the bus, to send or receive data. When the transaction is completed, another signal is transmitted to the CPU to indicate that the bus is empty. • The IRQs have different priorities, so the CPU knows which IRQ have priority, if two signals are sent simultaneously. • The IRQ system is guided by a controller chip, like Intel 8259. It can handle 8 IRQ signals and two of them together through IRQ 2 or 9. All PCs with ISA bus include two 8259 chips.

To view your current IRQ assignments you can open Device Manager. Click on START,

To view your current IRQ assignments you can open Device Manager. Click on START, click on CONTROL PANEL. • Click on Performance and Maintenance. • Click on System. • Click on the Hardware tab. • Click the DEVICE MANAGER button. • Once you have Device Manager open, select VIEW from the toolbar menu, and then click Resources by Type. If you are experiencing problems with a newly installed/configured piece of hardware and the drivers are installed correctly, then check to see if it has its own IRQ channel.

DMA - Direct memory access • Direct memory access (DMA) channels are system pathways

DMA - Direct memory access • Direct memory access (DMA) channels are system pathways used by many devices to transfer information directly to and from memory. • DMA is a system which allows an adapter to transfer data to RAM without CPU involvement.

Example of how DMA works

Example of how DMA works

Diagram of DMA 8257 interface with Intel 8085 chip

Diagram of DMA 8257 interface with Intel 8085 chip

 • DMA data transfer signals are assigned to a DMA controller on the

• DMA data transfer signals are assigned to a DMA controller on the motherboard. A controller chip (Intel 8237) has clearance to move data to and from RAM through the I/O bus, without giving more work to the CPU. • Many hardware systems use DMA, including disk drive controllers, graphics cards, network cards and sound cards. • Computers that have DMA channels can transfer data to and from devices with much less CPU usage than computers without a DMA channel. This allows computation and data transfer to proceed in parallel for faster data processing.

 • Without DMA, when the CPU is using programmed input/output, it is fully

• Without DMA, when the CPU is using programmed input/output, it is fully occupied with read or write operation and is therefore unavailable to perform other work. • With DMA, the CPU initiates the transfer, does other operations while the transfer is in progress, and receives an interrupt from the DMA controller when the operation is done. • This feature is useful any time the CPU cannot keep up with the rate of data transfer, or where the CPU needs to perform useful work while waiting for a relatively slow I/O data transfer.

Input/Output Ports • Input/Output ports are memory addresses used by the processor for direct

Input/Output Ports • Input/Output ports are memory addresses used by the processor for direct communication with a device that has sent an interrupt signal to the processor. • Not be confused with Input/Output Port Interface which is commonly termed as “I/O Ports” such as the socket connectors behind a computer. • The I/O port assignment can be made either manually or automatically using Pn. P. When configuring the I/O port of any device in your computer it is important that it does not share the same I/O port as another device or you will encounter a hardware conflict.

 • The exchange of commands or data between the processor and the device

• The exchange of commands or data between the processor and the device takes place through the I/O port address of the device, which is a hexadecimal number. • If a program needs to send a byte to the serial port, it issues an OUT instruction to the CPU with the address of that serial port. The CPU notifies the address bus to activate the I/O port and the address bus signals the appropriate byte location on the motherboard. The CPU then sends the data character over the data bus to that memory location. • No two devices can share the same I/O port. Many devices use multiple I/O port addresses, which are expressed as a range of hexadecimal numbers.

Common Example Serial Port Hardware Configuration Settings COM Port # IRQ I/O Port Address

Common Example Serial Port Hardware Configuration Settings COM Port # IRQ I/O Port Address 1 4 3 F 8 -3 FFh 2 3 2 F 8 -2 FFh 3 4 3 E 8 -3 EFh 4 3 2 E 8 -2 EFh Common Example Parallel Port Hardware Configuration Settings LPT Port # IRQ I/O Port Address Range LPT 1 7 378 -37 Fh or 3 BC-38 Fh LPT 2 5 278 -27 Fh or 378 -37 Fh LPT 3 5 278 -27 Fh

An I/O channel is a 3 digit hexadecimal number used to identify and signal

An I/O channel is a 3 digit hexadecimal number used to identify and signal a peripheral device. They handle the transfer of data between internal memory and peripheral equipment. 130 h - Used for SCSI host adapters 140 h - Used for SCSI host adapters 170 h - Secondary IDE Interface 1 F 0 h - Primary IDE Interface 220 h - Typically used for Sound Blaster-type sound cards 240 h - An alternate address for sound cards 278 h - Assigned to LPT 2 or LPT 3 and generally used with IRQ 5 280 h - Network Interface cards or the Aria Synthesizer 2 A 0 h - An alternate address for NIC cards or the Aria Synthesizer 2 E 8 h - Assigned to COM 4 and used with IRQ 3 2 F 8 h - Assigned to COM 2 and used with IRQ 3 300 h - Another Network Interface Card choice 320 h – Another for Network cards, unless there is a SCSI host adapter or MIDI device 330 h - A common place for the SCSI host adapters 340 h - Another good alternative for the SCSI host adapter 360 h - Another Network card choice 378 h - The first parallel printer port (LPT 1) in color systems, commonly used with IRQ 7. 3 BCh - The first parallel printer port (LPT 1) in monochrome systems 3 E 8 h - Assigned to COM 3 and used with IRQ 4 3 F 8 h - Assigned to COM 1 and used with IRQ 4

 • To view how your computer has assigned your I/O addresses, open Device

• To view how your computer has assigned your I/O addresses, open Device Manager, click View at the top of the Device Manager window, click Resources by type, and then select Input/Output (IO). This should give you an output similar to the picture shown below.

For a complete list of I/O Port address go to : http: //en. wikipedia.

For a complete list of I/O Port address go to : http: //en. wikipedia. org/wiki/Input/output_base_address

References • http: //www. karbosguide. com/hardware/module 5 a 3. h tm • http: //www.

References • http: //www. karbosguide. com/hardware/module 5 a 3. h tm • http: //www. cs. mcgill. ca/~cs 573/fall 2003/suppnotes/le c 273/lecture 8/index. htm • http: //en. wikipedia. org/wiki/Input/output_base_addr ess • http: //www. onlinecomputertips. com/pchardware/irq. html