NOTE: Most questions on this test can be answered in one short paragraph or less! Exceptions are noted explicitly.
This exam is worth 3/10 of the final grade (30 points; allocate 4 minutes per point).
Part A: Is this mechanism formally correct in the sense that it will never reclaim an object for which some running program still has a capability? If not, why not? (2.0 points)
Part B: Is this mechanism leak free in the sense that all garbage will eventually be reclaimed? If not, why not?! (2.0 points)
Recall that the UNIX command "ln x y" creates a new link named "y" for a preexisting file reached by the name "x", and that the UNIX command "rm x" deletes the link named "x". Recall also that each directory contains a link to itself, named "." and a link to its parent, named ".."; the "mkdir" and "rmdir" commands maintain these structures.
Part A: Why, under UNIX, must "rm" and "ln" be restricted, so that "rm" may not be used to delete the link to a directory, and "ln" may not be used to create a link to a directory? (2.0 points)
Part B: If UNIX used a mark-sweep garbage collector to reclaim unreachable files instead of the reference count algorithm outlined above, would your answer to part A be different? Why? (2.0 points)
This question deals with deadlock detection in the context of this system. The applicable deadlock model is clearly a single resource model. A deadlock detection protocol in this system can be initiated when a process detects that it has been blocked for too long.
Part A: Describe a deadlock detection protocol appropriate for this system. What messages are sent, when, by whom, in response to what, and to whom? How does the protocol terminate if there is a deadlock? How does it terminate if there isn't? (4.0 points)
Part B: There are three practical candidates for the participants in your deadlock detection protocol. Messages could be addressed to:
In the context of your answer to A, would all communication be directly between the involved processes, or would some of the messages you described be addressed to the kernels or the agent associated with some process. Which messages are involved, would the be better addressed to a kernel or to an agent, and why? (3.0 points)
Operations on all non-page objects are implemented by the kernel, and they are implemented by imposing new semantics on load and store instructions that address non-page objects. If the object is at address A in the virtual address space, load(A) is one operation, store(A) is another, load(A+1) is another, and so on.
As an example of a non-page object, consider the data type "double ended queue" or dequeue. The following operations are allowed on a dequeue, all others are errors:
Part A: Outline the structure of the fault handler, with an emphasis on how it distinguishes between page and non-page faults, and for non-page faults, how it determines object type, and how it emulates the load and store instructions to achieve selected operations on dequeues. (3.0 points)
Part B: Consider the object type "capability list", added to this environment. All operations on capability lists must be encoded as load and store instructions, interpreted by mechanisms similar to those you outlined in part A. Propose a reasonable set of operations that would allow users to manipulate capability lists in a secure way. (This is related to problem 3 on the midterm!) (3.0 points)
Part C: Every capability list is, potentially, an execution domain. Discuss appropriate primitive operations you could add to your answer to part B that would transfer control from the current domain to a new domain, with emphasis on solving the mutual suspicion problem. (3.0 points)