Detailed description of interruptions and exceptions (1) and detailed description of interruptions (
There are a total of 256 types of exceptions or interruptions on Intel x86, that is, commonly referred to as interrupt vectors, which have their respective interrupt type codes. The distribution is as follows:
0-31 |
Abnormal and unshielded interruptions |
32-47 |
The shielding interruption caused by the I/O device is described in the book as the 8259A microcontroller to handle other interruptions other than the 34 |
48-255 |
The identifier is Soft Interrupt. in linux, only the 128 (0x80) is used for system calling. In user mode, int 0x80 Assembly is executed, cpu is switched to kernel mode, and system_call () function is executed. |
There are two types of unexpected situations when the cpu runs commands.
Inside CPU
Cpu internal problems must be handled immediately, so they are called exceptions;
CPU external
If a problem occurs outside the cpu, you can avoid immediate processing. Therefore, you can distinguish between shielded and unshielded interruptions.
For ease of management, exceptions and unshielded interruptions are handled as exceptions. Such problems have special exception handling programs, which are the problems to be solved by linux.
0-17 is an intel-defined exception. Except for 3, 4, 5 (and the following 128), the number is stuck (left for system calls). All the others are faults, and the cpu cannot run, so it must be processed.
18-31 indicates future cpu reservation
32-47 response by 8259A, corresponding to the following IRQ0-IRQ15, 34 interrupt that is IRQ2 don't know what to do
There is also a 128 Soft Interrupt System Call