An interrupt is usually defined as an event that alters the sequence of instructions executed by a processor. Such events correspond to electrical signals generated by hardware circuits both inside and outside the CPU chip.
Interrupts are often divided into synchronous and asynchronous interrupts :
Synchronous interrupts(exceptions )are produced by the CPU control unit while executing instructions and are called synchronous because the control unit issues them only after terminating the execution of an instruction.
Exceptions, on the other hand, are caused either by programming errors or by anomalous conditions that must be handled by the kernel.
Exceptions:
Processor-detected exceptions:Generated when the CPU detects an anomalous condition while executing an instruction. These are further divided into three groups, depending on the value of the eip register that is saved on the Kernel Mode stack when the CPU control unit raises the exception.
Faults:The saved value of eip is the address of the instruction that caused the fault。
Traps:The saved value of eip is the address of the instruction that should be executed after the one that caused the trap.
Aborts:may be unable to store in the eip register the precise location of the instruction causing the exception.
Programmed exceptions:Occur at the request of the programmer. They are triggered by int or int3 instructions; the into (check for overflow) and bound (check on address bound) instructions also give rise to a programmed exception when the condition they are checking is not true. Programmed exceptions are handled by the control unit as traps; they are often called software interrupts . Such exceptions have two common uses: to implement system calls and to notify a debugger of a specific event