Interrupts and exceptions are both transparent, forced transfers of execution from a currently running program to a handler. They (misleadingly) are mutually registered in the IDT. Interrupts -- occur randomly through hardware signals and deliberate INTs in code. Exceptions -- occur as a result of error conditions in executing an instruction. Interrupts can be divided into two groups: 1) Hardware interrupts -- only randomly occurring switches in entire kernel; thus, maskability matters. IF in EFLAGS masks these interrupts. 2) Software interrupts -- system calls from user land. Exceptions can be divided into three groups: 3) Processor-detected program errors: 3a) Faults -- detected before %eip++, can be corrected. 3b) Traps -- detected after %eip++ (only difference from faults), can be corrected. 3c) Aborts -- can't be corrected. 4) Software-generated exceptions -- INTO, INT 3, BOUND. 5) Machine-check exceptions -- hardware errors. We can handle interrupts and exceptions in two ways: i) Task-gate descriptor -- hardware switches using TSS descriptors. ii) Interrupt-gate descriptor -- clears IF flag, thus disabling maskable hardware interrupts. iii) Trap-gate descriptor -- same as interrupt-gate, except doesn't clear IF. These descriptors are customizable: * Segment selector (of code segment) determines handler's permission level. * Descriptor priviledge level (DPL) required to execute the handler. 0 for ring0 only, 3 for ring0-3 access.