1 11/28/88  load_mowse
  2 
  3 Syntax as a command:  load_mowse {filename}
  4 
  5 
  6 Function:
  7 
  8 Transfers the file mowse.com, exitmows.com, bft.com, bft_load.com, or
  9 wsterm.exe as specified by the argument "filename" to an IBM PC or
 10 compatible.  This facility is used to install MOWSE and BFT on the PC
 11 only if no other transfer facility exists which can transfer binary
 12 executable files.  This code for the program must be entered on the
 13 PC, as described below.
 14 
 15 The files (as listed above) are found in
 16 >library_dir_dir>unbundled>object>pc_mowse_executable.archive.
 17 
 18 
 19 Arguments:
 20 filename
 21      is the name of the file to be transfered.  It must be mowse.com,
 22      exitmows.com, bft.com, bft_load.com, or wsterm.exe.
 23 
 24 
 25 Notes:
 26 
 27 In order to use load_mowse it is necessary to type in a Basic program
 28 on the PC.  This program is approximately 100 lines long.  It must be
 29 typed into the Basic subsystem on the PC.  The code for the program is
 30 contained at the end of this file.
 31 
 32 
 33 Notes on use:
 34 
 35    1) type in: basic /c:10000
 36    2) type in program (code supplied) [SAVE -optional]
 37    3) press the <RUN> key, or type: run
 38    4) login to Multics
 39    5) enter the command: load_mowse {filename}
 40          where filename is on of the files specified above
 41    6) repeat 5 until all necessary files are transferred
 42    7) upon completion of transfer, logout from Multics
 43    8) press the <ESC> key
 44    9) type in: SYSTEM
 45 
 46 
 47 The size of the communication buffer should be increased with the
 48 '/c:'command when Basic is first invoked (ie.  basic /c:10000).  This
 49 will help prevent communication buffer overflow.
 50 
 51 The comments with the program do not have to be typed in.  Once
 52 entered, the program can be saved as a Basic file, but this is not
 53 necessary.  It is useful only for transferring MOWSE and BFT, and BFT
 54 can then be used to transfer any other desired files.  If you want to
 55 save it you must do so before you enter 'system' at the Basic command
 56 level or the program will be lost.  Typing 'save filename' will do
 57 this.
 58 
 59 
 60 Once the program is entered you use the <RUN> function key or type
 61 'run' to start it working.  You then have to login to your Multics
 62 account.  The PC will act as a Multics terminal until you type
 63 'load_mowse {filename}', where {filename} is mowse.com, exitmows.com,
 64 bft.com, bft_load.com, or wsterm.exe.  The named file will then be
 65 transferred to the PC.  After the first file is transferred, use the
 66 load_mowse command to transfer the second file, and so on.
 67 
 68 
 69 There is no way to recover from transmission errors.  This means that
 70 if there are ANY errors in transmitting the file, you have to
 71 retransmit the entire file.  There are two general ways that the
 72 program can fail.
 73 
 74 If the PC receives anything other than a character or the check_sum
 75 for a particular packet is different from what the packet sum is, then
 76 the PC will tell Multics to stop sending data.  This will return you
 77 to Multics command level and you can start the transmission again.
 78 
 79 
 80 Alternately, the PC could experience problems such as buffer overflow
 81 or a bad file name when attempting to open the file for saving data
 82 etc.  In these cases you are returned to the PC basic level.  You then
 83 have to run the basic program again and re-log in to Multics.  Note:
 84 you do not need to re-type the program in this case, just issue the
 85 run command again.
 86 
 87 When load_mowse finishes sending a file, and there are no errors, you
 88 are returned to Multics command level.
 89 
 90 To exit Multics you logout normally.  This places you back in the PC
 91 Basic program which will give you the Multics login banner.  To exit
 92 the Basic program you hit the ESC key on the keyboard.  This returns
 93 you to Basic on the PC.
 94 
 95 
 96 Notes on load_mowse code:
 97 
 98 100 REM   **********************************************************
 99 110 REM   *
100 120 REM   * Copyright, (c) Honeywell Information Systems Inc., 1986
101 130 REM   * Copyright, (c) 1986 by Massachusetts Institute of
102 140 REM   *     Technology and Honeywell Information Systems, Inc.
103 150 REM   *
104 160 REM   **********************************************************
105 
106 
107 170 REM             TERMINAL EMULATOR AND TRANSFER PROTOCOL
108 180 SCREEN 0,0: WIDTH 80
109 190 KEY OFF: CLS: CLOSE:            'FUNC KEYS OFF, CLEAR SCRN
110 200 COLOR 2                         'PRETTY COLOR
111 210 LOCATE 1,1,1
112 220 OPEN "COM1: 9600,E,7,1,CS,DS" AS #1 'OPEN COM LINE TO MULTICS
113 230 PRINT #1, "loadmowse 1.0"
114 240 B$ = INKEY$                     'GET INPUT FROM KEYBOARD
115 250 IF B$ = "" THEN 280             'NO KEYBOARD INPUT, CHECK MULTICS
116 260 IF ASC(B$) = 27 THEN 380        'IF ESC KEY THEN QUIT
117 270 PRINT #1, B$;                   'OTHERWISE SHIP KEY TO MULTICS
118 280 IF LOC(1) < 1 THEN 240          'NO MULTICS INPUT,CHECK KEYBOARD
119 
120 
121 300 A$ = INPUT$(LOC(1), #1)                  'ELSE GET BUFFER INPUT
122 301 C$ = C$ + A$                             'CATENATE TO START TEST BUFFER
123 302 J = INSTR(C$,"s")                        'LOOK FOR THE s IN srtr
124 303 IF J = 0 THEN 315                        'NO, THEN LOOK LATER
125 304 IF LEN(C$) - J < 3 THEN 320              'NOT ENOUGH AFTER s FOR strt
126 310 IF INSTR(C$,"strt") THEN Z=1: GOTO 320   'strt IS THERE SO SET START FLAG
127 315 C$ = ""                                  'RESET START TEST BUFFER
128 
129 
130 320 IF X > 0 THEN MID$(A$, X)=CHR$(255) '       EXTRA
131 330 X = INSTR(A$, CHR$(10))             '            LINE
132 340 IF X > 0 THEN 320                   '                FEEDS
133 350 IF Z > 0 THEN GOSUB 500: GOTO 280
134 360 PRINT A$;                       'PRINT
135 370 GOTO 240                        'RECHECK KEYBOARD
136 380 CLOSE                           'CLOSE ALL FILES
137 390 CLS: COLOR 2                    'CLEAR SCREEN, PRETTY COLOR
138 400 END
139 500 PRINT #1, "y"                   'ALLOW MULTICS TO CONTINUE
140 510 FOR I = 1 TO 5: C$ = " ": WHILE C$ <> "*": C$ = INPUT$(1,#1): WEND: NEXT I
141                                     'DISCARD 5 * PRECEEDING FILENAME
142 520 WHILE LOC(1) < 12: WEND: FOR I = 1 TO 100: NEXT I: N$ = INPUT$(LOC(1),#1) 'GET FILENAME FROM MULTICS
143 530 OPEN N$ AS #2 LEN = 1           'OPEN FILE ON PC
144 
145 
146 540 FIELD #2, 1 AS BITS$
147 550 CLS:
148 560 Z = 1
149 570 WHILE X = 0                     'RECEIVE UNTIL EOF
150 580 PRINT #1, "y"                   'ALLOW MULTICS TO CONTINUE
151 590 S = 0
152 600 FOR I = 1 TO 4
153 610 WHILE LOC(1) < 2: WEND          'WAIT FOR PACKET
154 620 B1$ = INPUT$(1, #1): IF B1$ < CHR$(32) THEN 620
155 630 B2$ = INPUT$(1, #1): IF B2$ < CHR$(32) THEN 630
156 640 B1 = ASC(B1$): S = S + B1       'GET ASCII VALUE FOR...
157 650 B2 = ASC(B2$): S = S + B2       '...EACH CHARACTER
158 660 IF B1 = 92 AND B2 = 55 THEN X = 0: GOTO 830              'EOF SIGNAL
159 670 IF B1 < 32 OR B2 < 32 THEN X = 1: PRINT B1, B2: GOTO 830 'ERR SIGNAL
160 680 IF B1 > 48 OR B2 > 48 THEN X = 1: PRINT B1, B2: GOTO 830 'ERR SIGNAL
161 
162 
163 690 B1 = B1 - 32                    'SUBTRACT CHAR VALUE FROM...
164 700 B2 = B2 - 32                    '...EACH BYTE
165 710 B1 = B1 * 16                    'SHIFT HIGH ORDER BYTE LEFT
166 720 B3 = B1 + B2                    'COMBINE TO FORM ORIGINAL
167 730 LSET BITS$ = MKI$(B3)           'MAKE PC "SEE" BITS
168 740 PUT #2                          'PRINT VALUE TO PC FILE
169 750 NEXT I
170 760 LOCATE 25, 1: PRINT N$": packets received: "Z: Z = Z + 1
171 770 PRINT #1, "y"                   'ALLOW MULTICS TO CONTINUE
172 780 Q1$ = INPUT$(1, #1): IF Q1$ < CHR$(30) THEN 780  'READ CHECKSUM FROM LINE
173 790 Q1 = ASC(Q1$)
174 800 S2 = ((S - INT(S/30) * 30) + 30) * 2  'FORMAT CALCULATED CHECKSUM
175 810 IF Q1 <> S2 THEN X = 1: GOTO 830      'IF CHECKSUMS DON'T MATCH-ERROR
176 
177 
178 820 WEND
179 830 CLOSE #2                                   'CLOSE PC FILE
180 840 IF X = 0 THEN PRINT "transfer finished" ELSE PRINT "error in transmitting": PRINT #1, "q"
181 860 A$ = ""                                    'CLEAR INPUT STORAGE
182 870 IF LOC(1) > 0 THEN C$ = INPUT$(LOC(1), #1) 'CLEAR COMM LINE
183 880 RETURN
184 
185 
186 Notes on baud rate:
187 When entering line 230 of the program, the OPEN statement, you must
188 enter the correct baud rate for the communication line that you are
189 using.  This is the first number in the code line given (ie.  9600).
190 This number can range from 300 to 9600 depending on the line.
191 
192 
193 Notes on filename length:
194 When entering line 520, the code awaits for 12 characters of input
195 before extracting the filename from the communications buffer.  This
196 may not always be the case (12 character filenames).  It may be
197 necessary to adjust the "12" in the "WHILE LOC(1) < 12" statement to
198 be the actual length of the filename.  For instance, set it to "7" for
199 transfer of "bft.com".