next up previous
Next: Lower-Half Output Routines Up: The Terminal Driver Previous: Upper-Half Tty Input

Upper-Half Tty Output Routines

The upper half routines consist of ttyputc and ttywrite, which are the producers of data into the output buffer.

Ttyputc(devptr, ch)

The routine ttyputc(devptr, ch), used to input a single character, does the following:

If the input character is NEWLINE then it recursively calls itself to print a RETURN before the NEWLINE *.

Waits for osem (free space)

Deposits character in output buffer.

`Signals' lower-half output routine by enabling output interrupts

Ttywrite(devptr, buff, count)

The routine ttywrite(devptr, buff, count), used to output count number of characters, does the following:

Copies as many characters as it can in the space available, making sure that the count of osem is adjusted appropriately.

Uses ttyputc to output the rest.


Prasun Dewan
Thu Feb 12 11:37:50 EST 2004