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 display,
- 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:
https://github.com/hughpyle/ASR33/tree/master/rpi/kernel
Compare with the raspberrypi tree, here,
https://github.com/raspberrypi/linux/compare/rpi-4.19.y...hughpyle:teletype

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!


-Hugh