Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

ConsoleOutput Class Reference

The following class defines the output side of a hardware console device. Output to the device is simulated by writing to the UNIX file "writeFile". Since output to the device is asynchronous, the interrupt handler "callWhenDone" is called when an output character has been "put" so that the next character can be written.In practice, usually a single hardware thing that does serial input. use two objects. More...

#include <console.h>

Inheritance diagram for ConsoleOutput::

CallBackObj List of all members.

Public Methods

 ConsoleOutput (char *writeFile, CallBackObj *toCall)
 initialize hardware console output. More...

 ~ConsoleOutput ()
 clean up console emulation. More...

void PutChar (char ch)
 Write "ch" to the console display, and return immediately. "callWhenDone" will called when the I/O completes. More...

void CallBack ()
 Invoked when next character can be put out to the display. More...


Private Attributes

int writeFileNo
 UNIX file emulating the display. More...

CallBackObjcallWhenDone
 Interrupt handler to call when the next char can be put. More...

bool putBusy
 Is a PutChar operation in progress? If so, you can't do another one! More...


Detailed Description

The following class defines the output side of a hardware console device. Output to the device is simulated by writing to the UNIX file "writeFile". Since output to the device is asynchronous, the interrupt handler "callWhenDone" is called when an output character has been "put" so that the next character can be written.In practice, usually a single hardware thing that does serial input. use two objects.

Definition at line 75 of file console.h.


Constructor & Destructor Documentation

ConsoleOutput::ConsoleOutput ( char * writeFile,
CallBackObj * toCall )
 

initialize hardware console output.

ConsoleOutput::ConsoleOutput Initialize the simulation of the output for a hardware console device.

"writeFile" -- UNIX file simulating the display (NULL -> use stdout) "toCall" is the interrupt handler to call when a write to the display completes.

Definition at line 111 of file console.cc.

ConsoleOutput::~ConsoleOutput ( )
 

clean up console emulation.

ConsoleOutput::~ConsoleOutput Clean up console output emulation

Definition at line 127 of file console.cc.


Member Function Documentation

void ConsoleOutput::CallBack ( ) [virtual]
 

Invoked when next character can be put out to the display.

ConsoleOutput::CallBack() Simulator calls this when the next character can be output to the display.

Reimplemented from CallBackObj.

Definition at line 140 of file console.cc.

void ConsoleOutput::PutChar ( char ch )
 

Write "ch" to the console display, and return immediately. "callWhenDone" will called when the I/O completes.

ConsoleOutput::PutChar() Write a character to the simulated display, schedule an interrupt to occur in the future, and return.

Definition at line 154 of file console.cc.

Referenced by SynchConsoleOutput::PutChar().


Member Data Documentation

CallBackObj * ConsoleOutput::callWhenDone [private]
 

Interrupt handler to call when the next char can be put.

Definition at line 90 of file console.h.

bool ConsoleOutput::putBusy [private]
 

Is a PutChar operation in progress? If so, you can't do another one!

Definition at line 92 of file console.h.

int ConsoleOutput::writeFileNo [private]
 

UNIX file emulating the display.

Definition at line 89 of file console.h.


The documentation for this class was generated from the following files:
Generated at Wed Jul 4 11:32:23 2001 for Nachos by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001