From:	CSBVAX::MRGATE!KARNEY%PPC.MFENET@NMFECC.ARPA@SMTP 12-AUG-1988 09:43
To:	ARISIA::EVERHART
Subj:	BOSS 2.5 2/4


Received: from ppc.mfenet by ccc.mfenet with Tell via MfeNet ;
	Fri, 12 Aug 88 06:07:45 PDT
Date:	  Fri, 12 Aug 88 06:07:45 PDT
From:     KARNEY%PPC.MFENET@NMFECC.ARPA
Message-Id: <880812060745.20200215@NMFECC.ARPA>
Subject:   BOSS 2.5 2/4
To:       EVERHART%ARISIA.DECNET@GE-CRD.ARPA
Comment: From KARNEY@PPC.MFENET on 12-AUG-1988 09:05:55.96 EDT

+-+-+-+ Beginning of part 2 +-+-+-+
Xprocess is attempting to act synchronously with another, it may be necessary
Xto set their output flags to w.  However, if your synchronous switches are
Xall performed via the BOSS$SWITCH mechanism, this isn't necessary since BOSS
Xtemporarily sets the output flag to w on these types of process switches
X(see topic Communicating).
X
XA potential problem with the b setting is that BOSS empties the buffer to
Xyour terminal in a single operation.  This may overflow your terminal's
Xinput buffer (this is not a problem with a Mac running VersaTerm at 9600
Xbaud).  This is not a problem if BOSS is used with the /FLOW_CONTROL
Xqualifier (assuming that your terminal does flow control).
X3 Examples
XSuppose TIME.COM contains:
X    $ esc[0,8]=27
X    $ sc = esc + "7"                    ! Save cursor
X    $ rc = esc + "8"                    ! Restore cursor
X    $ home = esc + "[;76H"              ! cursor to top right of screen
X    $ invert = esc + "[7m"              ! inverse video
X    $ revert = esc + "[m"               ! normal
X    $10$:
X    $ time = sc+home+invert+f$extract(12,5,f$time())+revert+rc
X    $ read/prompt="''time'"/end=43$/error=42$/time_out=0 sys$command dummy
X    $42$:
X    $ wait  ::5
X    $ goto 10$
X    $43$:
X
XThis displays the time at 5 second intervals in the top right corner of
Xthe screen.  If this is running in a process whose output flag is p, the
Xtime will displayed while in other processes.
X2 Communicating
XBOSS and the subprocesses under it can communicate via logical names.  These
Xonly work for BOSS's subprocesses, not for its top-level processes (because
Xonly the subprocesses share the job logical name table with BOSS).  The
Xfollowing are recognized:
X
XBOSS$ID (in process table);  BOSS defines this as the identifying letter of
Xthe process.  This can be used in tailoring the DCL prompt etc.;  e.g.,
X    $ set prompt "boss-''f$trnlnm("boss$id")'>"
XIt can also be used to indicate to a program that it is running under BOSS.
X
XBOSS$SWITCH (in job table); whenever BOSS is writes output to the real
Xterminal, it checks whether BOSS$SWITCH is defined.  If it's defined as a
Xsingle letter, BOSS will switch to that process and delete the logical name.
XIf the process doesn't exist it is created as a subprocess.  Thus a DCL
Xprocedure can initiate a switch to process G with
X    $ define/job boss$switch g
X    $ write sys$error ""        ! do some output to make BOSS wake up
XThe switch takes place synchronously by setting the output flag for the
Xoriginating process to w temporarily (see topic Output_flags).  Both
XBOSS$SWITCH and BOSS$STUFF should be defined as supervisor mode logical
Xnames in the job table.  They may be defined from programs with e.g.,
X    status:=lib$set_logical('BOSS$SWITCH','D','LNM$JOB');
X
XBOSS$STUFF (in job table); whenever a BOSS makes a process initiated switch.
XIt stuffs the definition of BOSS$STUFF into the input stream of the process
Xbeing switched to.  After being used, BOSS$STUFF is deleted.
X3 Examples
XThe following command procedure will do a SHO DEF and leave SHO DEF in the
Xrecall buffer:
X    $ cr[0,8] = 13
X    $ define/job boss$stuff "sho def''cr'"
X    $ define/job boss$switch 'f$trnlnm("boss$id")'
X
XHere's how to switch to process F and have the present job continue
Xrunning:
X    $ define/job boss$switch f
X    $ char[0,8] = 22                    ! control-V
X    $ gosub out_char
X    $ return
X    $!
X    $out_char:                          ! Spit out the character
X    $ read/prompt='char'/end=40$/error=40$/time_out=0 sys$command dummy
X    $40$: return
X
XIf you want the present process to wait, then repeat the ``gosub out_char'
Xthree times.
X
XReturn paths may be implemented via additional logical names.  E.g., the
Xprocedure that runs Emacs under BOSS does the following.
X
XIf Emacs isn't running (boss$emacs undefined) do
X    $ define/job boss$emacs 'f$trnlnm("boss$id")'
Xand start Emacs.
X
XIf Emacs is running (boss$emacs defined) do
X    $ define/job boss$return_switch 'f$trnlnm("boss$id")'
X    $ define/job boss$switch 'f$trnlnm("boss$emacs","lnm$job")'
X    $ gosub out_char
X    $ gosub out_char
X    $ gosub out_char
X
XThe suspend-emacs function in Emacs is redefined to do the equivalent of
X    $ define/job boss$switch 'f$trnlnm("boss$return_switch","lnm$job")'
X    $ deassign/job boss$return_switch
X    ...
X
XSimilarly boss$return_stuff may be used as the string to stuff into the
Xprocess on return.  The edit procedure that is called on a TeX error may
Xset this to the current TeX command line so that on exiting from the
Xeditor the user has the input buffer prepared with the command to re-run
XTeX.  The user then has the option either of accepting the command (by
Xtyping return) or cancelling it (with C-u).
X2 Broadcasts   `032
XWhen running running under BOSS, there is the potential that you will
Xreceive multiple copies of the same broadcast.  In order to understand what
Xis going on, it is useful to distinguish 3 types of broadcast messages:
X
X(1) Broadcasts to a specific process.  E.g., the response of the system to
Xcontrol-t.  These typically are sent to one of the processes under BOSS.
X
X(2) Broadcasts to top-level processes.  E.g., mail notification.  These are
Xtypically sent to the process running BOSS and any top-level processes
Xunder BOSS.
X
X(3) Broadcasts to all terminals (including pseudo terminals).  E.g.,
Xshutdown messages.  These are typically sent to the process running BOSS and
Xall processes under BOSS.
X
XIn order to help manage broadcast messages, BOSS intercepts any broadcasts
Xsent to the process running BOSS, and rebroadcasts them to the current
Xprocess.  The rebroadcasts are of type USER16.  This allows you to shut
Xthese rebroadcast out with SET BROAD=NONE or SET BROAD=NOUSER16.  Control-s
Xalso works to defer broadcasts.  Any broadcast handlers which the current
Xprocess has active will be called to process the broadcast.
X
XIn order to avoid getting multiple copies of the same broadcast, here's what
Xyou should do:
X
XIn each subprocess under BOSS, disable type 3 broadcasts, i.e., do
X    SET BROADCAST=NOSHUTDOWN    ! plus others maybe?
X
XIn each top-level process, disable type 2 and 3 broadcasts, i.e., do
X    SET BROADCAST=(NOSHUTDOWN,NOMAIL,NOQUEUE,NOPHONE)   ! plus others?
XThis assumes that you are logged into the top-level process under the same
Xusername.  If using a different username, then you wouldn't want to disable
Xmost (all?) of the type 2 broadcasts.  For example, we would want to permit
Xmail notification.
X
XIn order to stop broadcasts to a particular process, do
X    SET BROADCAST=NONE
X
XThere are some drawbacks with way BOSS rebroadcasts messages:
X
X* There is no way of determining the original type of the broadcast was
X(MAIL, PHONE, etc.).  For this reason, BOSS rebroadcasts everything as
XUSER16.
X
X* If the rebroadcast fails, because the current process has broadcasts
Xdisabled, then there is no way of getting this information to the original
Xsender.  E.g., if you SET BROAD=NONE is a process under BOSS and someone
Xtries to PHONE you, he will not be notified that you're not getting his
Xconnection requests.
X2 New_features
X(1.7) Incompatible change: C-\ C-n x required to create a new process.  Use
XBOSS/SWITCH_CREATE to get the old behavior (where C-\ x would create process
XX if it doesn't exist).
X
X(1.7) C-\ C-t x creates a process at top level.  See topic Process_types.
X
X(1.8) BOSS accepts various qualifiers when it starts.  These control the
Xcommand character, DCL prompt string, etc.  They also can be used to tell
XBOSS to start various processes.  See topic Qualifiers.
X
X(1.9) Broadcast messages sent to the process running BOSS are trapped and
Xrebroadcast to the current process.  See topic Broadcasts.
X
X(2.0) /DELETE_CHARACTER=num added to allow interchange of some character
Xwith delete.  See topic /DELETE_CHARACTER.
X
X(2.1) Logical name BOSS$TERM looked at to determine terminal type.  See
Xtopic Terminal_types.
X
X(2.2) BOSS fixed to work with new release of pseudo TTY drivers.
X
X(2.4) /FLOW_CONTROL added to allow flow control by the top-level process.
XSee topic /FLOW_CONTROL.
X
X(2.5) /PROCESS_DEFAULT=process-type added to get top-level processes
Xcreated by default.  See topic /PROCESS_DEFAULT
X
X(2.5) C-\ C-k kills the current process.
X
X(2.5) BOSS/UW acts as a server for the multi-window Macintosh terminal
Xemulator UW.  See topic Windows.
X2 Bugs
XBOSS does single character input.  This is rather slow.  Don't expect it to
Xbe able to keep up with lots of data coming from the terminal.
X
XThe output on some terminals (Visual 550s in particular) at 9600 baud may
Xhave glitches in it.  This is because these terminals need flow control
Xenabled to operate at 9600 baud, but BOSS doesn't react quickly enough to
Xthe control-s sent by the terminal.  The solution is to run at 4800 baud or
Xslower or to use the FLOW_CONTROL qualifier to BOSS.
X
XI have seen various strange bugs occurring when using BOSS.  These are all
Xassociated with VMS running out of some quota.  The symptoms range from BOSS
Xhanging while creating a process (because LIB$SPAWN does not return) to
XSYS$LIBRARY being mis-translated by LINK.  As far as I can tell these
Xproblems occur only because of the additional stress multiple running jobs
Xputs on a users quota's and not because of BOSS problems per se.  The
Xculprits is usually BYTLM (8000 is too low, 40000 is OK).  However PGFLQUO
Xis another quota to check.
X
XOutput gets garbled when using BOSS via SET HOST (i.e., SET HOST followed by
XBOSS).  This happens when you type while output is coming to your terminal.
XThe symptom is that the lines come out in the wrong order.  It's OK to use
XSET HOST while in BOSS (i.e., BOSS followed by SET HOST).
X
XI know of one program SMP (an algebra system) that grabs the entire PGFLQUO
Xon startup.  This obviously interfers with BOSS's other processes.  The
Xsolution is to use a top-level process to run SMP (see topic Process_types).
X
XPC file transfer using the XMODEM protocol (e.g., with MACX) doesn't work
Xthrough BOSS.  Kermit seems to work fine.
X
XAttempting to attach to the process running BOSS from one of its
Xsubprocesses causes a hangage.
X
XControl-\ is used by the Switcher program on the Macintosh.  If you are
Xrunning your terminal emulation program under Switcher, you need to check
X``Disable keyboard switching' in the Options menu item in Switcher.
XAlternatively you can select a different command character with the
XCOMMAND_CHARACTER qualifier.
X2 Windows     `032
XIf you are running the UW multi-window Macintosh terminal emulator, then you
Xcan run BOSS with
X
X    $ BOSS/UW
X
Xand take advantage of a multi-window environment for communicating with the
XVAX.  (UW stands for Unix Windows.)
X
XUp to seven processes can be run.  Each process is identified by a single
Xdigit 1 thru 7.  This digit is used in the process name and in the DCL
Xprompt.  Each process is associated with its own window, named Window #1,
Xetc., although the names can be changed within UW.
X
XBefore you run BOSS/UW, the UW terminal emulator will be operating in
Xsingle-window mode.  When you start BOSS/UW, this window will close.
X
XDON'T run BOSS/UW if you're not using the UW software on the Macintosh!
X
XYou create a window and associated VAX process by selecting New in the
XWindows menu.
X
XYou can select a window by clicking on it (if a portion of it is visible),
Xtyping command-1 thru command-7 (for windows 1 thru 7), or by selecting Open
Xin the Windows menu.
X
XYou can close a window by clicking on its close box or by selecting Close in
Xthe Windows menu.  The associated VAX process remains running.  You can view
Xthe output at a later time by selecting the window.
X
XWhen you log out of a process, the window disappears.
X
XSelecting Shutdown from the File menu causes BOSS to exit and UW to return
Xto single window operation.
X
XFinally, UW also supports Option as a Meta key and high-level mouse support.
XBoth these are useful in Emacs.  See subtopic Emacs.
X
XWARNING: UW is a less capable terminal emulator than VersaTerm.  Don't
Xexpect too much of it!  It does however support multiple windows to
Xdifferent processes; the lack of this in VersaTerm is its principle defect.
X3 Configuration
XRead the MacWrite documentation on UW for more information.
X
XIn UW you can set both the default Window configuration used when a new
Xprocess is created (Configure menu) and the configuration of the active
Xwindow (Settings in the Window menu).
X
XI suggest the following default configuration:
X
X  (a) Serial Port: set Flow control on
X  (b) Protocol: set to "Original UW protocol"
X  (c) Keyboard: set "META key"
X  (d) Window Defaults: set "ANSI"`032
X      (d') Set TTY Defaults: set "Mouse Action" to "Clipboard"
X
XSave this configuration as uw.conf. (Then you don't need to repeat it each
Xtime you start up.)
X3 UW_availability
XUW is available in the <INFO-MAC> area at SUMEX.STANFORD.EDU.  It's in
XUnix shar format in files UNIX-UW-42-PART%.SHAR (PART1 thru PART8).
X
XAt a minimum you need the UW terminal emulator and (if you have Emacs
Xusers) MACMOUSE.EL.
X
XAt PPL, the terminal emulator and documentation are in
X    MAC$:[NEW]UNIX-UW-42.HQX
X(in BinHex format).  MACMOUSE.EL is in the default library area for Emacs,
XEMACS_LIBRARY:[LISP].
X3 Emacs
XIn order to run Gnu Emacs under UW, you need to set you Emacs terminal
Xtype to "uw", with e.g.,
X    $ setup emacs uw
X
XThe option key acts as a Meta-shift.  Thus Option-F is the same as ESC F
X(i.e., goes forward a word).
X
XYou should set UW to transmit the location of Mouse clicks to the VAX (in
XConfigure TTY under Settings in the Window menu).  This gets the mouse
Xclick transmitted to the VAX for this window only.  To get Emacs to
Xunderstand what UW sends, insert
X
X    (global-set-key "\em" 'move-mac-cursor)
X    (autoload 'move-mac-cursor "macmouse" nil t)
X
Xinto your Emacs init file (sys$login:.emacs).
X
XHere's what happens with mouse clicks:
X
X Up or down mouse button in a window selects that window
X
X A scroll bar/thumbing area for each window with the following features:
X      the mode lines are horizontal scroll bars
X          (running from rightmost column to under leftmost column)
X      the unused right window bar and the dividing lines between
X          windows are vertical scroll bars
X          (running from top of window THRU modeline
X  for vertical scroll bars:
X        click at line 1 does previous page
X        click at last line does next page
X        click anywhere else "thumbs" to the relative portion of the buffer.
X        shift-click at line 1 scrolls one line down
X        shift-click at last line scrolls one line up
X        shift-click elsewhere moves line to top of window
X        option-shift-click elsewhere moves line to bottom of window
X  for horizontal scroll bars:
X      click at column 1 does scroll right one window width
X      click at last column does scroll left one window width
X      click anywhere else moves to that "percent" of the buffer width
X      shift-click at column 1 scrolls one column right
X      shift-click at last column scrolls one column left
X      shift-click elsewhere moves column to right of window
X      option-shift-click elsewhere moves column to left of window
X
XThere is also basic positioning and kill-buffer support:
X        click in a buffer moves dot there and selects that buffer
X        drag copies the dragged region to the kill buffer
X        shift-drag deletes the dragged region to the kill buffer
X
X  It is possible to use the scrolling and thumbing area to make the region
X  larger than a single screen; just click, scroll, release. Make sure
X  that the last scroll is just a down event; the up must be in the buffer.
X  The last mouse position is remembered for each different buffer (not
X  window), and thus you can start a drag in one buffer, select another,
X  go back to the first buffer, etc.
X
X        option-click yanks from the kill buffer
X        option-shift-click similarly yanks from a named buffer.
X3 Other_features
XMost of the capabilities of BOSS in its regular mode are available.
XHowever, there are some differences in BOSS/UW
X
XOnly 7 processes can be run (instead of 8).
X
XThe processes are named 1 thru 7 not A thru Z.
X
XBOSS/FLOW_CONTROL is used to be set (independent of what you actually ask
Xfor).  Note that under UW the use of flow control by the Macintosh
Xhardware to prevent data overruns of the Mac's buffers is carried out
Xindependently of your attempts to control output with C-s and C-q.  In
Xparticular, C-s and C-q can be used for their regular functions in Emacs,
Xeven though the Macintosh and the VAX are still using flow control.
X
XBOSS/UW sets the default output flag to p (instead of b).  This allows
Xoutput from all processes to be sent to their respective windows.  This
Xdefault be overridden with DEFAULT_OUTPUT_FLAG qualifier.  And of course
Xyou can use C-\ C-b, etc., to set this flag on a per-process basis.
X
XBOSS/NOCOMMAND_CHARACTER can be used to indicate that no command character
Xis to be used.  (Thus all characters you type get seen by your VAX
Xprocess.)  By default, C-\ is still used as a command character.
X
XBOSS doesn't print "[Switch to process 5...]" messages, since the
Xswitching is obvious from the arrangement of windows.  Other messages
X(e.g., the response to C-\ ? should appear in the active window).
X
XC-\ 3 will tell BOSS to switch to process 3, but UW won't bring that
Xwindow to the front.  The same comment applies to process-initiated
Xswitches (via the BOSS$SWITCH logical name.  You should probably use one
Xof the other methods for switching processes (clicking on the window,
Xcommand-3, etc.)
X
XBOSS/PROCESS_DEFAULT=TOP will cause BOSS's processes to be top-level
Xprocesses.  Thus when you select New in the Windows menu, you will see a
XUsername: prompt.
X
XYou can create processes with C-\ C-n 4 or C-\ C-t 4 (for subprocesses and
Xtop-level processes).  This allows you to create either type of process,
Xwhile selecting New in the Windows menu produces only a process of the
Xdefault type (governed by BOSS/PROCESS_DEFAULT).
X
XBOSS/START=(1,2)/STUFF=Emacs will create processes 1 and 2 and start Emacs
Xin process 1.  This is just the same as BOSS behavior in its regular mode.
X3 Misfeatures
XOccasionally BOSS loses track of what UW thinks is the active window.
XYour typed input will then be sent to the wrong process.  This is
Xcorrected by switching to some other window (e.g., by clicking on it) and
Xthen switching back to the original window.
X
XOther than the fact that UW supports multiple windows and more intelligent
Xmouse behavior with Emacs, UW is a much worse terminal emulator than
XVersaTerm.  In particular:
X
X* It doesn't save what scrolls off the screen.
X
X* I haven't been able to get EVE or LSE to work reasonably.  I presume
X  there's some way of telling these programs what UW can do (via
X  TERMTABLE);  I just haven't managed to get it to work right.  Emacs
X  works just fine though.
X
X* Keypad is not supported.
X
X* Arrow keys don't work.
X
X* UW implements a Tektronix 4010 emulation, but it's a pretty miserable
X  affair.
X
X* Can't print.
X
X* Can't do file transfers.
X
XI've only implemented the most basic level of UW service under BOSS.  The
Xnext level allows windows to be retitled from the VAX, as well as setting
Xmany of the other attributes of windows.  This will most likely not get
Ximplemented.
X
XThe main reason for implementing the UW features in BOSS was to show that
Xthe Macintosh can provide a multi-window enviroment for the VAXes.  Now we
Xhave to get Lonnie Abelbeck to modify VersaTerm to support the UW
Xprotocol...
X2 Acknowledgements
XBOSS was written by Charles Karney based on the PHOTO program written by
XAsbed Bedrossian of USC.  It utilizes the Pseudo TTY package of Dale Moore
Xof CMU and Kevin Carosso of Network Research Co.
X
XUW, the multi-window Macintosh terminal emulator was written by John D.
XBruner of LLNL.  The Emacs mouse support was written by Gregory S. Lauer of
XBBN.
X
XBugs, questions, etc. to
X    Charles Karney
X    Plasma Physics Laboratory   Phone:   +1 609 243 2607
X    Princeton University        MFEnet:  Karney@PPC.MFEnet
X    PO Box 451                  ARPAnet: Karney%PPC.MFEnet@NMFECC.ARPA
X    Princeton, NJ 08543-0451    Bitnet:  Karney%PPC.MFEnet@ANLVMS.Bitnet
$ GOSUB UNPACK_FILE
$ FILE_IS = "BOSS.C"
$ CHECKSUM_IS = 108618440
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X/* BOSS interactive job controller.
XCopyright (c) 1987, 1988 by Charles Karney.  All rights reserved.
X
XWritten by
X    Charles Karney
X    Plasma Physics Laboratory   Phone:   609/243-2607
X    Princeton University        MFENet:  Karney@PPC.MFENET
X    PO Box 451                  ARPANet: Karney%PPC.MFENET@NMFECC.ARPA
X    Princeton, NJ 08543-0451    Bitnet:  Karney%PPC.MFENET@ANLVMS.BITNET
X
XBased on the PHOTO program of Asbed Bedrossian (USC, asbed@oberon.usc.edu).
X
XIt utilizes the Pseudo TTY package of Dale Moore (CMU,
XDale.Moore@PS1.CS.CMU.EDU) and Kevin Carosso (Network Research Co.,
Xkvc@nrc.com, kvc@ymir.bitnet).
X
XThe UW terminal emulator was written by John Bruner (LLNL,
Xjbd@mordor.s1.gov).  He also defined the UW protocol.
X
XDESCRIPTION:
X
XBOSS lets you create up to 8 processes on a VAX/VMS system.  Each process
Xis identified by a single letter (A thru Z).  At most one of these
Xprocesses is ``current'.  What you type is sent to that process, and output
Xfrom that process is sent to your terminal.  A process which is not current
Xcan run but cannot do output.  (Output is saved until you make that process
Xcurrent.)  You usually switch between processes by typing control-\
Xfollowed by the identifying letter.
X
XYou can run any program under BOSS.  For example, you might
X    run Emacs or EVE                   in process E
X    SET HOST to another machine        in process H
X    do a FORTRAN compilation           in process F
-+-+-+-+-+ End of part 2 +-+-+-+-+-
