nachos.machine
Class GraphicalConsole

java.lang.Object
  |
  +--nachos.machine.GraphicalConsole

public final class GraphicalConsole
extends Object
implements SerialConsole

A graphical console that uses the AWT to put a console in a window.


Constructor Summary
GraphicalConsole()
          Allocate a new graphical console.
 
Method Summary
 void init(Privilege privilege)
           
 int readByte()
          Return the next unsigned byte received (in the range 0 through 255).
 void setInterruptHandlers(Runnable receiveInterruptHandler, Runnable sendInterruptHandler)
          Set this console's receive and send interrupt handlers.
 void writeByte(int value)
          Send another byte.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphicalConsole

public GraphicalConsole()
Allocate a new graphical console.
Method Detail

init

public void init(Privilege privilege)

setInterruptHandlers

public void setInterruptHandlers(Runnable receiveInterruptHandler,
                                 Runnable sendInterruptHandler)
Description copied from interface: SerialConsole
Set this console's receive and send interrupt handlers.

The receive interrupt handler is called every time another byte arrives and can be read using readByte().

The send interrupt handler is called every time a byte sent with writeByte() is finished being sent. This means that another byte can be sent.

Specified by:
setInterruptHandlers in interface SerialConsole
Tags copied from interface: SerialConsole
Parameters:
receiveInterruptHandler - the callback to call when a byte arrives.
sendInterruptHandler - the callback to call when another byte can be sent.

readByte

public int readByte()
Description copied from interface: SerialConsole
Return the next unsigned byte received (in the range 0 through 255).
Specified by:
readByte in interface SerialConsole
Tags copied from interface: SerialConsole
Returns:
the next byte read, or -1 if no byte is available.

writeByte

public void writeByte(int value)
Description copied from interface: SerialConsole
Send another byte. If a byte is already being sent, the result is not defined.
Specified by:
writeByte in interface SerialConsole
Tags copied from interface: SerialConsole
Parameters:
value - the byte to be sent (the upper 24 bits are ignored).