Subject: Re: multiple consumers of msmux
To: David Brownlee <abs@netbsd.org>
From: Erik E. Fair <fair@clock.org>
List: tech-misc
Date: 05/20/2003 12:24:39
Dennis Ritchie gave the UNIX world "streams" as the answer to the
question, "why are tty line disciplines so hard to write?" It is
very, very important to distinguish that from its later perversion
into System V's networking API to compete against BSD sockets.

The original paper is still available at:

	http://cm.bell-labs.com/cm/cs/who/dmr/st.html

The key notion is protocol modules that can be pushed on and popped
from a stack, so that I/O from a serial is processed by all of the
stream modules on the stack in turn. In a system like this, it
would in principle be easy to push a keystroke/keycode normalizer
on top of a keyboard serial interface, and then push a module on
top of that to perform some action from a "help" keypress (regardless
of whatever keycode came out from pressing a "help" key on a given
keyboard).

That module could also decide whether to pass on the keypress to
the next module up (ultimately to the userland program), or eat
the keypress after doing whatever processing.

Now, as much as I'd like to see dmr's streams in NetBSD, that is
not what I am suggesting now - that's more work than is necessary
for this, I believe. What I think we need in wscons is an interface
or tap like bpf(4) so that a program could snoop the keypresses
and do things. Your wsfilter notion sounds interesting...

	Erik <fair@clock.org>