1,274 views
0 votes
0 votes

 

Please explain each point.
My assumptions are;
1.kernel must save the register values.It should be FALSE as it can be the case if the process is terminated.Thus, no need to save. 

2.kernel must close the files. Explain this point in both the cases(the process is terminated or the time slice of the process is expired)

3.kernel must restore the register values. It should also be FALSE as the coming runnable process might be a new process that has not dealt with registers earlier.Thus, no need to restore. 

4.kernel must save the content of memory onto disk. Explain this too.

1 Answer

2 votes
2 votes

On process switch, the PCB (Process Control Block) is used.

i. Of course true. The kernel will be saving the register values of the currently running process. Think about the Program Counter and other CPU registers.

ii. Not a must. I mean what might be going wrong? The PCB maintains the list of open files for the particular process.

iii. True. The execution needs to start again from the point it was stopped so the registers will be reloaded.

If a new process has come for execution: the program counter(set to 0), stack pointers may still be loaded.

iv. Not a must.

Ans: Option (C)

Related questions

10 votes
10 votes
3 answers
2
Akriti sood asked Dec 20, 2016
2,428 views
can anyone tell what are different activities that are performed in kernel modeuser modehow to change frm user mode to kernel mode and vice-versa,,
0 votes
0 votes
1 answer
4
admin asked Oct 25, 2019
968 views
Can a measure of whether a process is likely to be CPU bound or I/O bound be determined by analyzing source code? How can this be determined at run time?