• edited by
35,340 views
95 95 votes

A CPU has two modes -- privileged and non-privileged. In order to change the mode from privileged to non-privileged

  1. a hardware interrupt is needed
  2. a software interrupt is needed
  3. a privileged instruction (which does not generate an interrupt) is needed
  4. a non-privileged instruction (which does not generate an interrupt) is needed

8 Answers

98 98 votes

Answer should be (D). Changing from privileged to non-privileged doesn't require an interrupt unlike from non-privileged to privileged. Also, to loose a privilege we don't need a privileged instruction though a privileged instruction does no harm. 

http://web.cse.ohio-state.edu/~teodores/download/teaching/cse675.au08/CSE675.02_MIPS-ISA_part3.pdf

18 18 votes

Answer is (c)

Transitions from kernel to user mode are performed explicitly by the
operating system, generally at the end of an interrupt handler or
kernel call, using a privileged RFE (return from exception) instruction.

Ref- http://www.cs.rochester.edu/courses/252/spring2014/notes/08_exceptions

• reshown by
2 2 votes

To change from non privileged to privileged we require an interrupt known as software interrupt which is generated by a system call which gets translated into a privileged instruction. Option C would be apt.

Also The instructions that get executed in privileged mode will be privileged and never non-privileged. (The earlier answer which is supporting option D is having an absolutely wrong explanation)

• reshown by
2 2 votes
Answer is :-  C ("Scheduler process" does not interrupt a running process.)

1. Device: Devices can interrupt a running process when they need attention from the CPU, such as when data transfer is complete or when input is required.

2. Timer: A timer interrupt occurs when a predefined time period has elapsed. This interrupt can be used for various purposes, including preemptive multitasking, where the CPU switches between different processes.

3. Power failure: While power failure interrupts can occur, they are typically not considered part of normal program execution but rather an external event that may result in the abrupt termination of a running process.

4. Scheduler process:The scheduler process itself doesn't interrupt a running process. Instead, it is responsible for managing the execution of processes, including deciding when to allocate CPU time to different processes. However, the scheduler's decisions may result in a context switch, which effectively pauses one process and starts another, but this isn't an interrupt in the traditional sense.
2 flags:
✌ Low quality (JHighlight “different question , answered”)
✌ Edit necessary (Vignan)
2 2 votes
User mode is called non-privileged mode and kernal mode is called privileged mode.

 

Instructions that run in kernel mode are called privileged instructions and instructions that run in user mode are called non-privileged instructions.

 

Whenever we write a program, we write instructions inside the program. These instructions are in user mode. If any of these instructions wants to communicate or manipulate the hardware, then it will call the system call.

 

So here the operating system will generate an interrupt and make the mode bit = 1. Now the CPU has come from user mode to kernel mode. Now here in the system call run hone ke bad the operating system will generate an interrupt and make the mode bit = 0. Now the CPU has come back to user mode.

 

 

So here, to send the CPU back from privileged mode i.e. kernel mode to non-privileged mode i.e. user mode, we need a software interrupt which will be generated by the operating system and along with it, non-privileged instruction is also required.

 

So option (C) is correct answer.

 

 

 
1 1 vote

option c

it is puerlly decision of the operating system in which particular mode instruction is executed . and operating system is always executed in kernal mode(privileged mode).

Answer:
Position:
Show:

Related questions

35 35 votes
2 answers 2 answers
17.2k
17.2k views
Kathleen asked Sep 23, 2014
17,218 views
System calls are usually invoked by usinga software interruptpollingan indirect jumpa privileged instruction
58 58 votes
8 8 answers
18.9k
18.9k views
Ishrat Jahan asked Nov 3, 2014
18,865 views
A user level process in Unix traps the signal sent on a Ctrl-C input, and has a signal handling routine that saves appropriate files before terminating the process. When ...
30 30 votes
5 answers 5 answers
12.7k
12.7k views
Kathleen asked Sep 14, 2014
12,721 views
Consider a virtual memory system with FIFO page replacement policy. For an arbitrary page access pattern, increasing the number of page frames in main memory willalways d...
58 58 votes
2 answers 2 answers
30.3k
30.3k views
Kathleen asked Sep 14, 2014
30,284 views
Which of the following statements is false?Virtual memory implements the translation of a program's address space into physical memory address spaceVirtual memory allows ...