TTY Driver - Introduction and Organization

Chapter 12 - XINU's TTY Driver


Introduction

The TTY driver in XINU manages the TTY or serial line interface. This interface is expected to be connected to a terminal - normally the console. We look at this driver because it is representative of a class of drivers that support character devices (as opposed to block devices that transfer a block of data at a time). By the way - the letters TTY are an anachronism - they were short for TeleTYpe when teletype devices were used as computer terminals.

The discussion in this chapter describes the device driver for the PDP-11 version of XINU. The PC version as described in the textbook is slightly different. Look in the new version of the text for specific details. I will mention here only that in the PC version of the text has code which SENDS a message to the other half-routine when work needs to be done, rather than having the device generate an interrupt as indicated in these notes. As well, some of the routines have slightly different names and functionality is moved from one routine to another. If something does not appear in exactly the same place, just look a bit more at the code examples in the surrounding sections.

Also note that the version of the code that we have does not implement the lower-half routines of the device drivers as described. The design model is very instructive, so we will discuss it, but the current version has decided to use the device table mechanism to directly output characters according to the routine provided in that table entry.

Driver Organization

Like most XINU drivers, the TTY driver is organized in two halves, the upper and the lower halves. The upper half of the TTY driver provides the interface to which application processes make requests. The upper half routines deal only with applications and do not manipulate the TTY controller at all. The lower half of the TTY driver is the one that talks to the controller directly.

1