Is mode switching the same as context switching?
No! It is important to realize that context switch and mode change are two different things. The switching between the two modes does *not* need a context switch. All it involves is a switching of modes at the hardware level. All processes share the same kernel code and data structures, which is used when any process is in the kernel mode. Thus, the kernel is not a separate process, but a phase in the execution of every process. The hardware does not know about processes; it sees only two modes – user and kernel. When a process is in the kernel mode, the scheduling algorithm may run, and if it so decides, it will switch the context to another process, and transfer control to it.Thus, a mode switch occurs on every system interrupt, and a context switch occurs only when the CPU switches from one process to another.