 |
COMP 421: Lab # 1
Threads, Concurrency, and Device Drivers
Spring 2012
| |
Through this assignment,
you will be able to gain practical experience
programming concurrent systems using threads and monitors.
You will also gain experience with the
operation and complexities of device drivers in operating systems.
In particular,
this project requires you to
implement a terminal device driver using a Mesa-style monitor.
Your terminal driver must use only the
provided Mesa monitor routines for its synchronization,
and must use only a single monitor.
This project must be done individually.
The second and third projects in the class will be done in
groups of 2 students,
but you must do this one by yourself.
The project is due by 11:59 PM,
Monday, February 13, 2012.
Project Information
- The project description handout (PDF)
- Depending on various configuration settings that may be different
for each person,
the keyboard may send different characters for the "Backspace" and
"Delete" keys. Some of you have noticed this by seeing that
your keyboard doesn't generate a '\177' for the "Delete" key.
I have now modified my terminal emulation software to force the
"Backspace" key to always generate a true '\b' backspace
character
and to force the "Delete" key to always generate a true '\177'
delete character,
even if the software you are using
(operating system, xterm, ssh, PuTTY, etc.)
was otherwise configured differently.
To see this new behavior,
you just need to relink your test programs with the
new (currently installed) version of the library.
- I have modified my software for Lab 1 so that it automatically
calls ThreadWaitAll() when your main()
returns or otherwise exits.
This will simplify your test programs and will make sure
ThreadWaitAll() is called even if your main() doesn't
call it itself.
Calling it yourself in main()
is harmless but is now no longer required.
- All of the procedures defined in Section 6.1
(ReceiveInterrupt and TransmitInterrupt)
and Section 6.2
(WriteTerminal,
ReadTerminal,
InitTerminal,
TerminalDriverStatistics,
and InitTerminalDriver)
of the project description handout
must be entry procedures of your monitor.
All 7 of these must be entry procedures,
and your monitor must have no other entry procedures.
- If you are having trouble finding an X Windows server program
to run on your local machine
(or having trouble configuring it correctly),
and if you are running Microsoft Windows,
I recommend the freely available
Cygwin X server.
Directions
on downloading and instaling it
are available on-line.
- If you copied the provided Makefile.template
to make your own Makefile
before Saturday, January 28,
please make your Makefile again based on the
current version of Makefile.template.
The template Makefile has slightly changed.
Thanks.
- NOTE:
There is a typo in the Lab 1 project description handout,
leftover from the way things were set up on the older Owlnet system
(before everything moved to the new CLEAR system).
On CLEAR, there is no "/home/comp421" directory;
instead on CLEAR, this is located in
"/clear/courses/comp421".
The files for Lab 1 are also not under "pub/lab1"
but instead are directly under "lab1".
Thus, the Makefile.template file is actually in
/clear/courses/comp421/lab1/samples/Makefile.template
and (for later) the lab1submit program will be in
/clear/courses/comp421/lab1/bin/lab1submit
I apologize for the confusion.
- An example of how to correctly write a monitor in C or C++
is provided in the directory
/clear/courses/comp421/lab1/philosophers.
- Remember:
You may not create any threads that are simply
a part of your terminal device driver.
Instead, the only threads you may create should be the users of your
terminal driver (those that call ReadTerminal and WriteTerminal, etc.).
[Back to COMP 421 homepage]