The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: jnc@mercury.lcs.mit.edu (Noel Chiappa)
Subject: stty erase '^?' in v7
Date: Sun, 15 Oct 2017 10:39:54 -0400 (EDT)	[thread overview]
Message-ID: <20171015143954.C507218C0BB@mercury.lcs.mit.edu> (raw)

    > From: Will Senn

    > All that cooked and raw stuff is gobbledegook that I'll have to read up
    > on.

The raw/cooked stuff isn't the source of the worst hair in the TTY driver;
that would be delays (on the output side), and delimiter processing (on the
input side).

The delays are for mechanical terminals, because they need delays after a
motion command (e.g. NL, CR, etc) before the next printing character is sent;
differing for different motion control commands, further complexified by the
current print head position - a Carriage Return from column 70 taking a lot
longer than one from column 10. The driver keeps track of the current column,
so it can calculate this! It does the delays by putting in the output queue a
chacter with the high bit set, and the delay in the low bits; the output start
routine looks for these, and does the delay.

On the input side, every time it sees a delimiter (NL, EOF), it inserts a 0xFF
byte in the input queue, and increments a counter to keep track of how many it
has inserted. I _think_ this is so that any given read call on a 'cooked'
terminal will return at most one line of input (although I don't know why they
don't just parse the buffer contents at read time - although I guess they need
the delimiter count so the read call will wait if there is not a complete line
there yet).

I should look and see how the MIT TTY driver (which also supported 8-bit input
and output) dealt with these...

    Noel


             reply	other threads:[~2017-10-15 14:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-15 14:39 Noel Chiappa [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-10-14 12:52 Noel Chiappa
2017-10-14 14:40 ` Clem Cole
2017-10-14 14:44   ` Ronald Natalie
2017-10-15 13:10     ` Don Hopkins
2017-10-14  4:25 Noel Chiappa
2017-10-14  4:48 ` Will Senn
2017-10-14  6:31 ` Dave Horsfall
2017-10-14 14:03   ` Will Senn
2017-10-14 22:01     ` Dave Horsfall
2017-10-14  2:59 Will Senn
2017-10-14  4:08 ` Grant Taylor
2017-10-14  4:39 ` Random832
2017-10-14  5:03   ` Will Senn
2017-10-16 14:46     ` Random832

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171015143954.C507218C0BB@mercury.lcs.mit.edu \
    --to=jnc@mercury.lcs.mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).