When a process executing in the user space issues a system call
or triggers an exception
, it enters into the kernel space and kernel starts executing on behalf of the process. Kernel is said to be executing in the process context
. Similarly when an interrupt occurs kernel executes in the interrupt context
. I have studied about kernel execution in kernel thread
, where kernel processes runs in the background.
My Questions are :
Does the kernel execute in any other contexts?
Suppose a process in the user space never executes a system call or triggers an exception or no interrupt occurs, does the kernel code ever execute ?
for(;;) __asm__ __volatile__("nop");
– ninjalj