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

Upper-Half Tty Input Routines

The upper-half tty input routines consist of ttygetc and ttyread which are the consumers of characters filled into the input buffer.

Ttygetc(devptr)

The routine ttygetc(devptr) performs the following operations:

waits for isem

removes character at the tail of the input queue.

Ttyread(devptr, buff, count)

The routine ttyread (devptr, buff, count) may be used to read count number of chars from the input buffer or all the pending characters (what is the use of this operation?). It does the following:

If count = 0 then all the available characters are copied from the input buffer to buff, and the count of isem is adjusted.

If the count is not zero then as many characters as possible are copied from the buffer to buf (adjusting count of isem) The rest are obtained through getc.


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