1BSD/ex-1.1/SYSDEP

November 9, 1977

KNOWN SYSTEM DEPENDENCIES / MAGIC NAMES IN EX-1.1

Globally:

1. Needs a printf which prints through putchar.
2. Wants the data bases described in SETUP.
3. Needs a large amount of core; separate i/d preferred.
4. Needs a version 7 C compiler.
5. Assumes (in the library routines and the way it deals with ttyn
   e.g. for the visualmessage option) that teletype names are single
   characters, and that /etc/utmp is indexed by this character.
   (More on this below.)

---------------------------------------------

In the HEADERS:

ex.h
	Defines ECHO and RAW for stty.
	Defines TTYNAM which is initialized in ex_tty.c and there
	    assumes that single char teletype names are used.
	Note that ex does not catch the TERMINATE signal of version 7
	    UNIX... it should be defined here.

ex_glob.h
	The definitions here limit the argument list size possible with the
	    next command.  This does not limit the size of entry argument
	    list however... if invoked with a longer list that is ok (although
	    it has never been tested of course!)

ex_io.h
	The basic stat buffer structure is assumed here.
	Also the error codes for errno from system error returns on i/o
	    are defined here... if you have more error codes you should
	    add them... ex does not use "perror" because this way puts
	    the messages in the string message file saving space.

ex_vis.h
	The definitions of TUBELINES, TUBECOLS, and TUBESIZE here
	    limit the kinds of terminals on which open and visual are possible.
	    The areas are allocated, with fixed size, on the stack at entry to
	    the routines in exo.c and exv.c.  Variable sized screens would be
	    possible if you added an assembly language intermediary here,
	    or you can make these numbers larger, at the expense of allocating
	    these larger buffers on terminals with small screens.

---

CODE files:

ex.c
	/erpath =+ 9/
		Assumes that the error path contains a prefix like "/usr/lib"
		    so that adding 9 bytes will give the last portion of the 
		    error file name for testing "a.out".
	/== 'd'/
		Here derive the properties of "edit".
	/signal/
		New caught signals should be added here, notably
		    the signal TERMINATE for a version 7 system.

ex_ca.c
	To add a cursor addressible terminal you must add it to the
	    routine canCA and change cgoto to return a string.
	    All terminals which are to be added must have their properties
	    recorded in /etc/ttycap.

ex_glob.c
	This glob routine supports constructs in all portions of path names,
	    e.g. "/*/bill/a.out";  it also interprets trailing slashes as 
	    forcing a directory match - eg "*/" matches all subdirectory names.
	    This corresponds to the glob which is glob2.c in ../s6
	    and also the glob built into ../ashell.

ex_tty.c
	This routine assumes the version 6 structure of teletype names
	    in its handling of TTYNAM.  This can be easily changed
	    by forming the value of TTYNAM in a slightly different way.

ex_io.c
	The routine ioerror embodies the strings from "perror" which are
	    related to input/output.  These should be added to or changed
	    as appropriate to your system.  Perror is not used because
	    it is desired to have the error messages in the string message
	    file (this saves ~~ 200 bytes per editor user in the swap image.)


ex_put.c
	Note the routine "setcol" which fixes UNIX's notion of the tab
	    column position after a cursor addressing sequence on an ADM-3A.
	    This is hard, in general.  If you wish to perform a similar
	    fix for your terminals this is the place to do it.

ex_recover.c
	The routines here assume that you have installed the exrecover
	    and expreserve routines from ../exrecover, and that when
	    the system crashes you run expreserve in /etc/rc to save the stuff
	    from /tmp so that people can continue where they left off.
	    If this is not true, no harm is done... as long as you don't ever
	    crash!

ex_set.c
	Note that the default directory and shell are initialized here.

ex_tty.c
	Here the capabilities of the terminal which interest us are extracted.
	    These are used by the print routines in ex_put.c, and more exten-
	    sively by the visual and open mode routines.

	    Currently, we are running visual on ADM-3A's (its native terminal)
	    and also on HP2645's.  For the latter, the editor makes use only
	    of the clear to end-of-line operation.  I have not put in the use
	    of the add and delete line operations (although they are read
	    here into AL and DL).  If you have a number of intelligent
	    terminals you may wish to try to add the intelligent terminal
	    driving to visual... it is not hard.  I have not done it since
	    we have only 2 HP2645's and both are at 9600 baud where it matters
	    little if it knows about the intelligence.

	    The routines most likely to be changed in such an addition are
	    all in the file ex_vadjust.c... they are mentioned below.

ex_unix.c
	It is here assumed that the shell understands the option "-c",
	    and also the option "-i" to give a login type shell.  Both of
	    the shells from Berkeley, and also the Version 7 shell from
	    Bell have this property.  Note also that substituted file
	    names are given high-order bits set so that glob will not
	    be a nuisance... it is better of course not to edit files
	    with funny names.

ex_vadjust.c
	This is where the work is required to add the AL (add line)
	    and DL (delete line) capabilities of the terminal to open
	    and visual.  Likely candidates for change are the routines
	    "vopen", "vsync", and "vredraw"... with these capabilities
	    you may well want to always use "vredraw"... "vsync" is the
	    routine which leaves the dirty "@" lines on the screen.
	    If you do any work here I would like to hear of it as I
	    am not planning to do this but would like to have working
	    code for it.

ex_vcurs.c
	Note that the routine "vputchar" assumes that you can simply
	    overwrite and have no trouble (that overstrking an "a" with
	    a "b" works leaving a "b").  If you have terminals where this
	    is not true (i.e. that have OS) you can send a blank to clear
	    the position first... rumor has it that there are some
	    ITT beasts of this flavor (at UCLA?).

exr.c
	Sensibility detection by decoding the flags bit of a stat buffer
	    an by looking at the magic numbers of PLAIN files should
	    be changed to reflect the kinds of stuff you have in your
	    file system.

exw.c
	Note the explicit checks for /dev/tty and /dev/null by major
	    and minor device number here.

--------------------------------------------------

I would be glad to learn of any other problems you have or changes
you make to ex.

I will be glad to answer questions by mail or phone, and would be glad to know
of any fixes and changes.

					Bill Joy
					CS Division
					Department of EE and CS
					UC Berkeley
					Berkeley, California 94704

					(415) 524-4510		[home]
					(415) 642-4948		[school]