

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are the Privileged and Non-Privileged instructions in Operating System?
Let us understand the privileged instructions in an operating system.
Privileged instructions
These are called machine level instructions that are executed when the processor is in privileged mode.
The examples include the following −
Shut down the system
Change the contents of a control register.
Jump into kernel code.
Sending commands to I/O devices.
The processor is said to be in privileged mode when the functions in the OS kernel are executing.
Suppose an attempt is made to execute a privileged instruction in non-privileged mode which causes a run-time error.
Generally the user mode of the operating system is called non-privileged mode and kernel mode of the operating system is called privileged mode.
Characteristics
The characteristics of privileges instructions are as follows −
The attempt that is made to execute a privileged instruction in user mode, that is treated as an illegal instruction and it will not execute.
When the control is transferring to any User Program, it is the responsibility of the Operating System to make sure that the Timer is set to interrupt.
Therefore, if the timer interrupts then the Operating System will gain the control. And any instruction that is going to modify the contents of the Timer is Privileged Instruction.
The privileged instructions are mainly used by the Operating System to achieve correct operation.
Non-Privileged Instructions
Non-Privileged mode is also called User mode or it is called as safe instructions.
The examples include the following −
Load and store instructions
Add, Subtract etc.
The figure given below indicates the non-privileged and privileged mode in an operating system −
User mode (or) Non-Privileged Mode |
Kernel mode (or) Privileged Mode |
There must be a mechanism to switch modes and this is as follows −
user → kernel (built into hardware)
kernel → user (privileged instruction)
- Related Questions & Answers
- Supervisor Mode (Privileged Mode)
- What are system calls in Operating System?
- What are operating system services?
- What are the different system calls in the operating system?
- What are the functions of the operating system?
- What are the differences between Unix and Linux Operating System?
- What are the user and system goals of Operating Systems?
- What are the categories for Hardware and Operating System Platforms?
- What are operating system design goals?
- What are Virtual Machines in Operating System?
- What is the operating system?
- What are the levels of memory in the Operating System?
- Difference Between Network Operating System and Distributed Operating System
- How are system calls connected to the operating system?
- What is the operating system evolution?