Anonymous user menu

A privileged instruction may be executed only when the hardw

A privileged instruction may be executed only when the hardware is in kernel mode. which of the following is least likely to be a privileged instruction?

A) instruction changing the PC

B) instruction sending output to a pointer

C) instruction modifying memory management register

D) instruction that creates a child process

6Comments
Arvind Rawat @arvind.rawat
8 Dec 2014 09:35 am

A privileged instruction can only be (not may be) invoked when the hardware is running in privileged (a.k.a. kernel) mode. And, kernel mode can only be entered by making system calls. Now let us consider each option one by one.

A) For changing the program counter, neither hardware access nor any system call is generated.

B) For sending output to a printer, access to printer hardware is required.

C) In this case also, access to memory hardware is required.

D) For creating a process, CPU needs to invoke a system call called as "fork", which is possible in kernel mode.

Thus, option A is least likely to be a privileged instruction.

jayendra @jayendra
7 Dec 2014 02:49 pm

thank you

Vivek Vikram Singh @vivek14
7 Dec 2014 07:32 pm

Answer should be B.

A) Changing the value of PC should be privileged instruction as if we allow any user process to manipulate PC value,it may end up crashing the programs which are running in the memory. So this is a privileged instruction. 

B) It should be least privileged instruction as sending the output to printer can be done by any process,while printing it will require hardware support and may be privileged instruction.

C) Instruction modifying Memory map or any other hardware directly should be privileged as the same reason as A. There can be several more reasons with better explanation but this explanation is very easy to imagine and it is true as well.

D) Fork() is a system call and these are handled in Kernel mode.

Ranita Biswas @ranita
8 Dec 2014 08:28 am

Answer given by Arvind is correct.
Watch this video: https://www.youtube.com/watch?v=CAUO3SwD-ks
Though the options are little bit different here, but the concept should become clear.

jayendra @jayendra
8 Dec 2014 11:08 am

thank you

Vivek Vikram Singh @vivek14
8 Dec 2014 01:41 pm

Well ,In video he suggested that changing PC does not require to use Hardware.How?? What about my argument about user processes changing PC value?