Unix & Linux: What are software and hardware interrupts, and how are they processed?
Channel: Roel Van de Paar
Date: 2020-08-19

Unix & Linux: What are software and hardware interrupts, and how are they processed?


The Question: I am not sure if I understand the concept of hardware and software interrupts.
If I understand correctly, the purpose of a hardware interrupt is to get some
attention of the CPU, part of implementing CPU multitasking.
 1. Then what issues a hardware interrupt? Is it the hardware driver process?
 2. If yes, where is the hardware driver process running? If it is running on
 the CPU, then it won't have to get attention of the CPU by hardware
 interrupt, right? So is it running elsewhere?
 3. Does a hardware interrupt interrupt the CPU directly, or does it first
 contact the kernel process and the kernel process then contacts/
 interrupts the CPU?
----
On the other hand, I think the purpose of a software interrupt is for a process
currently running on a CPU to request some resources.
 1. What are the resources? Are they all in the form of running processes?
 For example, do CPU driver process and memory driver processes represent
 CPU and memory resources? Do the driver process of the I/O devices
 represent I/O resources? Are other running processes that the process
 would like to communicate with also resources?
 2. If yes, does a software interrupt contact the processes (which represent
 the resources) indirectly via the kernel process? Is it right that unlike
 a hardware interrupt, a software interrupt never directly interrupts the
 CPU, but instead, it interrupts/contacts the kernel process?

Solutions: Please watch the whole video to see all solutions, in order of how many people found them helpful

With thanks & praise to God, and with thanks to the many people who have made this project possible! | Content (except music & images) licensed under cc by-sa 3.0 | Music: https://www.bensound.com/royalty-free-music | Images: https://stocksnap.io/license & others | With thanks to user Tim (https://unix.stackexchange.com/users/674), user Gilles 'SO- stop being evil' (https://unix.stackexchange.com/users/885), user BillThor (https://unix.stackexchange.com/users/4520), and the Stack Exchange Network (http://unix.stackexchange.com/questions/17998). Trademarks are property of their respective owners. Disclaimer: All information is provided "AS IS" without warranty of any kind. You are responsible for your own actions. Please contact me if anything is amiss at Roel D.OT VandePaar A.T gmail.com.