M.I.T. DEPARTMENT OF EECS

6.033 - Computer System Engineering Handout 5 - February 12, 2000

Solutions to hands-on assignment #1

I. Warmup

The fifth requirement is "the system should be capable of many different applications and management interfaces." This means the system should provide management mechanism (hooks) that control things like size and placement. A simple example of this would be the different kinds of window managers that are available for the X Window System. Looking at the different types of window managers available on Athena (or in general) can give you some idea of the different looks and feels that the X Window system can provide. You can have a window manager that looks like the default window manager on a Sun workstation (mwm) to something that looks more like a Windows 95 environment (fvwm95). You could also have talked about the different interfaces of applications that run on X-windows and how they react to management decisions, like the resizing example given in the text.

II. Basic X usage

For an xterm window, you'd type:

athena% xterm &
To answer the question, use the following options: Thus, the solution could be something like:
xterm -bg red -fg blue -geometry -0-0 &

The colors you choose will vary of course. You can list the colors available by using the showrgb command. Also note that for xterms, the width and height specify the number of columns as opposed to the number of pixels!

III. Understanding the window hierarchy

The point of this exercise was just to analyze the output of xwininfo and see if you could determine the identity and relationship of each parent/child based on the coordinates, size, color, hierarchy, etc. -- to basically match up what you saw on the screen with the xwininfo description of it, and to get a better understanding of the implications of being a parent/child of another window. For instance, you can see that the children of a window could be the actual text box and the scroll bar.

athena% xwininfo -tree

xwininfo: Please select the window about which you
          would like information by clicking the
          mouse in that window.

xwininfo: Window id: 0x1c00014 "XTerminal"

  Root window id: 0x26 (the root window) (has no name)
  Parent window id: 0x8009f8 (has no name)
     1 child:
     0x1c00018 (has no name): ()  499x316+0+0  +298+5
        1 child:
        0x1c00019 (has no name): ()  14x316+-1+-1  +297+4

The first child has a geometry of 499x316+0+0 and is probably where the text appears in your xterm. The child of that is rather thin but has the same height and is most likely the scroll bar.

Also note the dependencies here: if you kill the parent, you will kill its children (and anything else below it in the hierarchy).

IV. Architecture

In this case, the Athena workstation is running both the server and the client for the X Window System. So although there is both a client and a server, the network actually doesn't have to play a role here; messages can be passed between the two local modules of the X Window System. You would only need the network if you wanted to display an application running on a remote machine, for example. This is a example of the hard modularity spoken of in lecture.

One thing to clarify is that the question asked about clients and servers on the X Window System, not just about any client and server protocol that is run on Athena. So although the network is used to get files from an AFS file server, the question asks specifically about the X server here, which deals with the display.


Go to 6.033 Home Page Questions or Comments: 6.033-tas@mit.edu