Homework 5

22C:116, Spring 1999

Due Friday Feb 26, 1999, in class

Douglas W. Jones
  1. Background: A window manager serves two distinct but related purposes. On output, the window manager maps operations on various windows into changes made to one or more display screens. On input, the window manager distributes events occuring on a single mouse and a single keyboard to multiple applications, depending on what window the mouse currently points into.

    This problem focuses on the output side of a window manager! Assume that our display device is implemented using a memory mapped DMA controller with control registers BASE, LINES and PIXPERLINE. BASE points to the base of the region of memory used to generate the screen display, LINES indicates how many lines (rows of pixels) make up the screen, and PIXPERLINE indicates how many pixels are displayed per line. Assume each pixel is one 32 bit word, with 10 bits each giving the intensity of the red, green and blue components (2 bits are wasted in each word, red is most significant, blue is least significant).

    A universal output window interface, with one operation, plot(), could be accessed as either of the following:

    	plot( w, x, y, r, g, b )
    	w.plot( x, y, r, g, b )
    
    In either case, this plots a point of the specified color (r, g, b) at the specified location (x, y) on the window w.

    Part A: One window, base-window, is the only object of the class physical-display. Propose a representation for base-window and give pseudocode for the plot operation as it applies to this object.

    Part B: Assume that each window must be fully contained within its parent window, and that peer windows do not overlap. Propose, at a high level, a representation for user-created windows and an implementation of the plot() operation on such a window.

  2. Background: Consider the fictional Hawk machine, described in http://homepage.cs.uiowa.edu/~dwjones/arch/hawk/.

    The Problem: Briefly summarize how gate crossing and supervisor calls would be implemented by an operating system for this machine.

  3. Background: The UNIX system (in all of its modern variants) has an irregular mix of protection mechanisms, with a distinction between kernel and user state used to protect the system itself, virtual address maps that may be viewed as capability lists used to protect main memory, a file system that uses fixed-format access control lists used to guard the right to open files.

    The Problem: From the point of view of protection mechanisms, how is the right to manipulate an open files protected in UNIX. Emphasize the relationship between this mechanism and the standard models of access control mechanisms.

  4. Background: Capability lists and access control lists are universal, in the sense that they can support any desired static access control policy. The UNIX file protection mechanism uses fixed-format 3-entry access control lists (try "man chmod" on a UNIX system for details) plus the ability to assign users to groups (try "man group" on a UNIX system to see how groups are organized).

    The Problem: Is the UNIX access control model for files universal? Explain!