Compare the Difference Between Similar Terms

Difference Between User Mode and Kernel Mode

Key Difference – User Mode vs Kernel Mode
 

A computer operates in two modes which are user mode and kernel mode. When the computer is running application software, it is in user mode. After the application software request for hardware, the computer enters kernel mode. The kernel is the core of the computer system. Subsequently, the computer frequently switches between user mode and kernel mode. Most critical tasks of the operating system are executing in the kernel mode. The key difference between User Mode and Kernel Mode is that user mode is the mode in which the applications are running and kernel mode is the privileged mode to which the computer enters when accessing hardware resources.

CONTENTS

1. Overview and Key Difference
2. What is User Mode
3. What is Kernel Mode
4. Similarities Between User Mode and Kernel Mode
5. Side by Side Comparison – User Mode vs Kernel Mode in Tabular Form
6. Summary

What is User Mode?

When a computer application is running, it is in the user mode. Some examples are word application, PowerPoint, reading a PDF file and browsing the internet. These are application programs so the computer is in user mode. When the process is in user mode and requires any hardware resource, that request is sent to the kernel. As there is a limited access to hardware in this mode, it is known as less privileged mode, slave mode or restricted mode.

Figure 02: Modes of Operation

In user mode, processes get their own address space and cannot access the address space which belongs to the kernel. So the failure of one process will not affect the operating system. If there is an interrupt, it only affects that particular process.

What is Kernel Mode?

A kernel is a software program which is used to access hardware components of a computer system. Kernel works as a middleware software for hardware and application software/user programs. Kernel mode is generally reserved for low level trusted functions of the operating system.

When the process is executing in user mode and if that process requires hardware resources such as RAM, printer etc, that process should send a request to the kernel. These requests are sent through system calls. Then the computer enters Kernel Mode from user mode. When the task is completed, the mode changes back to user mode from kernel mode. This transition is known as “context switching”. Kernel mode is also called as system mode or privileged mode. It is not possible to run all processes in the kernel mode because if a process fails the entire operating system might fail.

Figure 02: Kernel

There are several types of system calls. Process control system calls create processes and terminates processes. File management system calls read, write, create, delete, open, and close files.  Device management system calls request devices and release devices, get and set device attributes. There are also information maintenance system calls. They can be used to get system data, time, date. Resource required by one process might be held by another process. Therefore, the processes should communicate using communication system calls. Communication system calls can create and delete connections, send and receive status information.

What are the Similarities Between User Mode and Kernel Mode?

What is the Difference Between User Mode and Kernel Mode?

User Mode vs Kernel Mode

User Mode is a restricted mode, which the application programs are executing and starts out. Kernel Mode is the privileged mode, which the computer enters when accessing hardware resources.
 Modes
User Mode is considered as the slave mode or the restricted mode. Kernel mode is the system mode, master mode or the privileged mode.
Address Space
In User mode, a process gets their own address space. In Kernel Mode, processes get single address space.
 Interruptions
In User Mode, if an interrupt occurs, only one process fails. In Kernel Mode, if an interrupt occurs, the whole operating system might fail.
Restrictions
In user mode, there are restrictions to access kernel programs. Cannot access them directly. In kernel mode, both user programs and kernel programs can be accessed.

Summary – User Mode vs Kernel Mode

A computer operates either in user mode or kernel mode. The difference between User Mode and Kernel Mode is that user mode is the restricted mode in which the applications are running and kernel mode is the privileged mode which the computer enters when accessing hardware resources. The computer is switching between these two modes. Frequent context switching can slow down the speed but it is not possible to execute all processes in the kernel mode. That is because; if one process fails the whole operating system might fail.

Download the PDF Version of User Mode vs Kernel Mode

You can download PDF version of this article and use it for offline purposes as per citation note. Please download PDF version here Difference Between User Mode and Kernel Mode

Reference:

1.nabazan-microsoft. “User mode and kernel mode.” Microsoft Docs. Available here 
2.pranitpkothari. YouTube, YouTube, 23 Feb. 2015. Available here  
3.“Explanation-System calls and System call types in operating system.” ,Last moment Learning, YouTube, 12 July 2017. Available here  

Image Courtesy:

1.’CPU ring scheme’By User:Cljk (CC BY-SA 3.0) via Commons Wikimedia