22.8 Discussion

“lpwrite” is called one or more times to send a string of characters to the printer. In turn it calls “lpcanon” which calls “lpoutput”. If at any point too many characters are stored away, the procss will “sleep” in “lpoutput”. Sooner or later “lpoutput” will continue, will store the character in a buffer area, and will then call “lpstart” to send, if possible, a string of characters to the printer controller.

“lpstart” is called both when more characters are available to be sent, and when an interrupt from the printer is taken.

The majority of calls on “lpstart” will in fact achieve nothing. Occasionally (usually when the printer has just completed a print cycle) “lpstart” will be able to send a whole string of characters to the printer controller.