in Operating System1.Why are two modes (user and kernel) needed?2.What are the steps performed by an OS to create a new process?3.What is the difference between an interrupt and a trap?4.Give three examples of an interrupt.5.What is the difference between a mode switch and a process switch?

Asked Feb 7, 2019

in Operating System
1.Why are two modes (user and kernel) needed?
2.What are the steps performed by an OS to create a new process?
3.What is the difference between an interrupt and a trap?
4.Give three examples of an interrupt.
5.What is the difference between a mode switch and a process switch?


Expert Answer

Step 1

Reasons why two modes are needed in OS:

The two modes of OS are user mode and kernel mode. The user mode helps the operating system in running user applications. The kernel model is required when the system boots and operating system is loaded. Some of the privileged instructions work in kernel mode only. These two modes are required to avoid some issues like a running program can wipe out the operating system accidentally by overwriting it with user data and some disaster results can be occurred due to multiple processes writing in the same system at same time.

Step 2

Steps performed by an OS to create a new process are:

  • A process is created by other process through system calls like spawn or fork. The new created process is called as child process and the process created the new process is called as parent process.
  • Every process is given a unique identifier called as process identifier or PID.
  • In a UNIX system, the process scheduler called as sched is given PID 0. At the time of system startup, it first launches init which is given PID 1. Then init becomes parent by launching all system daemons and user logins.
  • Based on system implementation, child process gest some of resources from parent process.
Step 3

Difference between Interrupt and Trap:

The key difference between trap and interrupt is that trap is a kind of software interrupt triggered by user program like invalid memory access or division b...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in


Computer Science

Related Computer Science Q&A

Find answers to questions asked by student like you

Show more Q&A add

Q: Consider the following procedure: procedure mystery (x, y, z); integer x, y, z;beginz = 2; y= z+x;en...

A: Pass by reference copies the location of argument to the parameter. Hence, the final value of n, A[1...


Q: Programming in C

A: We use the bsearch function from the stdlib.h and define a compare function to return the result of ...


Q: The speed of computers has increased greatly over the history of computing. The traveling salesman p...

A: TSP is an NH Hard problem, if solved by brute force method it takes (n-1)! time where n is the size ...


Q: Show that the following grammar is ambiguous: S → aSbS |bSaS| λ.

A: Solution:Given that,Proof: Given grammar is ambiguous.


Q: How can I create a decoder and a multiplexer in a circuit? The decoder has a 3 bit select input and ...

A: A decoder is a circuit which has n inputs and 2n outputs. So if there are 3 inputs to a decoder it w...


Q: Assume that an array of integers named a that contains exactly five elements has been declared and i...

A: Didn’t mention which language to do the problem. So, did the problem in Java.Given:Let assume an arr...


Q: (Method Overloading) Given the following methods, write down the printed output of themethod calls: ...

A: Answer with Explanation:“doSomething(5)” contains an argument integer “5” and it is called to the “d...


Q: How do I check if a binary number is a multiple of 16 by using bit shifting?

A: Approach: Result = (((n >>4) << 4) == n). First we shift the 4 bit right then we shift t...


Q: Find a regular grammar that generates the language on Σ = {a, b} consisting of all strings with no m...

A: Regular grammar for the language Σ = {a, b} is as follows: