These questions are not intended to occupy all of your time prior to the midterm exam! Expect that at least 1/2 of the exam questions will not focus on the material discussed by these study questions, do not expect that the answers to any of these study questions will be the same as the answers to any of the exam questions.
These are study questions! They should motivate you to explore the material we have covered and focus on certain issues that will be central to some of the exam questions.
Each address-space in FinalOS is described by a C-list. The most significant 10 bits of the virtual address select an entry in the process's C-list; if valid and readable, this capability will refer to a C-list holding capabilities for the pages of one segment; the process may have 1024 such segments! The second 10 bits of each address refers to the capability for a page or C-list in the segment, while the least significant 12 bits refers to a byte in the page or a capability in the C-list.
Given the above, consider the following diagram for the address space of one process, call it process P:
-- ------------- | | | C-list | | _________ | P ----> ->0|crw_|___o--- 1|____|____| ______ 2|pr_x|___o------->| page | 3|____|____| |______| 4|____|____| ________ 5|cr__|___o---------------->| C-list | 6|____|____| |________| 7|____|__ all 1024 in 8|___ ___| the above __|____| refer to rw 1023|____|____| pagesIn the above diagram, the first letter shown in the rights field is the type of the capability. If it is blank, the capability is invalid. The following 3 letters say whether that capability is marked read, write or execute, where blank indicates the absence of this right.
Problem What virtual addresses in the address space of process P refer to capabilities? (hint, there are 1027 of them, 1024 of which are consecutive.)
Problem What virtual addresses in the address space of process P refer to locations in memory from which the process could fetch instructions?
Problem What virtual addresses in the address space of process P refer to locations in memory to which the process could store bytes?
Return objects contain 1024 valid addresses (word aligned). Access to these addresses is implemented by the kernel, and not by software. Words 0 to 15 of the return object behave as if they were in a C-list object. These are the "capability registers" of the process when the return object is page 1 of segment zero, so when the kernel fakes a load or store instructions that manipulates a C-list object as its memory operand, these are used as the register operands. Capability 1 is an enter capability for the process's exception handler. Word 16 of the return object is the address, in this process's address space, where execution should begin when a call notice is delivered to this process. Words 17 and up are copies of the CPU registers when this process is suspended.
The system requires that capability register zero of each process refer to the address space of that process. This allows the process to manipulate its own address space.
Problem: Modify the figure given in the previous study question to show the correct structure of a properly formed process under FinalOS 2002.
The abstract operation restrict ANDs the access rights in a capability with a mask, so that a program can take a capability and manufacture a capability for the same object with reduced access rights.
Problem: If the machine has an "and register with memory" instruction, how could the FinalOS 2002 kernel use this to implement a restrict operation.
Problem: If the machine is a pure load-store architecture (with no memory to register or register to memory arithmetic or logic operations), how could the kernel be written to allow users to perform reduce operation.
The effect of the call is to deliver a call notice to the process running in the called object. A call notice is delivered to an address space by suspending the process running in that address space (storing its execution state in its segment zero), and then creating a new segment zero for the called process. This new segment zero (still a return object) takes capability 0 and 1 from the original (so it has the same address space and the same exception handler), but it has a read-write-execute return capability for the old segment zero fo the called address space in capability 2, and it has an execute only capability to the caller's return object in capability 3.
The effect of the above is to deliver something like a signal to the called process! When an exception is raised in a process, a call is made to the exception handler for that process -- an executable capability for the handler must be present in capability register 1 of the process! The return notice delivered to the exception handler has read-write-execute rights.
Problem: Does the FinalOS 2002 kernel have an amplification mechanism?
Problem: How could you modify the above description to allow parameter passing on a call operation? Without this, the whole thing is a bit useless!
Problem: The above description included no discussion of process management, only addressing and protection. What alternatives for process management can you think of.
Problem: Can the ExamOS 2002 kernel be fixed so it supports a good hybrid kernel/user thread package? That is, a thread package where it is up to the user to schedule threads in the user's address space, yet with good kernel cooperation.
Problem: Assume that each device driver under ExamOS 2002 runs mostly as a distinct process, a server. How should ExamOS 2002 respond when an interrupt is requested?
Problem: You want to write a file server under ExamOS 2002. What kind of thing do you offer to a process as a handle on an open file? How does a user operate on that file?
Problem: The ExamOS 2002 does no demand paging. Instead, when a process has a page fault, an exception notice is delivered to that process's exception handler. How would you make the exception handler do demand paging for its user?
Problem What else is missing from the FinalOS 2002 kernel specification? (Lots!)