Notes on MS Kermit 2.29B 19 Feb 1987 This most recent version of MS Kermit 2.29 has support for VT102 printer commands, Long packets, and Scripts. Additionally, it has corrections to most problems known at this time. A new kind of MS Kermit, MSTCLO.BOO, is available for near clones of IBM PC's but whose serial port hardware is not similar. Here is a description from the originator, Glenn Everhart of RCA Labs: This module is derived from MSXIBM.ASM and is intended for IBM PC near-clones that differ in their serial I/O but emulate the IBM BIOS. Such machines include Seequa Chameleon, DG/1, and others. The idea is to use the VT100 emulation (which will work) but use BIOS for all serial I/O. This is not interrupt driven and so will (unfortunately) not be able to keep up well at high baud rates. Nevertheless, it will be far better than the old Seequa version which didn't emulate anything. This version will also work on IBM PCs that need to use something other than the internal asynchronous adapter for communications, like a Token Ring asynchronous communication server via NETBIOS. BUG FIXES AND INTERNAL IMPROVEMENTS: Two important problems with MS Kermit 2.29 (no letter) were an incompatibility with Hayes internal modems, and related modems: the modem would hangup the phone when a file transfer completed or Connect mode were exited, and secondly, null characters could be sent at the start of a file transfer or when Connect mode was entered. It seems that several mainframes regard null characters as important signals rather than as fillers. We have tested this version with a real Hayes 1200B modem with satisfactory results. There were numerous small problems throughout MS Kermit, as might be expected, and those identified to date have been addressed. One important one was the serial port was left active if one PUSHed to DOS while in Connect mode. Serious DOS errors are trapped by Kermit to prevent Kermit from being aborted with the serial port interrupt alive and with a couple of other items redirected to Kermit itself. The most common such error is "Drive Not Ready." Previously, these conditions would invoke the normal DOS Critical Error proc which would request "Abort, Retry, Ignore?" and would abort the program if Abort were chosen. Now, Kermit exercises a fourth option, Fail the Operation, when these errors occur. Procedures spawning a second copy of COMMAND.COM (DIR, etc) still can yield the A/R/I message but it is harmless in this case. However, if such a message arises while Kermit is in Server mode a human must still type the answer locally. The implementation replaces the normal DOS Control-Break (^C) and Critical Error handlers with Kermit's own handlers and restores the originals when Kermit exits. Numerous small bugs concerning negotiated parameters (8 bit quoting, Block check types, etc) have been fixed; these mainly concerned Server mode operations. The terminal emulator no longer responds to the answer-back msg request; there is no answer-back message in the emulator. Screen handling has been improved internally, but it still has a few glitches. While in Connect mode 8 bit received data will be passed through to the terminal processor if the Parity type is None. If Debugging is ON then characters with their high bit set will be displayed as a tilde and then a code for the lower 7 bits; i.e., 10000001b is displayed as ~^A. Note: due to network quirks these characters may be mistranslated; the tilde is the funny wiggle character above the accent mark and the control symbol is a caret. ADDITION TO SET DISPLAY COMMAND: Set Display Regular | Serial | Quiet | 7-bit | 8-bit The keywords 7-bit and 8-bit have been added to control displays of characters in non-file transfer modes. 7-bit is the default and 8-bit becomes meaningless when parity is other than None. The Set Display command accepts two keywords in one command, processed left to right. ADDITION TO SET PROMPT COMMAND: Special characters, such as escape, can be included in text of Kermit's prompt by specifying them as octal numbers in the form \ooo where o is an octal digit. Escape itself is \33. To return to Kermit's default prompt give the Set Prompt command without text. The replacement prompt can be up to 80 characters long. ANSI PRINTER SUPPORT: For VT102 emulator in IBM and NEC AP3 versions. New escape sequences: ESC [ i Print the entire screen (24 user lines) or just the text in the scrolling region, depending on ESC [ ? 19 h/l below. ESC [ 0 i is an equivalent command. ESC [ ? 1 i Print the line containing the cursor. ESC [ 4 i Disable Controller print. Cursor returns to its position when ESC [ 5 i was encountered earlier. ESC [ ? 4 i Disable Auto Print. ESC [ 5 i Enable Controller print; incoming text is sent to printer but not to the screen. Escape sequences are recognized and acted upon but are not printed. Cursor movement cannot be prevented. ESC [ ? 5 i Enable Auto Print; incoming text is sent to both screen and printer. Escape sequences are recognized and acted upon but are not printed. ESC [ ? 18 h Set Print termination char; requests Form Feed be printed after each Print Screen operation (ESC [ i). ESC [ ? 18 l Reset Print termination char; no FF after Print screen. ESC [ ? 19 h Sets print area of ESC [ i to be the whole screen (24 lines). ESC [ ? 19 l Resets print area of ESC [ i to be just scrolling region. ESC [ ? 15 n Request from remote host for printer status report. ESC [ ? 10 n Response to ESC [ ? 15 n if printer is ready. ESC [ ? 13 n Response to ESC [ ? 15 n if printer is not ready. The print device is selected to be the system printer (system file handle 4, LPT1) and the user has no choice in the matter. If the printer is not ready then a message to this effect is shown on the mode line (line 25) and the print request is skipped. Skipping is done to prevent systems from being hung just because the printer was not plugged in or similar trivia. Trailing spaces on each line are trimmed off to save printing time. These print screen operations should be compatible with all the other screen to printer operations (screen dump key, Log to PRN, DOS print screen, etc). Startup conditions are to reset both Print termination char and screen area bits; i.e., no FF after a print screen command and use scrolling region. LONG PACKETS: This version can use packets up to 1000 bytes in length. The file sender selects the type of packet (Regular or Long) based upon the size of the data to be sent in that particular packet; negotiations at the start of a file transfer determine the maximum length. The receiver is prepared to accept Long packets at any time up to a maximum length set by the user. The command SET RECEIVE PACKET-LENGTH xxx limits the maximum packet size; xxx can be as large as 1000. Kermit uses 94 byte packets as its default maximum size; longer packets will be employed only if the user gives the SET RECEIVE PACK commands above, and the other Kermit knows how to and agrees to send them. Packet lengths greater than 94 are accomplished using a protocol extension -- Extended Length Packets -- that may be lacking in other Kermit programs. The SET SEND PACKET xxx command may be used to override the other Kermit's request. WARNING: The normal file transfer display will be fractured if you use long packets together with SET DEBUG ON. If you want to display long packets during file transfer, be sure to SET DISPLAY SERIAL. PERFORMANCE: The IBM serial port interrupt routine, buffer handler for received chars, and the packet assembly/disassembly routines Spack and Rpack have been completely rewritten for efficiency, Long packets, and high speed operations. It is possible to operate at 38400 baud on a plain 4.77 MHz IBM PC provided that the clock tic routine is not loaded with time consuming extras (Helpful Utilities, print spoolers, screen savers, and the like). Long packet and high efficiency code are system independent; fancy high speed operation code is for IBM PC's and clones and the DEC Rainbow. SCRIPTS: A simple Kermit-style script and raw file upload facility has been written by Jim Sturdevant and myself (he did the original version and we developed it from there). This code is actually system independent. A quick discussion is reproduced below, and the Kermit Help menu has further cryptic guidance. Here is a quick guide to scripts in MS Kermit 2.29. There are several main script commands shown below in Upper case and yet another batch of Set commands to establish operational parameter for scripts. OUTPUT text Sends the single line of text out the serial port. Spaces and tabs are included. Control characters such as a carriage return must be stated as an octal number preceeded by a backslash: carriage return is \15, line feed is \12, bell is \7, and so forth. Example, dial the phone via a modem: Output atdt 5,1234, (918) 555-1212\15 The "text" also can be the first line of a file or even from the console if the first letter of the text is an at-sign, @filename or @con. Thus, Output @con reads a line from the console and sends it out the serial port. You can also include "\b" or "\B" in your script to have it send a BREAK. INPUT [time] text This is a heavily used operation which reads characters from the serial port and attempts to match them to the line of text, or times out if it can't. A common command of this kind would be Input 30 Username: The sequence above waits up to 30 seconds for the pattern Username: to appear. If it does then the next script command is executed. If it does not appear then the script file can be told to Quit or to Proceed as if the pattern did occur. The time field is optional and is nominally 1 second. Selection of Quit or Proceed and the default waiting time are governed by the Set Input command discussed below. Text may also be replaced by at-sign filename to cause the pattern to be selected as the first line in that file. If the text pattern is omitted then the Input command reads characters from the serial port, displays and then discards them. A recent addition allows a carriage return typed at the local keyboard to force a pattern match (for those of us with limited patience concerning recalcerant remote hosts). PAUSE [time] Waits 1 second, or the number of seconds in the optional argument. ECHO text Simply writes the line of text on the screen. Text may contain imbedded escape codes (e.g. VT100 sequences for Rainbow firmware or [N]ANSI.SYS.). CLRINP Empties the serial port's buffer of stored but not yet read characters. TRANSMIT filespec [prompt] Raw file upload. Sends the named file (no wild cards) a line at a time to the remote host. Each line is expected to end with carriage return-line feed, and the trailing line feed is not sent. After each line Kermit waits for a prompt character from the other side. The default prompt char is a line feed. The command line allows the prompt to be changed to any other character (control codes are expressed as an octal number in the form \ooo); specifying a prompt of \0 means do not wait for a prompt. Alternatively, pushing the local Return key simulates reception of prompt. Trans foo.bar \7 send file "foo.bar", expect ^G as a prompt. SET INPUT commands: Set Input Default-timeout seconds Changes the waiting time from 1 second to this new value. Set Input Timeout-action Proceed or Quit Determines whether or not the current script file is to be continued or exited if a timeout occurs. Proceed is the default and means that timeouts are ignored. Quit causes the current script file to be exited and control passed to either the next higher level script file (if the present one were invoked by such) or to Kermit's main prompt. Set Input Case Ignore or Observe Says whether or not to distinguish upper and lower case text when doing a matchup in the INPUT command. Ignore causes upper and lower case letters to be considered the same. Default is to Ignore case distinctions. Set Input Echo On or Off Show on the screen characters read from the serial port during the script operation, or not. Default is On, show them. Values of Set Input things are shown on Kermit's Status display. Construction of a script file. Kermit has the ability to read a file, called a Take file in Kermit-ese, and execute the contents as Kermit commands. The Kermit command to do this is TAKE filename. Within such a file may be another Take command, and within it yet another Take and so on. Thus, the script is prepared as an ordinary text file and is invoked within Kermit by saying Take filename; a complete working example is given below. Before getting to it, however, a word or two about timeouts. If the action on timing out is set to Quit then the current Take file is exited whenever a timeout occurs and processing continues at any next higher level Take file; there is no conditional branching in this script facility. Also, Kermit looks for a particular file, MSKERMIT.INI, at startup time and executes it as the first Take file; you may place normal startup and script commands there as a convenience. An example script is shown below for connecting to machine VAXB via a modem and a Data Switch. The lines starting with Comment are ignored by Kermit and are there as a tutorial guide. Comments may also be placed on a line beginning with a semicolon. Upper case is used for clarity. File LOGIN.SCP - Comment set Kermit's baud rate to 2400 SET SPEED 2400 Comment flush any old junk CLRINP Comment don't display Take file commands as we go SET TAKE OFF Comment quit script if proper answers do not appear SET INPUT TIMEOUT-ACTION QUIT Comment see if modem is alive, hello modem. OUTPUT AT\15 Comment look for its normal response INPUT OK Comment dial the Micom switch (from on-campus) OUTPUT ATDT 3458\15 Comment look for phone being answered INPUT 25 CONNECT Comment wait 1 sec for modem to get ready PAUSE 1 Comment then send control code carriage return, Comment expressed as an octal number preceded by \. OUTPUT \15 Comment wait a sec for the switch to wake up PAUSE 1 Comment one more time so the switch recognizes our baud rate OUTPUT \15 Comment find first part of switch's announcement INPUT 10 slowly Comment ignore timeouts from here on SET INPUT TIMEOUT PROCEED Comment find last word of the announcement INPUT 15 CLASS Comment tell the switch where we want to attach OUTPUT VAXB\15 Comment look for final prompt of Go and a beep INPUT 20 Go\7 Comment let switch get ready for our response PAUSE 1 Comment wakeup vaxb, c/r's, slowly as instructed OUTPUT \15 PAUSE 1 OUTPUT \15 PAUSE 1 Comment third c/r, just in case. Awaken Vaxen OUTPUT \15 Comment look for login sequence INPUT Username: Comment give our username OUTPUT ItsMeAgain\15 INPUT Password: Comment give ourselves a prompt and read from console ECHO \15\12Enter password: OUTPUT @con Comment we're in, go test for new mail msg TAKE mail.scp Comment go into VT102 terminal emulation mode CONNECT And here is file MAIL.SCP, with added comments - Comment show serial port traffic as we go SET TAKE ON Comment Exit this file if timeout (no new mail) SET INPUT TIMEOUT QUIT Comment look for keyword Mail, timeout if none INPUT 10 Mail Comment must be mail if we are still here, read it OUTPUT mail\15 LIMITATIONS OF SCRIPTS: No variables, conditional branching, or similar features. The terminal emulator is not active during script execution, so that escape sequences (particularly the DEC "what kind of terminal are you?" sequence) will not be recognized. A login script designed for VAX/VMS systems with TERMINAL/INQUIRE should do an explicit INPUT for the enquiry string ("ESC Z", or "ESC [ 0 c") and then explicitly output the terminal ID string (like "ESC [ ? 6 c" for the VT102. The terminal emulator is independent of the script facility so that scripts can be a part of all MS-DOS Kermits, not just the IBM PC version. Sometimes 8-bit characters are displayed on the screen during script execution, even though PARITY might be SET to other than NONE. [End of MST22B.UPD]