Briefly describe why a virtual machine operating system structure is a good environment for developing new operating systems.
What does the operating system do at process scheduling time when no processes are ready to run?
Modify the SOS Dispatcher
to support a class of SCHED_IDLE processes that get selected to run
only when they are no normal processes to run. Show any needed
changes to the struct ProcessDescriptor
data
structure.
Consider the following incomplete solution for a basic Unix shell:
while (1) { [1] _A____ if (id>0) { [2] _______ [3] _______ } else { [4] _______ [5] _______ [6] _______ } }
Indicate where each of the following pseudo-system calls should go in the above code. The first one has been done for you:
A. id = fork() B. call execvp(cmd, args) C. wait() D. print out "this is the child process" E. print out "this is the parent process" F. exit()
Consider the following mutual solution to a critical-section problem:
#define TRUE 1 #define FALSE 0 int lock; /* shared between two processes */ while (1) { while (lock) /* Loop until safe to enter */ ; /* do nothing until FALSE */ lock = TRUE; /* do critical region stuff */ lock = FALSE; }
Does it work? Explain why or why not.
Critical region access:
Consider the multiprocess SOS solution we looked at (use-proc-table.c
).
Explain why "busy waiting" is acceptable in order to gain access
to the process control block.
True or False:
Threads are often called "lightweight" processes. Why? What is "light" about them?
Four processes are ready to run. Their CPU burst times are 5, 12, 1 and 7. In what order are they run under a FCFS scheduling algorithm? What is the average waiting time? How close is this to the best average waiting time we could have had for these processes? What is the throughput?