We discussed four ways in which operating systems are structured. Which of these structures is easiest to extend to a distributed system? Briefly explain why.
What does the operating system do at process scheduling time when no processes are ready to run? (Hint: see the Dispatcher code we went over in class.)
What are the possible outputs when the following code is run on a Unix system?
int n; /* shared global variable */
main(int argc, char *argv[]) {
n = 0;
if (fork() == 0)
n = n + 5;
else
n = n + 7;
printf("n = %d\n", n);
}
Briefly describe why a virtual machine operating system structure is a good environment for developing new operating systems.
Consider the following incomplete solution to Dinky Shell from Project 1:
[0]
[1] _A____
[2] if (id>0)
[3] {
[4] _______
[5] _______
[6] _______
[8] }
[9] else
[10] {
[11] _______
[12] _______
[13] }
[14] _______
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. call getrusage(&before) D. wait() E. print out "this is the child process" F. print out "this is the parent process" G. call getrusage(&after)
True or False:
Return
to the CS3013 Home Page