What are the possible conditions for interrupting a request?

The possible condition of the interrupt request is the end of instruction execution.

The main tasks of interrupt processing layer are: switching process context, testing interrupt signal source, reading device status and modifying process status. Because interrupt handling is closely related to hardware, users and user programs should be shielded as much as possible, so interrupt handling should be carried out at the bottom of the operating system, and the rest of the system should be connected to it as little as possible.

When a process requests an I/O operation, the process will be suspended until the I/O device completes the I/O operation, the device controller will send an interrupt request to the CPU, and the CPU will respond and turn to the interrupt handler, which will perform corresponding processing and release the blocking state of the corresponding process after processing.

Interrupt request value

The value of interrupt request (IRQ) is that there is a special device in the computer, and when the device sends a signal about its operation, it can be interrupted at a specified location. For example, when the printer finishes the printing task, it sends an interrupt signal to the computer, and the computer immediately interrupts to judge the next process.

If multiple signals are also sent to the computer to request an interrupt, the computer may not understand it, so each device must set a unique value and its path to the computer. Before the appearance of Plug and Play (PnP) devices, when adding new devices to computers, users usually need to manually set the IRQ value (or implement it). ?

Refer to the above contents: Baidu Encyclopedia-execution interrupt, Baidu Encyclopedia-interrupt request.