|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nachos.machine.StandardConsole
public class StandardConsole
A text-based console that uses System.in and System.out.
Constructor Summary | |
---|---|
StandardConsole(Privilege privilege)
Allocate a new standard console. |
Method Summary | |
---|---|
protected int |
in()
Attempt to read a byte from the object backing this console. |
protected void |
out(int value)
Write a byte to the object backing this console. |
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 |
---|
public StandardConsole(Privilege privilege)
privilege
- encapsulates privileged access to the Nachos
machine.Method Detail |
---|
public final void setInterruptHandlers(Runnable receiveInterruptHandler, Runnable sendInterruptHandler)
SerialConsole
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.
setInterruptHandlers
in interface SerialConsole
receiveInterruptHandler
- the callback to call when a byte
arrives.sendInterruptHandler
- the callback to call when another byte
can be sent.protected int in()
public final int readByte()
SerialConsole
readByte
in interface SerialConsole
protected void out(int value)
value
- the byte to write.public final void writeByte(int value)
SerialConsole
writeByte
in interface SerialConsole
value
- the byte to be sent (the upper 24 bits are ignored).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |