CS 452/652 Assignment 1 (Familiarization)
In this assignment you will
familiarize yourselves with the basic
functionalities of the Eos and the train controller while
learning techniques for handling asynchronous events by polling.
It is recommended that you first write, compile, and execute several simple
programs on the Eos, and only then start working on the
assignment.
Write a program that runs
on the Eos system. Your program
interacts with the user via the WYSE terminal to control
these independent real-time activities:
- a digital clock showing minutes, seconds, and tenths of seconds
since the start of the program; the
clock must measure time intervals accurately, in the sense that it must
not slow down or lose ticks;
- an active display showing the state of the train track
- item for each sensor indicate the time of the last trigger
- item for each switch indicate the position to which it was last set
- A command line interface with the following commands: (commands should be
echoed on the wyse).
- tr train_number train_speed
set any train in motion at the desired speed (0 for stop)
- rev train_number
train should reverse direction, but keep the same speed
- sw switch_number switch_direction
throws a given switch (S) straight or (C) curved
make sure you send the command to turn off the solenoid
- halt the system when the user hits the 'q' key
Use the built-in timer to implement the
clock activity. Do not use
interrupts. Do not use the graphics monitor, except for debugging.
Hand in the following:
- a description of how to operate your program; the full pathname of
your executable file that can be downloaded for testing;
- a description of the structure of your program; your program will be
judged primarily on the basis of this description; describe the
algorithms and data structures used; explain why your clock never loses
ticks;
- the location of all source code submitted for the assignment; this code
must remain unmodified after submission until the assignments are returned;
- a listing of all files submitted;
- answers to the following questions:
- Given that the current hardware and external devices
remain the same, what is the finest resolution clock display which you can
maintain on the terminal display?
Justify your answer with an appropriate analysis. (Hint: consider the hardware devices themselves as well as any timings that you make.)
- How long does the train hardware take to reply to a status
query?
(Note: To answer these questions, you definitely need to do some
timings.)