[net.sources] Terminals that need to be downloaded

larry@cci-bdc.UUCP (Larry DeLuca) (01/12/85)

Hi there.  I'm new to NetNews, and had a small piece of source to post.
It's not very much, but it can be useful if you have to deal with 
"intelligent" terminals.  

4.2BSD provides a file called /etc/gettytab to pass terminal attributes 
and other assorted randomness on to getty each time it is invoked.  However,
many word processing terminals have to be downloaded first, and this can
be a problem.  The changes i made to getty to fix this are trivial, and
expect a download program that is smart enough to know when the terminal
needs to be downloaded and when it doesn't.  You can also use it to
run rogue(6) on idle terminals if you like.

The changes are as follows (to the sources in /usr/src/etc/getty:

init.c -- 

10,14d9
< 
< /* Modification for "dl" entry for gettytab (terminal download program) 
<    by Larry DeLuca on 9/6/84 -- see ./README for details (lad)
<  */
< 
48d42
< 	{ "dl" },			/* download terminal (lad) */

main.c --

11,14d10
< /* Modification for "dl" entry for gettytab (terminal download program) 
<    by Larry DeLuca on 9/6/84 -- see ./README for details (lad)
<  */
< 
20d15
< #include <stdio.h>
100d94
< 	int	pid;
146,157d139
< 					/* Download if necessary (lad) */
< 		if (DL && *DL) {		
< 			pid = fork ();
< 			if (pid == 0) 
< 			{
< 				execl(DL,DL,0);
< 			}
< 			else
< 			{
< 				wait();
< 			}
< 		}


gettytab.h --

6,10d5
< 
< /* Modification for "dl" entry for gettytab (terminal download program) 
<    by Larry DeLuca on 9/6/84 -- see ./README for details (lad)
<  */
< 
59c54
< #define DL	gettystrs[24].value		/* 9/6/84 (lad) */
---
> 

then simply define the terminal attributes as you normally would (see
gettytab(5)) but add an entry in the format:

		:dl=/lib/pt/dlpt:

(which is our download program).  For example:

	#
	# This is an entry for a PT (9/6/84 (lad))
	#

	D|DL|Experimental PT Download Entry:\
		:dl=/lib/pt/dlpt:sp#9600:

Then put the terminal in /etc/ttys with the appropriate flag (i.e.):

	1Dtty04

and the download program will be run each time getty(8) is invoked.

I would suggest changing the fork(2) to a vfork(2), since this is more
efficient, and if people have any suggestions would be glad to hear them.

					larry...

UUCP:	..mit-eddie!cybvax0!cci-bdc!larry

ARPA: 	henrik@mit-mc.ARPA	


-- 
This mind intentionally left blank.