The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: jnc@mercury.lcs.mit.edu (Noel Chiappa)
To: tuhs@minnie.tuhs.org
Cc: jnc@mercury.lcs.mit.edu
Subject: Re: [TUHS] V6 Console IO
Date: Fri, 24 Jul 2020 10:33:20 -0400 (EDT)	[thread overview]
Message-ID: <20200724143320.18E9C18C073@mercury.lcs.mit.edu> (raw)

    > From: Larry McVoy

    > Yeah, write is unbuffered though I think Noel is correct, it's going to
    > a tty and the tty will buffer until \n

The 'wait until newline' is on the input side.

Output is buffered (in the sense that characters are held in the kernel until
the output device can take them); but normally output will start to happen as
soon as the device is able to take them. Only a certain amount can be
buffered though, after that (the 'high water', I think it's called), the
process is blocked if it tries to do output, and awakened when the buffered
output level goes past the 'low water' mark.

Note that getchar() and putchar() are subroutines in a library; looking
at the source:

  https://minnie.tuhs.org/cgi-bin/utree.pl?file=V6/usr/source/s4/getchr.s

you can see how they relate to the actual read/write calls to the OS.

    > So you probably have to set the tty in raw mode

Probably best to run such programs from something other than the main console,
because if there's a bug in the program, and the terminal is in raw mode, if
you're on the console, you may have to reboot the system to regain control of
the system. (Interrupt characters, ^D etc won't work.)

    > (sorry that I'm vague, I never ran V6).

Tnat's OK, I pretty much have the V6 kernel memorized, from working with
it back in the day... :-)

	Noel

             reply	other threads:[~2020-07-24 14:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-24 14:33 Noel Chiappa [this message]
2020-07-24 14:36 ` Clem Cole
2020-07-25  1:53   ` Dave Horsfall
  -- strict thread matches above, loose matches on Subject: below --
2020-07-25 17:45 Noel Chiappa
2020-07-24  2:28 Noel Chiappa
2020-07-24  4:54 ` Paul Riley
2020-07-24 16:37   ` Random832
2020-07-24 17:15     ` Clem Cole
2020-07-25  2:45       ` Random832
2020-07-24 14:34 ` Clem Cole
2020-07-25  2:48   ` Paul Riley
2020-07-25  4:02     ` John Cowan
2020-07-25 15:09       ` Clem Cole
2020-07-25 15:31         ` Richard Salz
2020-07-26  1:08           ` Random832
2020-07-27  9:11             ` Paul Riley
2020-07-24  0:18 Paul Riley
2020-07-24  2:57 ` Larry McVoy
2020-07-24  4:41   ` Paul Riley
2020-07-24  4:54     ` Paul Riley
2020-07-24 14:01       ` Larry McVoy

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=20200724143320.18E9C18C073@mercury.lcs.mit.edu \
    --to=jnc@mercury.lcs.mit.edu \
    --cc=tuhs@minnie.tuhs.org \
    /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).