What is an Interrupt?? | Interrupt Handling in OS

Описание к видео What is an Interrupt?? | Interrupt Handling in OS

An interrupt is a signal from a device attached to a computer or from a program within the computer that requires the operating system to stop and figure out what to do next.
An interrupt temporarily stops a current process. Most I/O devices have a bus control line called Interrupt Service Routine (ISR) for this purpose.
An interrupt signal might be planned (i.e., specifically requested by a program) or it may be unplanned (i.e., caused by an event that may not be related to a program that's currently running on the system).
To accommodate interrupts, an interrupt cycle is added to the ‘instruction cycle’.
In the interrupt cycle, the processor checks to see if any interrupts have occurred, indicated by the presence of an interrupt signal.
If no interrupts are pending, the processor proceeds to the fetch cycle and fetches the next instruction of the current program. 
These are the steps in which ISR handles interrupts. If an interrupt is pending, the processor does the following:

It suspends execution of the current program being executed and saves its context to the stack. It also saves the current contents of the PC (program counter)
It sets the program counter to the starting address of the interrupt handler routine.
The processor now proceeds to the fetch cycle and fetches the first instruction in the ‘interrupt handler program’, which will service the interrupt.
When the interrupt handler routine is completed, the processor can resume execution of the user program at the point of interruption.

Комментарии

Информация по комментариям в разработке