TTY, speak now, or forever

voss at s.cs.uiuc.edu voss at s.cs.uiuc.edu
Thu Oct 26 02:34:28 AEST 1989


> Quote "no IOCTLs".

Clarification:  No, I am not writing a "stateless" driver.  The "boss" just 
		thinks the ioctl() interface is over over over loaded.
		(It is rather hard to disagree with him there!)

At the very least, I'll be splitting ioctl's functionality in two.
One for data into the driver, the other for data from the driver.
------------------------------------------------------------------------------
The most popular comment via E-mail has been:

"Base your driver on the POSIX 1003.1 standard instead of Bsd 4.3 `man 4 tty`"

I just finished reading appendix C.  Thanks for the suggestion, it
clarified some things, and definitely saved me from some misfeatures.
------------------------------------------------------------------------------
The second most popular comment:

Set special modes to characters, instead of characters to special modes.
An example was having 'stty erase' bound to BOTH backspace and delete.

I'm definitely planning to do this in a big way.  I'm writing in C++, and
am effectively going to make ever character an object.
(No, I'm not going to call a constructor for every character typed,
 only one instance of 'A' for example.)
==============================================================================
Follow up question:

I haven't "slept on it" yet, but I was thinking this afternoon.
Perhaps THE MOST COMMON USE of ioctl calls is something like:
	get current state
	set new state
	restore saved state
This leads to what may be the most common problem with ttys,
the "restore" step being skipped.
(I know the tcsh even does "tty sanity" checking.)

The solution I am considering, in effect implement a copy-on-write
style system.  Effectively, each process would have its very own
internal TTY state.  The initial state would be inherited from the parent.
When all processes using a state have died/closed(tty) the space would
be reclaimed.  Some information would obviously need to be shared,
but the current "raw, cbreak, cooked" state could certainly be unique.
(The state information would be held in memory subject to swapping.)
[I'ld add an escape, ctl(DONT-COPY-ON-WRITE, 1) for things like stty.]

What do you think, sound like a good idea?

					Bill Voss  

INTERNET: billvoss at uiuc.edu or voss at cs.uiuc.edu



More information about the Comp.unix.wizards mailing list