Homework 9 Solutions

22C:116, Fall 2000

Douglas W. Jones
  1. A Problem What capabilities would you suggest should be included in the "standard environment" of a process running under this DEMOS-like system?
    The standard environment should contain capabilities for:
    • pmcap - the process manager creation box.
    • fmcap - the file manager creation box.
    • wmcap - the window manager creation box.

      The above are needed so the process can perform services that might be expected from the kernel of a conventional system.

    • stdin - standard input.
    • stdout - standard output.
    • stderr - standard error.

      The above are either file or window capabilities (assuming these offer compatable user interfaces) so that a program can interact with its users.

    No mention was made of a directory server; without this, we can't draw conclusions about capabilities representing the current working directory and the root directory.

  2. A Problem Outline a protocol by which a user process could create a new process and start it running a particular object file, where the new process runs in the environment of its caller.
    1. retcap = create( retbox )
    2. send( <retcap>, pmcap )
    3. <childcap> = receive( retbox )
    4. send( <write codesegment, code>, childcap )
    5. send( <write registers, initialvalues>, childcap )
    6. childclist = <pmcap, fmcap, wmcap, stdin, stdout, stderr>
    7. send( <write clist, childclist>, childcap )
    8. send( <start>, childcap )

  3. A Problem Suggest the kinds of rights you might wish for in developing systems based on this set of servers.
    With each standard server, the operations provided by that server were a subset of the following list:
    • delete -- deletes an item managed by the server
    • start -- starts or activates an item
    • stop -- stops or deactivates an item
    • read -- reads data from an item
    • write -- writes data to an item
    The most obvious way to assign access rights is to associate one right with each operation allowed on the objects in each class. Since these are the names of the operations on all the objects that have been mentioned, we can simply declare these to be the access rights that we will support.

    Perhaps, in the spirit of Demos, we could add additional rights to control the duplication of capabilities.

  4. A Problem What minimium facilties are missing from this system to allow users to develop protocols for dealing with lost messages during a client-server interaction.

    The message passing primitives provide no way to escape from a receive operation when the message being awaited is lost. A time limit on the receive operation would allow this.
  5. A Problem Suppose you wanted to write a server under this system. Your server will need to wait for any request from any client. Unfortunately, the set of services documented here does not suffice for this. Propose a solution to this problem.
    One solution would be a predicate wouldblock(box), returning true if an attempt to receive from the indicated box would block the caller, and false if a message is waiting in the indicated box. This would force the server to poll the set of all boxes from which it is willing to receive messages, so it is not a great idea.

    A better solution would be to add a service waitfor(list-of-boxes) that awaits the availability of a message in any box in the given list and then returns the box ID of one of the boxes where a message is available. This could be combined with the time limit in the previous problem to create a service analogous to the UNIX select service.