Name: ___________________________ Login:_________________

Comp111 - Operating Systems
Final Exam, Dec 16, 2011
Open Books and Notes

1 20
2 20
3 20
4 20
5 20
6 10
Total 110

Please write all answers on the exam. Please feel free to use the back of each sheet if appropriate. Please show all of your work for full credit.

  1. Suppose you have the following situation as reported by ls -l:
    dr-xr-xr-x 1 root  root    4096 Dec 15 13:00 /
    drwx-w---x 1 couch faculty 4096 Dec 15 13:00 /foo
    -rw--w---x 1 cat   student 2965 Dec 15 13:25 /foo/bar
    1. (5 points) Can a user in group faculty create a file inside /foo? Why?

    2. (5 points) Can a user in group student read the file /foo/bar? Why?

    3. (5 points) Can couch in group faculty delete /foo/bar? Why?

    4. (5 points) Can couch in group faculty list the directory /foo? Why?

    Name: ___________________________ Login:_________________

  2. (20 points) Virtualization programs such as VMWare player or VirtualBox allow one to execute an operating system as a regular user program inside another operating system. How must an "OS player" program deal with I/O to and from the OS that is now running as a user process? Where is the true driver for each device located? Why?

    Name: ___________________________ Login:_________________

  3. We have extensively discussed what can and cannot be observed and/or done by a user or a subsystem of the operating system.
    1. (5 points) Explain why it is difficult for a user to directly measure the speed with which a file is written to disk.

    2. (5 points) Does a process need to know whether its read-only (and copy-on-write) pages are shared with other processes? Why or why not?

    3. (5 points) Does the filesystem driver need to know how the disk paging subsystem works? Why or why not?

    4. (5 points) Does the raw disk driver need to know the kind of disk it is controlling? Why or why not?

    Name: ___________________________ Login:_________________

    1. (10 points) Please explain why I claim that the disk paging subsystem is a producer/consumer architecture. Identify both producers and consumers and describe what each does.

    2. (10 points) Does adding a journal to a filesystem result in an additional producer/consumer relationship? Why or why not?

    Name: ___________________________ Login:_________________

  4. (20 points) The design of an operating system involves many tradeoffs between predictability and efficiency. Predictability refers to the fact that processes have predictable behavior and results, while efficiency refers to the fact that useful work predominates and overhead is minimized. List some tradeoffs between predictability and efficiency, and explain the impacts of the choices that linux designers made among the alternatives.

    Name: ___________________________ Login:_________________

  5. (10 points EXTRA CREDIT) It is a little-known fact that when memory is allocated via sbrk in linux, its initial state is all zeros. Everything I have told you about operating systems makes this decision counter-intuitive: data structures should self-initialize; programmers should expect anything for initial values of allocated storage. Why did the designers of memory allocation make this rather obvious exception to the rule of saving time whenever possible?