[TUHS] Linux kernel support for uppercase terminals

Hugh Pyle hpyle at cabezal.com
Sat Dec 28 11:34:17 AEST 2019

The linux kernel never implemented support for a few features of obsolete
terminals.  I find myself wanting to use Raspberry Pi-style linux machines
with old hardware, so this became quite frustrating.
So, I've put together a patch to the n_tty line discipline that adds some
things needed for using a Teletype model 33 or similar natively:
- XCASE, escaping uppercase (and a few special characters) for input and
- CRDLY, delay to allow time for the carriage-return function;
- NLDLY, delay to allow time for the newline function.

With XCASE and ICANON, the terminal outputs a backslash before uppercase
characters; and accepts a backslash escape to set input to uppercase.  The
usual way to use this is `stty lcase`, which also down-cases all input by
default.  The special character escapes are:
  \^  to  ~
  \!  to  |
  \(  to  {
  \)  to  }
  \'  to  `

With CRDLY there are three options, CR0 through CR2; and with NLDLY there
are options NL0 (no delay) and NL1 (one delay).  This patch uses fill
characters for delay, not timing, so these flags only take effect when
OFILL is also set.

Note: this doesn't change `agetty`, which I don't think implements
uppercase login detection right now.  I have a Teletype running with
auto-login; and then `stty 110 icanon lcase ofill cr1 nl1`.

Code changes and some brief build instructions are here:
Compare with the raspberrypi tree, here,

Not yet submitted upstream - the changes are in quite a high-traffic code
path, and also I just don't know how :)  Feedback is very welcome!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20191227/7f3c5631/attachment.html>

More information about the TUHS mailing list