Interrupt support in Linux

Source: Internet
Author: User
Linux interrupt support-general Linux technology-Linux programming and kernel information. The following is a detailed description. The doors used in the Linux kernel are further refined on the basis of the i386 platform, as shown below:

1. Interrupt door: the DPL In the processor is set to 0 and cannot be accessed in user mode. In Linux, all (hard) interrupt handlers are activated through the interrupt gate in the core state.

2. System Gate: the trap gate where DPL is set to 3 in the processor, which can be accessed in user mode. The three exception handling functions (Interrupt numbers 4, 5, and 128) in Linux are called through the system gate, that is, the commands into, bound, and int $0x80 can be executed in the user State.

3. system interrupt Gate: the DPL In the processor is set to 3 and can be accessed in user mode. In Linux, the interrupt vector 3 (int3) is called through the system interrupt gate and can be executed in user mode.

4. Trap Door: the DPL In the processor is set to 0, and cannot be accessed in user mode. In Linux, most exception handling functions are activated through the trap gate.

5. Task Gate: the DPL In the processor is set to 0 and cannot be accessed in user mode. In Linux, only the "Double Fault" exception handler is called through the task gate.

During system boot, the kernel calls the trap_init function in the/arch/i386/kernel/traps. c file to initialize the interrupt. This function initializes the Interrupt Descriptor by calling set_trap_gate and other functions in the same file.

The essence of set_trap_gate is to call the _ set_gate function in the include/asm-i386/desc. h file to initialize the Interrupt Descriptor. The code of this function is as follows:
QUOTE:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.