M.I.T. DEPARTMENT OF EECS

6.033 - Computer System Engineering Handout 4 - February 4, 2002

Hands-on 1: X-Windows

This hands-on assignment is due at the beginning of class Thursday Feb 14.

Read the paper on the X Window system (reading #4) and complete the following hands-on assignment.

The purpose of this assignment is to give you some hands-on experience playing with the details of the X Window system. In particular, by the end of the assignment, you should have a good understanding of how to use X and how X manages complexity using modularity (through client and servers) and hierarchy (in managing windows). This assignment should take one to two hours at most. Please turn in answers to the questions asked only! Do not submit pages of output from the various commands. Also include how long this assignment took you to complete so we can gauge the complexity of future assignments.

I. Warmup

Section 2 of the paper presents nine design requirements for the X window system. See if you can think of examples of how these requirements affect X today. For example, the requirement of display independence allows I/S to purchase machines from different vendors for use in Athena clusters, but all run X. In a few sentences, describe a drawback of the fifth requirement of X (The system should be capable of supporting many different application and management interfaces).

II. Basic X usage

The design of X has led it to be highly configurable and customizable. To begin understanding some of this, skim the generic man page for the X:

athena% man X

Create an xlogo (command: xlogo) with a different background and foreground color from the default, that is 1000x1000 pixels in size and starts out in the bottom right corner. What arguments did you pass to xlogo?

III. Understanding the window hierarchy

Now, let's get our hands dirty playing with some of the more technical parts of X. There are a number of useful commands that are provided with the X Window System that help you explore the different properties of the system. The first one we will look at is called xwininfo. Run it, and then click on the window you ran it from.

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

xwininfo: Window id: 0x3000014 "XTerminal"

  Absolute upper-left X:  296
  Absolute upper-left Y:  244
  Relative upper-left X:  0
  Relative upper-left Y:  0
  Width: 499
  Height: 316
  Depth: 16
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x23 (installed)
  Bit Gravity State: NorthWestGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +296+244  -5+244  -5-40  +296-40
  -geometry 80x24-0-35

As you can see, this reveals a lot of the properties of the window. Your reading from part II should help you make sense of most of these properties. xwininfo also has two options which help you explore the window hierarchy. First try:

athena% xwininfo -children
and select the xterm you ran that from. As you can see, the window has a parent and a child. In conjunction with the -id option to xwininfo, explore up and down the tree for your Xterm. Use the the different options to xwininfo to find out more about these windows. What is the function of each of the parents? What about the children? How are they realized on your screen? You may find the -tree option useful as well.

IV. Architecture

Consider figure 1 from the paper (p.85). Now consider the Athena workstation you are logged in to. On your display you have many windows. According to the figure, these windows are generated by applications that run over the network and talk to a server. In your case, what machine is running the server? What machine is running the clients? Does the network play a role?

V. Wrap-up

Hopefully this has given you a taste of how X works. There are other useful tools that will let you explore the details of X. Here is a list of some of them. If you are interested, you can run them and see what they tell you. You may find the man pages useful in understanding what they do.


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