Interrupts are asynchronous and unpredictable. Asynchronous means that the interrupts occur, independent of the working of the processor, i.e. independent of the instruction currently executing. Synchronous events are those that occur side by side with another activity. Interrupts must be asynchronous as they are generated by the external world which is unaware of the happenings inside the processor.
True interrupts that occur in real time are asynchronous with the execution. Also it is unpredictable at which time an interrupt will come. The two concepts of being unpredictable and asynchronous are overlapping .Unpredictable means the time at which an interrupt will come cannot be predicted, while asynchronous means that the interrupt has nothing to do with the currently executing instruction and the current state of the processor. Hardware interrupts are the real interrupts generated by the external world as discussed above. Software interrupts on the contrary are not generated from outside the processor. They just provide
an extended far call mechanism. Far call allows us to jump anywhere in the whole megabyte of memory. To return from the target we place both the segment and offset on the stack. Software interrupts show a similar behavior. Hardware interrupts , the third category that we will refer to simply as interrupts, are program control interruption based on an external hardware event (external to the CPU). These interrupts generally have nothing at all to do with the instructions currently executing; instead, some event, such as pressing a key on the keyboard or a time out on a timer chip, informs the CPU that a device needs some attention. The CPU interrupts the currently executing program, services the device, and then returns control back to the program. hardware interrupts are generally asynchronous , meaning they can occur at any time and rarely do they occur at the same spot in a program. An interrupt is an asynchronous procedure call the CPU generates in response to an external hardware signal. However there is a single pin outside the processor called the INT pin that is used by external hardware to generate interrupts. There are many external devices that need the processor’s attention like the keyboard, hard disk, floppy disk, sound card. All of them need real time interrupts at some point in their operation. when the printer is busy printing we cannot send it more data. As soon as it gets free from the previous job it interrupts the processor to inform that it is free now. There are many other examples where the processor needs to be informed of an external event. If the processor actively monitors all devices instead of being automatically interrupted then it there won’t be any time to do meaningful work.
3 comments:
In case of sleep counter, when sleep counter will generate interrupt processor will not get any clock as the system is in sleep mode and the sleep counter is running on other low power consumption clock. How will processor serve the interrupt in this case as the processor is getting no clock?
Thanx
good answer
thank you!
Post a Comment