All Exams Test series for 1 year @ ₹349 only
Question

The instruction which are executed only in kernel mode is known as ______.

The correct answer is

privileged instruction

Understanding Execution Modes in Operating Systems

Operating systems use different execution modes to protect system resources and ensure stability. The two primary modes are user mode and kernel mode.

What is Kernel Mode?

Kernel mode is the most privileged mode of execution. In this mode, the operating system kernel has full access to all hardware resources, including memory, CPU, and I/O devices. Code running in kernel mode can execute any instruction, including those that directly manipulate hardware or control system operations.

What is User Mode?

User mode is a restricted execution mode. Applications and most parts of the operating system's services run in user mode. In this mode, software has limited access to system resources and hardware. To perform operations that require direct hardware access or control (like accessing a file or network), a user-mode program must make a system call, which transitions the CPU into kernel mode to execute the request.

What are Privileged Instructions?

Certain instructions are considered critical for system operation and security. These instructions can perform actions like:

  • Disabling/enabling interrupts
  • Accessing I/O ports
  • Modifying memory management hardware (e.g., page tables)
  • Changing the CPU's mode of operation

These instructions are called privileged instructions. Due to their potential to affect the entire system, they are designed to be executed only when the CPU is in a privileged state, specifically kernel mode.

Why are Privileged Instructions Executed Only in Kernel Mode?

Executing privileged instructions only in kernel mode is a fundamental security mechanism. If user-mode programs could execute these instructions, they could potentially:

  • Access or modify data belonging to other programs or the operating system.
  • Crash the system by executing faulty hardware commands.
  • Take control of the system, leading to security breaches.

By restricting privileged instructions to kernel mode, the operating system maintains control and protects itself and other processes from unauthorized access and manipulation.

Analyzing the Options

  • Logical instruction: These are general instructions for performing bitwise operations (like AND, OR, NOT). They are commonly used in user-mode programs.
  • Memory instruction: These instructions deal with reading from and writing to memory. While memory access is managed by the OS (requiring kernel mode for setup), the actual read/write operations by user programs on their allocated memory are done using instructions executable in user mode, subject to memory protection mechanisms.
  • Arithmetic instruction: These are instructions for performing mathematical calculations (like addition, subtraction, multiplication, division). They are standard instructions executable in user mode.
  • Privileged instruction: As discussed, these are specific instructions that control system resources and sensitive operations, designed to be executed only in the kernel mode.

Therefore, the instruction executed only in kernel mode is known as a privileged instruction.

Revision Table: Execution Modes and Instructions

Concept Description Execution Mode
Kernel Mode Full access to hardware and system resources. Privileged
User Mode Restricted access to hardware and system resources. Unprivileged
Privileged Instruction Instructions controlling system resources (e.g., I/O, interrupts). Only Kernel Mode
Non-privileged Instruction General instructions (e.g., arithmetic, logical, data movement). User Mode and Kernel Mode

Additional Information: System Calls

User-mode programs need to interact with hardware and perform privileged operations. They do this by issuing a system call. A system call is a request from a user-mode program to the operating system's kernel for a service. When a system call occurs:

  • The CPU transitions from user mode to kernel mode.
  • The kernel validates the request and executes the necessary privileged operations.
  • The CPU transitions back to user mode, returning control and results to the user program.

System calls act as a controlled interface between the less privileged user mode and the highly privileged kernel mode, allowing user programs to indirectly access privileged functionalities without being able to execute privileged instructions directly.

Was this answer helpful?

Important Questions from Miscellaneous

  1. Read the given figure and find the region representing persons who are educated and employed but not confirmed in job.

  2. The magazine in which Mahatma Gandhi mentioned what he wanted the Constitution to do is:

  3. Which gas shields the surface of the earth from ultraviolet radiation from the sun?

  4. Which event is marked as an Intangible Cultural Heritage of Humanity by UNESCO?

  5. Who has been conferred with the rank of the Commander of the Order of the British Empire in 2018?

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App