Re: tty_io.c - kbd input

Theodore Y. Ts'o (tytso@MIT.EDU)
Mon, 10 Feb 1997 20:28:47 -0500

Date: Mon, 10 Feb 1997 17:16:59 -0500
From: Chris Pallotta <>

I am unaware of any "abstraction barriers" I am violating by asking
such questions.

Of course, there's no barriers in actually asking! However, you had
clearly started a design, and were asking a question about how to do a
specific design, as opposed to asking the question of "I want to do X;
how should I best approach it?"

I'm trying to implement a text-to-speech screen reader for linux.
I need to implement a handler in tty_write() (OR con_write(), OR
WHEREVER...) to send the character buffer to the audio device so
it gets spoken. Also, I need to send any keyboard input from the
shell to the audio device as well.

My strong suggestion to you is to ***not*** do this in the kernel. (The
general philosophy is to try to do as much in user-space as possible.)

Instead, write a user-space program which is based on script(1) which
intercepts all tty input going through a pseudo-tty. See the source
code of script(1) or rlogind(8) or telnetd(8) for examples of how to
write a program which uses pseudo-ttys.

This has a couple of advantages. First of all, it doesn't require any
kernel patches. Secondly, it will work for any kind of tty device,
whether it is on a rlogin connection, xterm, or a console.

- Ted