On the NT platform, common applications run in ring3 and the operating system runs in ring0. If you need to execute some privileged commands in the program, the program must be transferred to ring0. Because privileged commands executed by user programs may damage system resources, the operating system provides necessary services to user State programs through the "Gate" mechanism for the purpose of protection and stability. There are four types of X86 doors: interrupt door, trap door, call door, and task door, which are supported by the CPU from the hardware layer.
These four processes let the CPU find where to execute the exception or interrupt processing code. They are the interrupt and Exception Processing mechanisms.
There are some differences in handling abnormal interruptions, such as traps that can be nested, and interruptions cannot be nested by default, you need to know the categories of Interrupt exceptions and select the appropriate door for handling.
From csapp
Interrupt door, trap door, call door, and task door