Console Module
Role in the System
This module simulates a typical console device. The two principal NACHOS files associated with this module are console.h and console.cc. The module consists of
- a keyboard input
- a terminal output
These two entities are represented in NACHOS as two character pointers to UNIX files, which are initialized in the constructor function for the class "console". The pointer "readFile" simulates the keyboard and "writeFile" simulates the terminal display. The console in the baseline NACHOS is asynchronous. As a result, two interrupts are called (after a simulated delay-interval) to signal that characters are either being entered or are done being displayed. This is implemented via pointers to two functions:
- "readAvail" -- a character has arrived
- "writeDone" -- a character has been displayed, thus ready to accept more
Note that the two variables above are calls to routines which are defined within the interrupt module. One of the assignments for NACHOS involves implementing a synchronized console, whereby reads and writes can be controlled more rigorously.
Uses Relation