Specifications

ECE391: Computer Systems Engineering Spring 2015
Machine Problem 2
Checkpoint 1: Monday, March 2, 7pm
Checkpoint 2: Monday, March 9, 7pm
Device, Data, and Timing Abstractions
Read the whole document before you begin, or you may miss points on some requirements.
In this machine problem, you will extend a video game consisting of about 4,000 lines of cod e with additional graphical
features and a serial port device. The code for the game is reasonably well-documented, and you will need to read
and understand the code in order to succee d, thus building your ability to explo re and comprehend existing software
systems. Most code that y ou will encounter is neither as small nor as well docum ented—take a loo k at some of the
Linux sour ces for comparison—but this assignment should help you start to build the skills necessary to extend more
realistic systems. As your effort must span the kernel/user boundary, this assignment will also expose you to som e of
the mechan isms used to manage these interac tions, many of which we will study in more detail later in the course.
Before discussing the tasks for the assignment, let’s discuss the skills and knowledge that we want you to gain:
Learn to write code that interacts directly with devices.
Learn to abstract devices with system software.
Learn to manipulate bits and to transform data fro m one format into another.
Learn the basic structure of an event loop.
Learn how to use the pth read API.
Device Protocols:
We wa nt yo u to have some experience writing software that interacts directly with devices and must adhere to the
protocols specified by those d evices. Similar problems arise when one mu st mee t software inte rface specifications,
but you need experience with both in order to recogn iz e the similarities and differences. Unfortunately, most of the
devices accessible from within QEMU have fully developed dr ivers within Linux. The vid eo card, however, is usually
managed directly from user-level so as to improve performance, thus most of the code is in other software packages
(e.g., XFree86).
We were fortunate to have a secon d device designed by Kevin Bassett and Mar k Murphy, two previous staff member s.
The Tux Controller is that funny little game controller attached to eac h of the machines in the lab.
The Tux Controller connects to the USB port of the lab machine. An FTDI “Virtual Com Port” ( VCP) driver makes the
USB port appear to sof tware as a stand ard (old fashioned) RS232 serial port. We can then set up QEMU so that one of
the e mulated serial ports on the virtual machine m a ps to the emulated serial port connected to the Tux Controller. In
this assignment, you will write cod e that interacts directly with both the ( emulated) video card and the game controller
board.
Device Abstraction:
Most devices implement only part of the functionality that a typical user might associate with th e m. For example, disk
drives provide only a simple inter face through which bits can be stored and retrieved in fixed-size bloc ks of several
kB. All other functiona lity, including everything from logical partitions and directories to variable-length files and file-
sharing semantics, is supported by software, most of which resides in the operating system. In this machine problem,
you will abstract some of the functionality provided by the Tux controller board.
Format Interchange:

Summary of content (12 pages)