25.8 Character Output – ttwrite (8550)

This procedure is called via “klwrite” (8067) when output is to be sent to the terminal.

8556:

If the terminal is inactive, do nothing;

8558:

Loop for each character to be transmitted ...

8560:

While there are still an adequate number of characters queued for transmission to the terminal ...

8561:

call “ttstart” just in case it is time to send another character to the terminal;

8562:

Setting the “ASLEEP” flag here (also in
“wflushtty” (8224)) is rather pointless since is is never interrogated and never reset until the file is closed;

8563:

Go to sleep. In the meanwhile the interrupt handler will be draining characters from the output queue and sending them down the line to the terminal;

8566:

Call “ttyoutput” to insert the character in the output queue and arrange to have it transmitted;

8568:

Call “ttstart” again, for luck.