|
First came real ttys. You would have a terminal and you would connect to a unix system via a serial connection of some kind. A tty driver would control how everything worked. This includes a lot more than simply passing characters back and forth. There is also a lot of human interaction functionality.
Programs would interact with the tty driver to achieve various results. For example, the passwd program turns off echo while you type in your password. An editor like vi also uses the tty driver extensively. Even if you never enter any passwords and you never edit any text files, you still use the tty driver. The tty driver knows what your backspace key is and it processes the backspace concept. Unless the program turned echo off, the tty driver sends a copy of the character you typed back to your screen. If you want any of this stuff to work, you need a tty driver. Without these tty driver features, you could arrange for continuous local echo so you can see what you type. But no blanking of passwords. No backspacing. No full screen programs like top, vi, emacs, etc.
When a session is connected via a network, most of the tty driver is now not needed. No need to set baud rate, check parity, count start bits, etc. But you still want vi to work and you want to supress echo during password entry. Make an error? Maybe a backspace concept would be nice. All of this is provided the pty driver.
|