
Fri Aug 11 20:13:06 EDT 1989 - Bradley Smith
Currently at bes@holin.att.com or att!holin!bes

* CURRENT README FILE FOR MERGE PTY & SOCKET LIBRARY/DRIVER


This is a merged driver of the pty code (see Read-pty) and the socket
code (see Read-uipc) plus some inhancements.

This readme file will state what is new, how it works, what I know
doesn't work (because I haven't coded it) and so forth.


The pty driver is the same, I added one thing. This is to get the
major device number upon opening.  This make easier for select
to work (more on this later).  The reason for merging pty driver
is so that one can get at the structures easier.  The pty driver
could be taken out and figured at load time, but this way I don't
have to worry about it.  If I get enough complaints about this
I can remove the pty driver from the socket code.

The socket code is basically the same execpt for 2 more functions
which are select and sosetup, and a file called linesw.c

	linesw.c is used for initialization, we reassign the linesw
	functions of read, write and input so that we can check on
	select function if it needs to be woken up.

	sosetup allows me to set the major device number of /dev/window
	which on my machine is 7, but might not be on yours.
	Also it allows me to set the address of wintty which is used
	to see if input is on one of the windows. RIGHT NOW THIS IS
	A SECURITY HOLE, IF ONE CALLS THIS FUNCTION AND SETS THE
	WRONG NUMBERS, WHO KNOWS WHAT WILL HAPPEN.  I PLAN ON FIXING
	THIS BUT THE MAIL I AM RECEIVING ON THIS PROMPTS TO SEND IT
	OUT NOW.  ONCE AGAIN THIS IS FOR DEVELOPEMENT!


	select(2) has been added. and it works currenly only on the
	read bitmask.  I plan on added the write soon but mail....
	anyways select works on the read side of the master (I tested
	this), stdin of any window (I tested this), and of couse
	and socket.  Things I haven't tested are slave side of pty
	(Code is there and should work, but you never know) and
	/dev/tty00? (there is no code at all supporting this here)
	and expansion card so I am not sure about anything other than
	/dev/tty000) and /dev/ph? (same as /dev/tty000).


	Also the timeout for select is a long for seconds. ie


	long t;

	t = 10;
	ret = select(32, &readbt, &writebt, &excepbt, &t);

	for timeout in 10 seconds.


There is a support directory that contains the program to be used on
startup, install will put it in /etc/daemons so at boot time it gets
done.

Also I have include a version of vtem (vt100 emulator) which uses
select on the master side of pty and stdin. This version uses less
system resources that the one posted which doesn't uses select but
uses non-blocking i/o instead.


NOTE: if select doesn't work on stdin or pty, usually it means that
the driver didn't load right.

MORE: I would like select to be able to use pipes....I will look
at it but if anyone has an idea on it now, please let me know.

EVEN MORE: It appears that on unloading the device driver that if you
switch windows (ie have more than one window open) it sometimes panics
on you. Also I have run it under the regular 'cc' (for those who don't
have 'gcc') and gcc version 1.31 (yes I need to get a more up to date
copy).
