Differences Between Soft Interrupt and hard interrupt

Source: Internet
Author: User

① Hard interruptions are caused by external events, so they are random and unexpected. Soft interruptions are generated by executing interrupt commands, and interrupt request signals are applied to non-external entities.ProgramArranged.
② For the interrupt response cycle of a hard interrupt, the CPU needs to send the interrupt round signal (NMI does not need), the Soft Interrupt interrupt response cycle, and the CPU does not need to send the interrupt round signal.
③ The interrupt number of a hard interrupt is provided by the interrupt controller (the NMI hard interrupt number system is designated as 02 h). The interrupt number of a Soft Interrupt is provided directly by the command without the need to use the interrupt controller.
④ Hard interrupt is shielded (NMI hard interrupt is unblocked), and Soft Interrupt is unshielded.

Soft Interrupt is a mechanism for pushing back and executing. The processing of timer and NIC data is a typical soft interrupt, which is totally different from the interruption in the interrupt vector table, taking network data processing as an example, when the network adapter receives a packet, the disconnected processing program only copies the data to the buffer zone and then tells the network adapter that you can transmit the data to me, that is, the interrupt return, but before that, the NIC interrupt handler should set a flag to tell the operating system to do something, which is soft interrupt, however, soft interruptions are only one of the things to be done when a lot of interruptions are returned. Each time the operating system returns an interruption, a flag is checked to see if something has to be done. If yes, it will be processed, as mentioned above, the operating system calls the Soft Interrupt Processing Function at this time.
The Soft Interrupt program is used to analyze data packets. Who should the data be transferred to? No, it will be returned, except for the necessary parts.

Differences between writing two interrupt service functions
1. the time when a soft interrupt occurs is controlled by the program, while the time when a hard interrupt occurs is random.
2. Soft interruptions occur by program calls, while hard interruptions are caused by peripherals.
3. The hardware interrupt handler must ensure that it can quickly complete its tasks so that the program will not wait for a long time for execution.
I don't think there is a big difference between writing these two types of Interrupt handlers.

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.