Question on interrupts and user space app

Can a user space application be asynchronously affected of its normal execution course by an interrupt?

How does the driver know which user space process to interrupt?

What are the functions in user space and kernel drivers that achieve this?

  1. yes, the kernel can issue asyncronous interrupts. In UNIX they amount to signals. The kernel also preempts processes in what is known as a process context switch. i.e., another process gets the cpu. Processes experience this as a SIGINT - interrupt signal.

  2. Using aio or sockets involves asynchronous delivery of data. Normally these are under the surveillance of poll() or select().

Based on your question, you might want to understand a syscall. These are defined as numeric values which amount to function pointers into the true system API.

For example, write() is a system function. Only it is not called "write" in the kernel, it is a syscall. A vector. read(), open, select(), etc are all like this. Because of POSIX and probably common sense, the unix kernel people all decided it was a Good Idea to present common entry point names that get translated at run time into a vector or function pointer.

Next, you ask kernel questions. Often it seems. If that interests you, get a linux distro,
put it on an x86 box, download kernel source, and read:

Amazon.com: Understanding the Linux Kernel, Third Edition (9780596005658): Daniel P. Bovet, Marco Cesati Ph.D.: Books

It comes as an ebook at oreilly.com. This is your path to what you want to know.

1 Like