home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / bg / bgscrip1.doc < prev    next >
Encoding:
Text File  |  1994-09-02  |  4.9 KB  |  103 lines

  1. To:    ZCPR3 users with BackGrounder ii
  2.  
  3. From:    Bridger Mitchell and Jay Sage
  4.  
  5. Subject: BGii customization scripts
  6.  
  7. Date:    4/17/87
  8.  
  9. ---------
  10.  
  11. Jay has contributed some excellent Z-system alias scripts for automating
  12.  
  13. the BGii startup and shutdown operations.  In addition, he shows how
  14.  
  15. to change the names of BGii built-in commands.  Useful in their own
  16.  
  17. right, these scripts are also a model of a well-designed system
  18.  
  19. environment.
  20.  
  21.  
  22.  
  23. You will need to modify the scripts to reflect your own system's
  24.  
  25. directory names and custom files.  The FIXBG addresses will vary,
  26.  
  27. depending on BGii version and the disk parameters of your swap drive.
  28.  
  29. And BGHIST and BGERRH require BGHIST.OCP.
  30.  
  31.  
  32.  
  33. ---------------------------------
  34.  
  35.  
  36.  
  37.      Here are the ARUNZ (renamed to CMDRUN.COM) scripts I use for
  38.  
  39. the various BG-related operations.
  40.  
  41.  
  42.  
  43. 1. script BG
  44.  
  45.  
  46.  
  47.    This script is used to engage BGii.  It goes to the required directory,
  48.  
  49.    clears the shell stack if necessary because BGii will invoke BGHIST, and
  50.  
  51.    then returns to the directory from which this alias was invoked.  The
  52.  
  53.    explicit directory references before some of the commands just speeds
  54.  
  55.    things up a little.
  56.  
  57.  
  58.  
  59.         SYS:                            ; Go to directory with LOADBG
  60.  
  61.         IF SH                           ; If a shell is currently running
  62.  
  63.         SYS:SHCTRL C                    ; Clear shell stack
  64.  
  65.         FI
  66.  
  67.         SYS:LOADBG                      ; Invoke BG (runs alias STARTBG)
  68.  
  69.         $D0$U0:                         ; Return to original directory
  70.  
  71.  
  72.  
  73.  
  74.  
  75. 2. script STARTBG
  76.  
  77.  
  78.  
  79.    This script is the BGii startup alias.
  80.  
  81.  
  82.  
  83.         TIME ON                         ; Turn on time display in prompt
  84.  
  85.         KEYS GLOBAL                     ; Load my global key definitions
  86.  
  87.         OCP BGHIST                      ; Load OCP with BGHIST and BGERRH
  88.  
  89.          FIXBG (leading space)          ; Script to patch BG swap file
  90.  
  91.         BGHIST                          ; Load BG history shell
  92.  
  93.         BGERRH                          ; Engage BG error handler
  94.  
  95.         CLS                             ; Clear the screen
  96.  
  97.  
  98.  
  99.  
  100.  
  101. 3. script FIXBG
  102.  
  103.  
  104.  
  105.    This script makes the changes to the BG swap file to rename some of the
  106.  
  107.    resident commands.  It could be a part of the main STARTBG script, but I
  108.  
  109.    prefer to keep this separate.  I change the ECHO command to ECKO so that
  110.  
  111.    my transient ECHO.COM, which runs at 8000H, will be used instead.  I also
  112.  
  113.    shorten PEEK to P and RESET to R.
  114.  
  115.  
  116.  
  117.         SYS:DU GF,+9,CA53 K,W,+,CA5A    ,CA7A     ,W,X
  118.  
  119.  
  120.  
  121.    Here are the operations performed by each of the disk utility commands:
  122.  
  123.  
  124.  
  125.         GF                      ; Go to disk group 000F (the group
  126.  
  127.                                 ; ..containing the command dispatch table)
  128.  
  129.         +9                      ; Advance 9 records to the one containing
  130.  
  131.                                 ; ..the entry for the ECHO command
  132.  
  133.         CA53 K                  ; Change-Ascii at byte 53H of the record,
  134.  
  135.                                 ; ..putting in a 'K' in place of the 'H'
  136.  
  137.         W                       ; Write the changed record out to the disk
  138.  
  139.         +                       ; Advance to the next record on the disk
  140.  
  141.         CA5A....                ; Another Change-Ascii (note four spaces,
  142.  
  143.                                 ; ..one to separate command from argument
  144.  
  145.                                 ; ..and three to replace 'EEK' in 'PEEK'
  146.  
  147.         CA7A.....               ; Another change in same record (five spaces
  148.  
  149.                                 ; ..in all, four to replace 'ESET' in
  150.  
  151.                                 ; ..'RESET')
  152.  
  153.         W                       ; Write the changed record out to the disk
  154.  
  155.         X                       ; Exit from DU3 disk utility
  156.  
  157.  
  158.  
  159.    The actual records containg the command dispatch table varies with each
  160.  
  161. BGii release.  What has confused me a bit lately is the appearance in the
  162.  
  163. swap file of two command lists that each look like a dispatch table.  Only
  164.  
  165. one is, and the real table has to be determined by trial and error.
  166.  
  167.  
  168.  
  169.  
  170.  
  171. 4. script BGOFF=OFF (two alternative names for same alias)
  172.  
  173.  
  174.  
  175.    This script exits from BGii and reestablishes the ZCPR system.  Since
  176.  
  177.    my configuration of BGii uses the RCP space, I have to restore the
  178.  
  179.    environment descriptor and the RCP code.
  180.  
  181.  
  182.  
  183.         IF BG                   ; If BG is currently running
  184.  
  185.         BG OFF                  ; BGii command to exit
  186.  
  187.         SYS:SHCTRL C            ; Clear shell stack (of BGHIST)
  188.  
  189.         SYS:LDR SYS.ENV,SYS.RCP ; Restore environment and RCP
  190.  
  191.         SYS:ERRSET SYS:VERROR   ; Set up ZCPR error handler
  192.  
  193.         ELSE                    ; Else if BG not running
  194.  
  195.         ECHO BG NOT RUNNING     ; Tell user
  196.  
  197.         FI
  198.  
  199.  
  200.  
  201.  
  202.  
  203. ---------------------------------
  204.  
  205.