From:	CSBVAX::MRGATE!KARNEY%PPC.MFENET@NMFECC.ARPA@SMTP 29-MAR-1988 17:42
To:	ARISIA::EVERHART
Subj:	BOSS 1/2


Received: from ppc.mfenet by ccc.mfenet with Tell via MfeNet ;
	Fri, 25 Mar 88 09:42:52 PST
Date:	  Fri, 25 Mar 88 09:42:53 PST
From:     KARNEY%PPC.MFENET@NMFECC.ARPA
Message-Id: <880325094253.2040021e@NMFECC.ARPA>
Subject:   BOSS 1/2
To:       EVERHART%ARISIA.DECNET@GE-CRD.ARPA
Comment: From KARNEY@PPC.MFENET on 25-MAR-1988 12:43:06.62 EST

....................... Cut between dotted lines and save ......................
$!.............................................................................
$! VAX/VMS archive file created by VMS_SHAR V-5.03 07-Oct-1987
$! which was written by Michael Bednarek (U3369429@ucsvc.dn.mu.oz.au)
$! To unpack, simply save and execute (@) this file.
$!
$! This archive was created by KARNEY
$! on Tuesday 22-MAR-1988 16:48:24.32
$!
$! ATTENTION: To keep each article below 25600 bytes, this program
$! has been transmitted in 2 parts.
$! You should concatenate ALL parts to ONE file and execute (@) that file.
$!
$! It contains the following 2 files:
$! BOSS.HLP BOSS.C
$!=============================================================================
$ Set Symbol/Scope=(NoLocal,NoGlobal)
$ Version=F$GetSYI("VERSION") ! See what VMS version we have here:
$ If Version.ges."V4.4" then goto Version_OK
$ Write SYS$Output "Sorry, you are running VMS ",Version, -
                ", but this procedure requires V4.4 or higher."
$ Exit 44
$Version_OK: CR[0,8]=13
$ Pass_or_Failed="failed!,passed."
$ Goto Start
$Convert_File:
$ Read/Time_Out=0/Error=No_Error1/Prompt="creating ''File_is'" SYS$Command ddd
$No_Error1: Define/User_Mode SYS$Output NL:
$ Edit/TPU/NoSection/NoDisplay/Command=SYS$Input/Output='File_is' -
        VMS_SHAR_DUMMY.DUMMY
f:=Get_Info(Command_Line,"File_Name");b:=Create_Buffer("",f);
o:=Get_Info(Command_Line,"Output_File");Set(Output_File,b,o);
Position(Beginning_of(b));Loop x:=Erase_Character(1);Loop ExitIf x<>"V";
Move_Vertical(1);x:=Erase_Character(1);Append_Line;
Move_Horizontal(-Current_Offset);EndLoop;Move_Vertical(1);
ExitIf Mark(None)=End_of(b) EndLoop;Position(Beginning_of(b));Loop
x:=Search("`",Forward,Exact);ExitIf x=0;Position(x);Erase_Character(1);
If Current_Character='`' then Move_Horizontal(1);else
Copy_Text(ASCII(INT(Erase_Character(3))));EndIf;EndLoop;Exit;
$ Delete VMS_SHAR_DUMMY.DUMMY;*
$ Checksum 'File_is
$ Success=F$Element(Check_Sum_is.eq.CHECKSUM$CHECKSUM,",",Pass_or_Failed)+CR
$ Read/Time_Out=0/Error=No_Error2/Prompt=" CHECKSUM ''Success'" SYS$Command ddd
$No_Error2: Return
$Start:
$ File_is="BOSS.HLP"
$ Check_Sum_is=136981575
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X1 BOSS
XBOSS is an interactive job controller.  It lets you run several interactive
Xjobs simultaneously.  Before running BOSS put
X
X    $ boss :== $usr:[utility]boss
X
Xinto your login.com file.  In order to run BOSS type
X
X    $ boss
X
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 Hughes Aircraft Co.
X
XBugs, questions, etc. to Charles Karney (Karney@PPC).
X2 Description
XBOSS lets you create up to 8 processes each of which is identified by a
Xsingle letter (A thru Z).  This letter is used in the process name and in
Xthe DCL prompt.  At most one of these processes is ``current'.  This means
Xthat what you type is sent to that process, and output from that process is
Xsent to your terminal.  A process which is not current can run but normally
Xcannot do output.  (What happens to the output is governed by the output
Xflag for a particular process.  See subtopic Output_Flags.)   You usually
Xswitch between processes by typing control-\ followed by the identifying
Xletter.  It is also possible to have have of your processes initiate the
Xswitch.  (See subtopic Communicating.)
X
XYou can run any program under BOSS.  For example, you might
X    run Emacs or EVE                   in process E
X    SET HOST to the EPX                in process H
X    run NETTY to the B machine         in process B
X    do a FORTRAN compilation           in process F
X    execute DCL commands               in process D
X    talk to your colleague using PHONE in process P
Xand so on.
X
XOf course, you would normally not need to run so many processes.  (Indeed
Xyour subprocess quota may only let you run 5 processes.)  When you are
Xthrough with a process, you should log out of it (with ``logout') and switch
Xback to some other process.
X
XBOSS makes no attempt to keep track of what is on your screen.  Usually when
Xswitching to a process which manages the screen in an advanced manner, you
Xshould issue a command to the program to get it to re-draw the screen.
X(This is control-w for EVE, PHONE, SPELL; control-l for Emacs.)
X
XBOSS uses the VT100 escape sequences for clearing the screen, etc.  However
Xit should still be useable on non-VT100-compatible terminals.
X2 Commands
XUsually, all commands to BOSS begin with the C-\ (control-\).  The exception
Xis when there is no current process (i.e., initially and immediately after
Xlogging out of a process).  In that case the C-\ is optional.
X
XThe commands are:
X
X    C-h (or BS) Print command summary
X    C-z         Quit (asking confirmation if there are processes)
X    a thru z    Switch to a particular process (starting it if necessary)
X    A thru Z     the same except clear the screen first
X    C-b         Buffer output for this process
X    C-o         Discard output for this process
X    C-p         Print output from this process
X    C-s         Stop output from this process
X    ?           List processes and output flags
X                 (* means current, +/- means waiting for output)
X    C-\         Send a real C-\ to the current process
X    DEL         Do nothing
X    other       Sound the bell on the terminal
X2 Output_Flags
XEach process has an output flag which may be set by C-\ followed by one of
XC-b, C-o, C-p, or C-s (this sets the flag to b, o, p, or s, resp.).  This
Xflag governs what BOSS does to the output of a process which is not current.
X(The current process always gets its output displayed immediately.)  The
Xmeanings of these settings are
X
X b  Buffer output for this process.  Output is saved in a 4k buffer.  Buffer
X    is output when the process becomes current.  The process hangs when this
X    buffer fills.  This is useful for running a program which dribbles
X    output which you do not want to lose.  In the process list (obtained by
X    C-\ ?), a - indicates that there is output ready to be displayed, and a
X    + indicates that the buffer is full (and the process is probably
X    hanging).
X
X o  Discard output for this process.  Only the most recent write will by
X    output when the process becomes current.  This is useful for running a
X    program which periodically outputs some straightforward information such
X    as ``Processing record 103', where all you care about is the most recent
X    output.  In the process list, + means that there is output available
X    (but the process is continuing to run).
X
X p  Print output from this process.  Output is output to the terminal
X    regardless of whether this is the current process or not.  This is
X    useful if you need to be informed when a program completes.  Also it can
X    be used to display status information periodically on your screen (see
X    subtopic Examples).
X
X s  Stop output from this process.  The process can do a single write which
X    will be accepted and saved by BOSS.  The process will then hang when it
X    attempts to do the next write.  In the process list + means that there
X    is output available (and the process is probably hanging).
X
XThe default output flag is s.  The default can be changed by issuing one of
Xthe flag setting commands when there is no current process (i.e.,
Ximmediately after starting BOSS or after logging out of a process).
X
XThe best setting of the output flag very much depends on your application.
XIf one process is attempting to act synchronously with another, it may be
Xnecessary to have its output flag set to s.  (This is the case with Emacs.
XAfter Emacs switches you to another process, it is important that it hangs,
Xso that it can read in the new file when it is invoked from another process
Xwith ``$ emacs <file>'.)  Otherwise, you might find the best setting to be b.
XA potential problem with this 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).  (Setting your terminal to use flow control won't help.)
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 processes under it can communicate via logical names.  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.
XThus a DCL procedure 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
X
XBOSS$STUFF (in job table); whenever a BOSS makes a process initiated
Xswitch.  It stuffs the definition of BOSS$STUFF into the input stream of
Xthe process being 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.  (Of course, the process will only wait if the output flag is
Xs.)
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 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.
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
XBOSS hanging while creating a process (because LIB$SPAWN does not return)
Xto SYS$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
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 do a re-entrant SET HOST to run SMP.
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
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.
X2 Unfeatures
XThe following features are not implemented but are possible future
Xenhancements.
X
X* Log files.
X* Ability to kill particular processes.
X* Ability to ATTACH to non-BOSS processes.  I haven't managed to make this
X  work yet.
X* Configurable for other terminals.
X* Allow default directory to propagate to other processes.
$ GoSub Convert_File
$ Goto Part2
