



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
it is summry of all the topics wchih are covered in interrupts
Typology: Study notes
1 / 5
This page cannot be seen from the preview
Don't miss anything!
OPERATING SYSTEM PAPER CODE- 203 UNIT- 1 INTERRUPTS Define An interrupt is an event external to the currently executing process that causes a change in the normal flow of instruction execution. Interrupts are an important part of a computer architecture. Each computer design has its own interrupt mechanism, but several functions are common. It is usually generated by hardware devices external to the CPU. The interrupt must transfer control to the appropriate interrupt service routine. Types of Interrupts Interrupts are classified into three different types: -
are 2 types of exceptions these are Faults and Aborts. A very common example of a fault is a page fault. So, faults are essentially exceptions from which the processor could recover. For instance, when there is a page fault that occurs when a process is executing, it would result in the OS or in the operating system executing and loading the required page from the swap space into the RAM. On the other hand, an exception which is of the form abort would be very difficult to recover, such as a divide by 0 exception. So, when a divide by 0 exception occurs in a program, typically the program would be terminated. Essentially the operating system has no way to recover from such a divide by0 exception Exceptions are further classified into Faults and Aborts. (shown above) Working of Interrupts For instance, systems could have timers, USB drives, keyboards, mouse, network cards and so on. So, it is not possible that several devices share the single interrupt pin. In order to achieve this, a special hardware is used in systems known as the Interrupt Controller. The job of the Interrupt Controller is to ensure that the single pin of the interrupt is shared between multiple devices. So, the interrupt controller would receive interrupts from each of these devices and then channelize that interrupt to the interrupt pin of the processor.
as well as the I/O APICs communicate through interrupt messages and IPIs that is Inter Processor Interrupts. Each of the devices that are connected to the interrupt controller is also has a dedicated number known as the IRQ number. So, when a device, request an interrupt and the INT pin in the processor gets asserted, the processor would then obtain the IRQ number from the interrupt controller. In this way the processor now determines which of these devices has requested for the interrupt. In the memory of the system, a table known as the interrupt descriptor table or IDT is stored. So this IDT table is pointed to by a register stored in the processor known as the IDTR. This is interrupt descriptor table register. So, each entry in this descriptor table contains information of where in memory the corresponding interrupt handler routine is present. So, the processor would use the IRQ number to look into the interrupt descriptor table, from this descriptor the corresponding location of the interrupt handler routine is obtained and there after the processor can then execute instructions from this handler routine. DMA stands for " Direct Memory Access " and is a method of transferring data from the computer's RAM to another part of the computer without processing it using the CPU. While most data that is input or output from your computer is processed by the CPU, some data does not require processing, or can be processed by another device.
In these situations, DMA can save processing time and is a more efficient way to move data from the computer's memory to other devices. In order for devices to use direct memory access, they must be assigned to a DMA channel. Each type of port on a computer has a set of DMA channels that can be assigned to each connected device. For example, a PCI controller and a hard drive controller each have their own set of DMA channels. For example, a sound card may need to access data stored in the computer's RAM, but since it can process the data itself, it may use DMA to bypass the CPU. Video cards that support DMA can also access the system memory and process graphics without needing the CPU. Ultra DMA hard drives use DMA to transfer data faster than previous hard drives that required the data to first be run through the CPU. DMA Controller The controller is integrated into the processor board and manages all DMA data transfers. Transferring data between system memory and I/O device requires two steps. Data goes from the sending device to the DMA controller and then to the receiving device. The microprocessor gives the DMA controller the location, destination, and amount of data that is to be transferred. Then the DMA controller transfers the data, allowing the microprocessor to continue with other processing tasks. When a device needs to use the Micro Channel bus to send or receive data, it competes with all the other devices that are trying to gain control of the bus. This process is known as arbitration. The DMA controller does not arbitrate for control of the BUS instead; the I/O device that is sending or receiving data (the DMA slave) participates in arbitration. It is the DMA controller, however, that takes control of the bus when the central arbitration control point grants the DMA slave's request.