A kernel control path is the sequence of instructions executed by a kernel to handle a system call, an interrupt or an exception.
The kernel is the core of an operating system, and it controls virtually everything that occurs on a computer. An interrupt is a signal to the kernel that an event has occurred. Hardware interrupts are initiated by hardware devices, including the keyboard, the mouse, a printer or a disk drive. Interrupt signals initiated by programs are called software interrupts or exceptions.
A system call is a request in Linux or other Unix-like operating systems made via a software interrupt by an active process for a service performed by the kernel, such as input/output (I/O) or process creation (i.e., creation of a new process). A process is an instance of a program in execution. An active process is a process that is currently progressing in the CPU (central processing unit), in contrast to processes that are currently awaiting their turns for the CPU.
In the most simple situation, the CPU executes a kernel control path sequentially, that is, beginning with the first instruction and ending with the last instruction. However, the CPU interleaves (i.e., alternates running parts of the two separate sequences) the kernel control path in several types of situations: (1) when the CPU detects an exception while running a kernel control path (e.g., attempting to access data that is currently not in memory), (2) when a process in user mode invokes a system call and the corresponding kernel control path confirms that the request cannot be immediately granted and (2) when a hardware interrupt occurs while the CPU is running a kernel control path with the interrupts enabled.
User mode is one of two distinct execution modes for the CPU in Linux. It is a non-privileged mode in which each process starts out. It is non-privileged in that it is forbidden for processes in this mode to access those portions of memory that have been allocated to the kernel or to other programs. The kernel is not a process, but rather a controller of processes, and it alone has access to all resources on the system.
Context switching is not permitted when the CPU is executing a kernel control path associated with an interrupt. A context switch is the switching of the CPU from one process to another.
Created April 15, 2006.