Path: utzoo!utgpu!water!watmath!clyde!rutgers!mit-eddie!husc6!bbn!rochester!ur-tut!sunybcs!bingvaxu!leah!emb978 From: emb978@leah.Albany.Edu ( Eric M. Boehm) Newsgroups: comp.sys.ibm.pc Subject: Re: Request for Kermit 2.30. Summary: Docs for Kermit-MS 2.30, Part 5 of 6 Message-ID: <578@leah.Albany.Edu> Date: 23 Jan 88 21:52:26 GMT References: <20064@amdcad.AMD.COM> <574@leah.Albany.Edu> <575@leah.Albany.Edu> <577@leah.Albany.Edu> Organization: The University at Albany, Computer Services Center Lines: 1000 ------------------------------------------------------------------------------- 4-for-3 encoding combined with null compression reduces the size of the encoded file to approximately the same size as the original .EXE file, and sometimes even smaller. The first line of a .BOO file is the name (in plain text) of the original file. Here's what the first few lines of a typical .BOO file look like: MSVIBM.EXE CEYP0Id05@0P~3oomo2Y01FWeP8@007P000040HB4001`W~28bL005\W~2JBP00722V0ZHPYP: \8:H2]R2V0[`PYP:68>H2S23V0YHPiP:Xg800;Qd~2UWD006Yg~2Ogl009]o~2L8000;20~~~~ ~~~~~~~:R2H008TV?P761T4100i7n0o1]e7[@2\PO=8LH60@00Raj>04^97Xh0 Programs for Handling .BOO Files Kermit Distribution includes several useful .BOO-file programs: MSBPCT.BAS This Microsoft BASIC program can be used on any PC to decode a .BOO file into an .EXE file. It's about 50 lines line, so it can be typed in. MSBPCT.BOO BASIC programs run rather slowly, so .BOO-file decoders have also been written in high-level languages like C. The MSBPCT.EXE file that was produced by compiling MSBPCT.C is en- coded into MSBPCT.BOO, which can be decoded back into MSBPCT.EXE using MSBPCT.BAS. Once you've done that, you don't need to run the slow BASIC version any more, which is a bless- ing, because the MS-Kermit .BOO file takes more than half an hour to decode using the BASIC version, but only seconds using MSBPCT.EXE. MSBPCT.* There are .BOO-file decoders written in other languages too, like assembler, Turbo Pascal, etc. Take your pick. They all do the same thing. MSBMKB.* This is the program for encoding an .EXE file into a .BOO file. It is written in C, compiled, and translated (by itself) into .BOO format, suitable for decoding back into .EXE form by any of the MSBPCT programs. MSBHEX.* are programs for producing and decoding straight hex files. 1.13. Program Organization Kermit-MS version 2 is composed of separate assembler source files, assembled separately, and linked together. The modules are: System/Device Independent: MSSKER.ASM Main program MSSSEN.ASM File sender MSSRCV.ASM File receiver MSSSER.ASM Server operation MSSFIL.ASM File i/o MSSCMD.ASM Command parser MSSTER.ASM CONNECT command MSSCOM.ASM Packet reader and sender MSSSET.ASM SET, SHOW, and STATUS commands MSSSCP.ASM Script CLEAR, ECHO, INPUT, OUTPUT, PAUSE, TRANSMIT commands MSSFIN.ASM Dummy module to find the end of the data segment; must be linked LAST. MSSDEF.H Data structure definitions and equates System/Device Dependent: MSGxxx.ASM System-dependent graphics terminal emulation for system xxx MSUxxx.ASM System-dependent keyboard translator for system xxx MSXxxx.ASM System-dependent code for system xxx MSYxxx.ASM Terminal emulation for system xxx MSZxxx.ASM More terminal emulation for system xxx The xxx is replaced by a 3-letter code for the particular system, e.g. IBM for the IBM PC family, RB1 for the Rainbow-100, etc. The modular organization allows easier modification of the program, quicker transfer of modified portions from system-to-system. The modules are designed to be well-defined and self-contained, such that they can be easily replaced. For instance, someone who prefers windows and mice to typing commands should be able to replace the command parsing module without having to worry about the effect on the other modules. To assemble any of the Kermit modules, file MSSDEF.H must be on the default disk. All the Kermit implementations require the modules MSSCMD, MSSCOM, MSSFIL, MSSKER, MSSRCV, MSSSCP, MSSSEN, MSSSER, MSSSET, MSSTER, MSSFIN. MSSFIN must be linked last. Each particular implementation requires at least an MSXxxx module, usually an MSUxxx module, and, if it is doing terminal emulation in software, also an MSYxxx and possible also an MSZxxx module, and for graphics terminal emulation, also an MSGxxx module. See the batch or make files from the source distribu- tion for details of exactly which modules are required for a particular im- plementation. Once all the required object modules exist, they may be linked together to produce a Kermit program. For example, on the IBM PC: A>link Microsoft Object Linker V2.00 (C) Copyright 1982 by Microsoft Inc. Object Modules [.OBJ]: msscmd+msscom+mssfil+mssker+mssrcv+mssscp+msssen+ mssser+mssset+msster+msgibm+msuibm+msxibm+msyibm+mszibm+mssfin Run File [MSSCMD.EXE]: kermit List File [NUL.MAP]:; A> 1.14. Bringing Kermit to New Systems You can bring Kermit-MS to MS-DOS systems that are not explicitly supported in one of two ways -- attempt to run the "generic" MS-DOS Kermit on it, or add ex- plicit code to support your system. To get started with Kermit on a new system, try running "generic" MS-DOS Ker- mit; in many cases, it will run as is. The generic version accomplishes all its port and console i/o through DOS calls, and during terminal connection does not attempt to emulate any particular kind of terminal. In some cases, the generic version may still require some fiddling to run on a new system; for in- stance, different systems refer to their communication ports in different ways -- COM1, J1, AUX, etc. The SET PORT command allows you to specify the port using any of these device names, or using DOS file handles -- keep trying until you find the one that works. Generic MS-DOS Kermit will probably run no faster than 1200 baud, and it only works with DOS 2.0 or later. If you want to write code to explicitly support a new system, first call or write Kermit Distribution at Columbia to make sure no one else is already doing the same work. If you're the first, then begin by reading the file MSXAAA.DOC, provided with the MS-DOS Kermit sources in the Kermit distribution, which is a guide to the system dependent modules of Kermit-MS. Then create new MSUxxx.ASM and MSXxxx.ASM modules, and, if your version is also doing terminal emulation in software, also an MSY and possibly an MSZ module patterned after those that have been written for other systems. 1.15. Kermit-MS IBM PC Terminal Emulator Technical Summary The following sections describe Kermit's VT102, VT52, Heath-19, and Tektronix terminal emulation functions on the IBM PC family. All of these functions are disabled if you SET TERMINAL NONE, allowing you to use MS-Kermit as a "dumb terminal", or with externally loaded console drivers. 1.15.1. Treatment of Inbound Characters During Terminal Emulation Many things can happen to a character that arrives at the communication port before you see it, depending on all the factors mentioned above. The actual sequence of events is: 1. Obtain character from serial port. 2. Remove high bit if parity is other than none. 3. Detect and remove xon/xoff if FLOW is XON/XOFF. 4. If DEBUG is active (ON or SESSION) then put character to debug style display, otherwise: 5. If transparent printing is active (for VT102 emulators) then print the character but do not show it on the display, otherwise: 6. Remove high-order bit if DISPLAY is 7-bit 7. Translate if TRANSLATE INPUT is ON, but skip this step if an escape sequence is in progress 8. If LOG SESSION is active then copy character to the log file 9. Pass the character to the terminal emulator for interpretation or display. The following sections summarize the Kermit-MS keyboard and screen operation during emulation of H19, VT52, and VT102 terminals, prinicipally for the IBM PC but also used by the NEC APC3, Victor 9000, and Sanyo 55x systems. Note that spaces shown between characters of escape sequences are there for ease of read- ing. The actual sequences contain no spaces. 1.15.2. Keyboard Layout and Characters Sent Here is how the keypad functions are assigned to the IBM keyboard function keys. You may change them by using the SET KEY command to define a desired key as the appropriate Kermit action verb; use SET KEY without a definition to un- define a key. Names of appropriate verbs are also shown for use in the Set Key command, such as Set Key \2352 \Kbreak (IBM Alt-B assigned to verb BREAK) Verb names are system dependent, use ? in the Set Key definition part for a list of local verbs. IBM PC verbs are listed in Table 1-4; IBM key values are either straight ASCII or the IBM Bios scan code, plus 256, plus 512 for Shift key held down, plus 1024 for Control key held down, plus 2048 for Alt key held down; non-ASCII keys are always 256 decimal or greater. Keys particular to the Enhanced Keyboard have 4096 added to the result. --------------------------------------------------------------------------- Heath-19 and VT52 Keypads VT102 keypad IBM Keys IBM keys +------+------+-------+----------+ +------+------+------+------+ | Blue | Red | Grey | up arrow | | PF1 | PF2 | PF3 | PF4 | | F1 | F2 | F3 | up arrow | | F1 | F2 | F3 | F4 | +------+------+-------+----------+ +------+------+------+------+ | 7 | 8 | 9 |down arrow| | 7 | 8 | 9 | - | | F5 | F6 | F7 |down arrow| | F5 | F6 | F7 | F8 | +------+------+-------+----------+ +------+------+------+------+ | 4 | 5 | 6 | rgt arrow| | 4 | 5 | 6 | , | | F9 | F10 | SF1 | rgt arrow| | F9 | F10 | SF1 | SF2 | +------+------+-------+----------+ +------+------+------+------+ | 1 | 2 | 3 |left arrow| | 1 | 2 | 3 | E | | SF3 | SF4 | SF5 |left arrow| | SF3 | SF4 | SF5 | n S| +------+------+-------+----------+ +------+------+------+ t F| | 0------0 | . | Enter | | 0------0 | . | e 6| | SF7 | SF8 | SF6 | | SF7 | SF8 | r | +-------------+-------+----------+ +-------------+------+------+ SF1 means push Shift and F1 keys simultaneously --------------------------------------------------------------------------- CURSOR KEYS: H-19 & VT52 VT102 VT52/H19 key IBM Verb IBM key All Modes Numeric Application up arrow UPARR up arrow ESC A ESC [ A ESC O A down arrow DNARR down arrow ESC B ESC [ B ESC O B right arrow RTARR right arrow ESC C ESC [ C ESC O C left arrow LFARR left arrow ESC D ESC [ D ESC O D AUXILIARY KEYPAD: Heath-19 & VT52 VT102 VT52/H19 key IBM Verb IBM key Numeric Applic. Numeric Applic. PF1/HF7/Blue GOLD,PF1 F1 ESC P ESC P ESC O P ESC O P PF2/HF8/Red PF2 F2 ESC Q ESC Q ESC O Q ESC O Q PF3/HF9/Grey PF3 F3 ESC R ESC R ESC O R ESC O R PF4/HF1 PF4 F4 ESC S ESC S ESC O S ESC O S 0 KP0 SF7 0 ESC ? p 0 ESC O p 1 KP1 SF3 1 ESC ? q 1 ESC O q 2 KP2 SF4 2 ESC ? r 2 ESC O r 3 KP3 SF5 3 ESC ? s 3 ESC O s 4 KP4 F9 4 ESC ? t 4 ESC O t 5 KP5 F10 5 ESC ? u 5 ESC O u 6 KP6 SF1 6 ESC ? v 6 ESC O v 7 KP7 F5 7 ESC ? w 7 ESC O w 8 KP8 F6 8 ESC ? x 8 ESC O x 9 KP9 F7 9 ESC ? y 9 ESC O y comma (,) KPCOMA SF2 , ESC ? l , ESC O l minus (-) KPMINUS F8 - ESC ? m - ESC O m period (.) KPDOT SF8 . ESC ? n . ESC O n Enter KPENTER SF6 ^M(cr) ESC ? M ^M ESC O M (SFn means hold down Shift key while pressing Function key n.) An often confusing item is knowing the mode of the auxillary keypad: numeric or application. Digital Equipment Corporation designed the terminal to change modes only under command from the remote computer and not at all from the keyboard. So the startup state is numeric/cursor mode, and reception of escape sequences "ESC [ ? 1 h" or "l" changes the mode. Kermit verbs for the keypad and cursor keys generate the correct escape sequences appropriate to the cur- rent mode and terminal type. A best attempt is made to safely test for the 101/102 key Enhanced keyboard and use it if present. If it is present then the keyboard translator separates the individual arrow keys from those on the numeric keypad and also separates the asterisk and forward slash keys on the keypad from those on the regular typewriter keyboard. These special Enhanced keyboard keys are reported as scan codes with 4096 added to the base scan code. OTHER IBM KEYS OPERATIONAL IN CONNECT MODE: IBM key IBM Verb Action Keypad Del Send ASCII Del code (rubout) \127 Backspace (<-) Send ASCII Del code (rubout) \127 (BS is \8) Keypad - MODELINE Toggle mode line on/off (only if Mode Line is enabled and not used by the host). Alt - TERMTYPE Toggle among H-19, VT52, and VT100 emulations. Alt = RESET Clear screen and reset terminal emulator to starting (setup) state. Alt B BREAK Send a BREAK signal Alt H HELP Show drop down help menu (detailed below) Alt S STATUS Show settings Alt X EXIT Exit Connect mode, back to Kermit prompt Home HOMSCN Roll screen up (text down) to beginning of storage. End ENDSCN Roll screen down (text up) to end of storage. PgUp UPSCN Roll screen up (back, earlier) one screen. PgDn DNSCN Roll screen down (forward, later) one screen. Ctrl-PgUp UPONE Roll screen up one line. Ctrl-PdDn DNONE Roll screen down one line. Control PrtSc PRTSCN Toggle on/off copying of received text to printer, "PRN" shows on far right of mode line when activated. Control-End DUMP Dump image of screen to a disk file or device. Default filename is KERMIT.SCN in the current directory. Use command SET DUMP to change the filename. Screen images are appended to the file, separated by formfeeds. Shift-PrtSc Standard DOS Print-screen, dump screen image to printer. "Alt -" means hold down Alt and type minus on the upper key rank. This switches among the various kinds of emulation but does not change most operat- ing parameters of the emulator. CONNECT ESCAPE COMMANDS: Type the Kermit escape character (normally "^]"), then one of the keys below: (equivalent IBM Verb) ? display this short list. HELP 0 send a null character. NULL B send a BREAK signal. BREAK C close connect session & return to Kermit prompt. EXIT F dump screen to filespec, default is KERMIT.SCN. DUMP H hangup the phone or network connection HANGUP L send a Long BREAK signal LBREAK M toggle mode line on/off. MODELINE P push to DOS. DOS Q quit (suspend) logging. LOGOFF R resume logging. LOGON S show status. STATUS Kermit escape character itself: send it to the host. 1.15.3. Responses To Characters Received By the Terminal Emulator Unknown escape sequences of the form "ESC char" are absorbed by the emulator without further effect; longer unknown escape sequences echo the extra charac- ters. DEC VT102 functions while in ANSI (VT102) mode, unsupported features marked by an asterisk (*): Escape Seq Mnemonic Description of Action ESC D IND Index, moves cursor down one line, can scroll ESC E NEL Move cursor to start of line below, can scroll ESC H HTS Set one horizontal tab at current position ESC M RI Reverse Index, cursor up one line, can scroll ESC Z DECID Identify terminal (response is ESC [ ? 6 c) ESC c RIS Reset terminal to initial state ESC = DECKPAM Enter keypad application mode ESC > DECKNPNM Enter keypad numeric mode ESC 7 DECSC Save cursor position and attributes ESC 8 DECRC Restore cursor from previously saved position ESC # 3 DECDHL Double height and width line, top half ESC # 4 DECDHL Double height and width line, bottom half ESC # 5 DECSWL Single height and width line ESC # 6 DECDWL Double width single height line ESC # 8 DECALN Test screen alignment, fill screen with E's ESC [ Pn @ ICH ANSI insert Pn spaces at and after cursor ESC [ Pn A CUU Cursor up Pn lines, does not scroll ESC [ Pn B CUD Cursor down Pn lines, does not scroll ESC [ Pn C CUF Cursor forward, stays on same line ESC [ Pn D CUB Cursor backward, stays on same line ESC [ Pn; Pn H CUP Set cursor to row, column (same as HVP) ESC [ Ps J ED Erase in display: 0 = cursor to end of screen, inclusive 1 = start of screen to cursor, inclusive 2 = entire screen, reset lines to single width, cursor does not move. ESC [ Ps K EL Erase in line: 0 = cursor to end of line, inclusive 1 = start of line to cursor, inclusive 2 = entire line, cursor does not move ESC [ Pn L IL Insert Pn lines preceding current line. ESC [ Pn M DL Delete Pn lines from current downward, incl. ESC [ Pn P DCH Delete Pn chars from cursor to left, incl. ESC [ Pn; Pn R CPR Cursor report (row, column), sent by terminal Example: home position yields ESC [ 1; 1 R ESC [ Pn c DA Device attributes (reports ESC [ ? 6 ; 2 c) ESC [ Pn; Pn f HVP Set cursor to row, column (same as CUP) ESC [ Ps g TBC Tabs clear, 0 = at this position, 3 = all ESC [ 4 h IRM Insert mode on ESC [ 20 h LNM Set newline mode (cr => cr/lf) ESC [ 4 l IRM Replacement mode on ESC [ 20 l LNM Reset newline mode (cr => cr) ESC [ ? Ps;...;Ps h SM Set mode, see table below ESC [ ? Ps;...;Ps l RM Reset mode, see table below Ps Mnemonic Mode Set (h) Reset (l) 0 error (ignored) 1 DECCKM cursor keys application cursor/numeric 2 DECANM ANSI/VT52 ANSI/VT102 VT52 3 DECCOLM Columns +132 col 80 col 4 DECSCLM *Scrolling smooth jump 5 DECSCNM Screen reverse video normal 6 DECOM Origin relative absolute 7 DECAWM Autowrap on off 8 DECARM *Autorepeat on off 9 DECINLM *Interlace on off 18 DECPFF Printer termination character, use FF if set 19 DECPEX Printer extent,set=screen,off=scrolling region 38 n/a Graphics (Tek) ++graphics text + See comments on EGA boards. ++ Ignored if DISABLE TEK has been given. ESC [ Pn i MC Printer controls (Media Copy) 0 Print whole Screen 4 Exit printer controller (transparent print) 5 Enter printer controller (transparent print) ESC [ ? Pn i MC Printer controls (Media Copy) 1 Print line containing cursor 4 Exit auto print (stop echoing to printer) 5 Enter autoprint (echo screen chars to printer) ESC [ Ps;...;Ps m SGR Select graphic rendition 0 = all attributes off (#'s 1, 4, 5, 7) 1 = bold, intensify foreground 4 = underscore (reverse video on IBM CGA) 5 = blink 7 = reverse video non-DEC extensions: 30-37 = foreground color = 30 + colors 40-47 = background color = 40 + colors colors: 1 = red, 2 = green, 4 = blue ESC [ Ps n DSR Device Status Report. Response from VT100: 0=ready, 3=malfunction. Command to VT100: 5=report status with DSR, 6=report cursor position using CPR sequence. ESC [ Ps;...;Ps q DECLL Load LEDs, Ps = 0 means clear LED #1-4 Ps = 1,2,3,4 sets LED # 1,2,3,4 on status line. ESC [ Pn; Pn r DECSTBM Set top and bottom scrolling margins, resp. ESC [ r resets margin to full screen. ESC [ sol x DECREQTPARM Request terminal parameters, see table below ESC [ sol; par; nbits; xspeed; rspeed; clkmul; flags x DECREPTPARM Reports terminal parameters sol = 0 request; terminal can send unsolicited reports - supported as sol = 1 below. sol = 1, request; term reports only on request sol = 2, this is a report (DECREPTPARM) sol = 3, terminal reporting only on request par = 1 none, 2 space, 3 mark, 4 odd, 5 even nbits = 1 (8 bits/char), 2 (7 bits/char) xspeed,rspeed = transmit & receive speed index 0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120,128 correspond to speeds of 50,75,110,134.5,150,200,300,600,1200,1800,2000,2400,3600,4800,9600,19200, and 38400 baud. clkmul = 1 (clock rate multiplier is 16) flags = 0-15 (Setup Block #5), always 0 here ESC [ 2; Ps y DECST *Confidence tests - not supported SCS Select character sets. ESC ( A SCS G0 points to UK symbols ESC ) A SCS G1 points to UK symbols ESC ( B SCS G0 points to ASCII symbols ESC ) B SCS G1 points to ASCII symbols ESC ( 0 SCS G0 points to special (line drawing) graphics ESC ) 0 SCS G1 points to special (line drawing) graphics ESC ( 1 SCS G0 points to alt char ROM - UK symbols ESC ) 1 SCS G1 points to alt char ROM - UK symbols ESC ( 2 SCS G0 points to alt graphics ROM - as ESC ( 0 ESC ) 2 SCS G1 points to alt graphics ROM - as ESC ) 0 (Separate graphics used for DEC and Heath) ^E ENQ *Answerback message (not supported) ^G BELL Sound VT102 style beep ^H BS Backspace, move cursor left one character ^I HT Horizontal tab, move cursor to next tabstop ^J LF Linefeed, move cursor down one line ^K VT Vertical Tab, treated as a line feed ^L FF Formfeed, treated as a line feed ^M CR Carriage return, move cursor to col 1 ^N SO Select usage of G1 character set ^O SI Select usage of G0 character set ^X CAN Cancel escape sequence in progress ^Z SUB Treated as a CAN Other extensions: ESC [ 25; Pc f VT52/VT100 move cursor to 25th line. ESC [ 25; Pc H VT52/VT100 move cursor to 25th line. (These will disable Kermit's own status line.) ESC * char VT200 series graphics command, ignored. 1.15.4. DEC VT102 Functions While in VT52 Mode Escape sequence Description of action ESC A Cursor up ESC B Cursor down ESC C Cursor right ESC D Cursor left ESC F Enter graphics mode ESC G Exit graphics mode ESC H Cursor home ESC I Reverse line feed ESC J Erase to end of screen ESC K Erase to end of line ESC V Print cursor line ESC X Exit Printer Controller mode, transparent print ESC Y row column Direct cursor address, offset from space ESC W Enter Printer Controller mode,transparent print ESC Z Identify (response is ESC / Z) ESC ^ (caret) Enter autoprint mode (printer echoes screen) ESC _ (underscore) Exit autoprint mode ESC ] Print Screen ESC = Enter alternate keypad mode ESC > Exit alternate keypad mode ESC < Enter ANSI mode (changes to VT102) 1.15.5. Heath-19 Functions While in Non-ANSI Mode Escape seq Mnemonic Description of action ESC A HCUU Cursor Up ESC B HCUD Cursor Down ESC C HCUF Cursor Forward, stays on same line ESC D HCUB Cursor Backward, stays on same line ESC E HCD Clear display ESC F HEGM Enter Graphics mode ESC G HXGM Exit Graphic mode ESC H HCUH Cursor Home ESC I HRI Reverse Index ESC J HEOP Erase to end of page ESC K HEOL Erase to end of line ESC L HIL Insert line ESC M HDL Delete line ESC N HDCH Delete character ESC O HERM Exit Insert Char mode ESC Y row col HDCA Direct cursor addressing, offset from space ESC Z HID Identify (response is ESC / K which is a VT52) ESC b HBD Erase Beginning of display ESC j HSCP Save cursor position ESC k HRCP Set cursor to saved position ESC l HEL Erase entire line ESC n HCPR Cursor Position Report request ESC o HEBL Erase beginning of line ESC p HERV Enter Reverse Video mode ESC q HXRV Exit Reverse Video mode ESC r Bn HMBR *Modify baud rate - not supported ESC t HEKS *Enter Keypad shifted mode, not supported ESC u HXKS *Exit Keypad shifted mode, not supported ESC v HEWA Wrap around at end of line ESC w HXWA Discard at end of line ESC x Ps HSM Set Mode. See table below ESC y Ps HRM Reset Mode. See table below Ps Mnemonic Mode Set (x) Reset (y) 1 HSM/HRM 25th line enabled +disabled 2 *keyclick off on 3 *holdscreen enabled disabled 4 cursor type block underline 5 cursor on/off on off 6 *keypad-shifted shifted unshifted 7 alt app keypad enabled disabled 8 *linefeed lf=>cr/lf lf=>lf 9 newline mode cr=>cr/lf cr=>cr + disabling the 25th line also clears it ESC z HRAM Reset to power-up configuration ESC = HAKM Enter Alternate Keypad mode ESC > HXAM Exit Alternate Keypad mode ESC < HEAM Enter ANSI mode (ESC [ stuff) ESC @ HEIM Enter Insert Char mode ESC [ HEHS *Enter Hold Screen mode, not supported ESC \ HXHS *Exit Hold Screen mode, not supported ESC { and } HEK, HDK *Keyboard enable/disable, not supported ESC ] HX25 *Transmit 25th line, not supported ESC # HXMP *Transmit page, not supported 1.15.6. Heath-19 Functions While in ANSI Mode Escape Seq Mnenonic Description of Action ESC [ s PSCP Save cursor position & attributes ESC [ u PRCP Restore cursor position & attributes ESC [ z PRAM Reset to power-up configuration ESC [ 2 J ED Erase entire screen but do not move cursor; regular Heath-19 moves cursor to Home. ESC [ ? 2 h PEHM Revert to normal Heath-19 non-ANSI mode ESC [ > Ps h SM Same as ESC x Ps ESC [ > Ps l RM Same as ESC y Ps Plus most of the ANSI escape sequences listed for the VT102. 1.15.7. Tektronix 4010/4014 Graphics Terminal Functions MS-Kermit's Tektronix 4010 emulator responds to ordinary text, several special control codes (for drawing lines and dots), and several escape sequences, as shown in Table 1-8. The commands SET DEBUG and SET TRANSLATION INPUT are ef- fective in Tek mode. ------------------------------------------------------------------------------- Control Code Action FS, Control-\ Backslash draw dots GS, Control-] Right square bracket draw lines RS, Control-^ Caret Draw dots incrementally US, Control-_ Underscore Display text BEL, Control-G Beep, make a noise BS, Control-H Backspace, destructive delete HT, Control-I Tab, convert to single space LF, Control-J Line feed, go down one line VT, Control-K Move up one text line FF, Control-L Clears the screen CR, Control-M Carriage return, start of line CAN, Control-X Exit Tek sub-mode, or ignore DEL, RUBOUT Delete code, same as BS Escape Sequence Action ESC Control-E Send a status report ESC Control-L Clear the screen ESC Control-Z Activate crosshairs (GIN mode) ESC Z Send terminal identification ESC ` (accent grave) Use solid lines in drawing ESC a through ESC e Use dashed line patterns: a=fine dots, b=short dashes c=dash dot, d=long dash dot e=dash dot dot. ESC [ ? 3 8 l Exit Tek mode (become text terminal, VT102 etc) ESC [ ? 3 8 h Enter Tek mode (from VT102 mode) Table 1-8: Response of MS-Kermit Tektronix Emulator to Received Characters ------------------------------------------------------------------------------- In the table, US is the name for the ASCII character Control-Underscore, 31 decimal. Text is written starting with the last drawn point being the lower left corner of the first 8 by 8 character cell. The drawing position is up- dated by 8 dots to the right for each character, and lines wrap at column 80 (column 90 for Hercules boards). If text extends "below the screen" the sign "More >" is shown at the bottom right corner and the user needs to press a key to continue. Then the screen will be cleared and the new text will start at the top of the screen (no scrolling is done in graphics mode). A real Tek 4010 begins new text at column 40 and will overwrite dots from older material. The high resolution EGA screen and the Hercules screen will hold 43 lines, the CGA and Monochome screens hold 25 lines, and the AT&T screen holds 50 lines. Her- cules screens are 90 characters wide and others are 80 characters wide. Monochrome systems lack graphics so the text is the normal hardware character font placed at the nearest normal 80x25 location (similarly, "drawing" on Monochrome systems is achieved by using a text plus ("+") sign where a dot would appear). Text mode is interrupted by the drawing commands discussed below. Drawing commands GS, FS, RS: 1. Draw a line or move to a point: GS GS is the name for ASCII character Control-] (right square bracket), decimal 29. stands for an encoded x,y coordinate as explained below. One or more x,y coordinates may follow GS and line segments are drawn from point to point. The first point is reached without drawing so that GS and the initial is a simple "move-to" command rather than a "draw-to" command. Lines may be con- structed from six dash patterns described in Table 1-8. coordinates are encoded by separating the 10 bit value of x and of y into 5 bit components, ad- ding an ASCII space (32) to each to form a printable character, and then adding two high bits to each to identify which component is being represented: high-y, low-y, high-x, or low-x. They are transmitted in that order, with the low-x byte always sent last. In fact, bytes may be omitted if they do not change from point to point, provided that low-x is always sent. These bytes range from ASCII space (32 decimal) to ASCII DEL (127 decimal). Details are given below, and summarized in Table 1-10. This mode completes when a new command or CRLF (carriage return, line feed) arrives; escape sequences are processed transparently but other control codes are ignored. The interrupting character is accepted and processed next. 2. Draw dots at given locations: FS FS is the name for the ASCII character Control-\ (backslash), decimal 28. is in the same form as above. A dot is drawn at each x,y point. This mode completes when a new command or a CRLF character arrives; escape sequences are processed transparently but other control codes are ignored. The interrupting character is accepted and processed next. 3. Draw dots from the current location: RS ... RS is the name for the ASCII character Control-^ (caret), decimal 30. pen is the character Space (32 decimal) to move without drawing or P (80 decimal) to draw while moving. is one of the letters A, E, D, F, B, J, H, I as shown in Table 1-9. ------------------------------------------------------------------------------- Move One Tek Dot This Way A East (right) E East and North F D E D North (up) F North and West B * A (* is current location) B West J South and West J H I H South I South and East Table 1-9: Tektronix Dot-Drawing Commands ------------------------------------------------------------------------------- Example: RS P J J J (no spaces here, naturally) means draw three dots in the southwest direction, stepping to each in turn. This mode completes when a new command or a non- or non- character arrives; the interrupting character is accepted and processed next. Graphics INput (GIN) mode: Graphics input mode is entered when ESC Control-Z is received. A crosshair is drawn on the screen and may be moved by the numeric keypad arrows (fine scale motion) or the Shift key and these arrows (coarse scale motion). Pressing an ASCII-producing key sends the position of the crosshairs to the host as the se- quence of: pressed key, X coordinate, Y coordinate, carriage return, then removes the crosshairs, and then returns to text mode. The coordinates are en- coded as for a GS command, but with the Kind bits omitted (see Table 1-10). If the host echos the report Kermit tries to absorb it without comment; otherwise, the text might be shown starting at the crosshairs. One may prematurely exit GIN mode by typing Control-C or Control-Break. Shift-PrtSc (DOS screen dump) remains active, however. The six byte report string might be echoed by the host so the emulator attempts to read the next six incoming bytes and suppress them while they match the report. Normally, the host is prepared to receive the report and it should turn off echoing during the process. Status or Position Report: ESCAPE Control-E requests a status report from the emulator. Tek terminals have many sub-fields. Kermit-MS sends a byte of 24 hex for being in text mode or 20 hex otherwise, followed by the encoded X then Y coordinates and a car- riage return. Coordinates are encoded 5 bits at a time similar to the GS com- mand except the Kind bits are omitted (see Table 1-10). Identification Report: ESCAPE Z requests terminal identification, as for VT52 and VT102. Currently this report is the 10 character sequence IBM_TEK ESCAPE / Z (no spaces). Screen Capturing: Kermit does not implement a graphics screen capture facility. There are many such Terminate-and-Stay-Resident (TSR) programs in circulation, as either public domain offerings or parts of commercial packages (Paint programs and even GRAPHICS.COM from DOS). High resolution EGA screens require more than the GRAPHICS.COM program. MS Windows tells the program (Kermit-MS) the system is using a pure text-only monochrome adapter so dots are shown as plus signs. Although Kermit cannot save graphics screens directly (e.g. via the ^]F connect-mode command), the received Tektronix escape sequences can still be logged to a PC file using the LOG SESSION command. The resulting log cannot be "played back" directly on the PC, but it can be transferred to the host and run through Kermit's Tek emulator again, just like a character-mode Kermit session log. VGA Modes: Considerable effort went into ensuring the graphics display would work automatically and not damage monitors. Thus, Kermit-MS safely tests the active display adapter for its kind and capabilities before starting graphics mode. Recent EGA+ display boards are capable of the 640 by 480 scan-line 16-color "VGA" mode which is now available on IBM PS/2 computers. The Tek emulator will happily run with 480 scan lines, but: there is no easy and safe way to test systems if they fully support it, and the normal 256KB of video memory is in- sufficient to save a full graphics image. So activating these higher resolu- tion modes is left to individuals to modify three simple constants in the source code of file MSGIBM.ASM and experiment with their own system. Other systems can be added by individuals in the same manner. Coordinate Encoding: Coordinate 0,0 is the lower left corner and the X axis is the horizontal one. Tektronix positions are mapped into the typically 640 dots wide by 200 or 350 dots high PC screen and thus adjacent Tek positions may yield the same PC screen dot. 4010-like devices use positions from 0 to 1023 for both X and Y, although only 0 to 779 are visible for Y due to screen geometry. The Tek screen is 10.24 by 7.80 inches and coordinates are sent as 1-4 characters. 4014-like devices use positions 0 to 4095, but each movement is a multiple of 4 positions unless the high-resolution LSBXY are sent. This makes it compatible with the 4010 in that a full sized plot fills the screen. The emulator accepts the LSBXY components but does not use them. The various modes are summarized in Table 1-10, in which the following notation is used: HIX, HIY = High order 5 bits of a 10 or 12 bit position. LOX, LOY = Middle order 5 bits of position (low order of Tek 4010). LSBXY = Low order 2 bits of X + low order 2 bits of Y (4014 mode), recognized by the Tek emulator but not used to calculate position. ------------------------------------------------------------------------------- Hi Y Lo Y Hi X LSBXY Characters Sent (Lo-X Always Sent) Same Same Same Same Lo-X Same Same Same Diff LSB, Lo-Y, Lo-X 4014 Same Same Diff Same Lo-Y, Hi-X, Lo-X Same Same Diff Diff LSB, Lo-Y, Hi-X, Lo-X 4014 Same Diff Same Same Lo-Y, Lo-X Same Diff Same Diff LSB, Lo-Y, Lo-X 4014 Same Diff Diff Same Lo-Y, Hi-X, Lo-X Same Diff Diff Diff LSB, Lo-Y, Hi-X, Lo-X 4014 Diff Same Same Same Hi-Y, Lo-X Diff Same Same Diff Hi-Y, LSB, Lo-Y, Lo-X 4014 Diff Same Diff Same Hi-Y, Lo-Y, Hi-X, Lo-X Diff Same Diff Diff Hi-Y, LSB, Lo-Y, Hi-X, Lo-X 4014 Diff Diff Same Same Hi-Y, Lo-Y, Lo-X Diff Diff Same Diff Hi-Y, LSB, Lo-Y, Lo-X 4014 Diff Diff Diff Same Hi-y, Lo-Y, Hi-X, Lo-X Diff Diff Diff Diff Hi-y, LSB, Lo-Y, Hi-X, Lo-X 4014 Kind code for byte: 20h 60h 60h 20h 40h (transmitted left to right) Table 1-10: MS-Kermit Tektronix Coordinate Interpretation ------------------------------------------------------------------------------- Note that LO-Y must be sent if HI-X has changed so that the Tektronix knows the HI-X byte (in the range of 20h-3Fh) is HI-X and not HI-Y. LO-Y must also be sent if LSBXY has changed, so that the 4010 will ignore LSBXY and accept LO-Y. The LSBXY byte is 60h + (MARGIN * 10h) + (LSBY * 4) + LSBX MARGIN is 0 here and refers to splitting the screen left and right for text rollover, which the Kermit Tek emulator does not do. Tek 4010 Example: Suppose is point y = 300, x = 500 in Tektronix coordinates. Split each 10-bit coordinate into 5-bit groups, add ASCII Space (32) and add the Kind code to each. Send the X part last. HI-Y LO-Y HI-X LO-X Y=300d=012Ch= 01001 01100 X=500d=01F4h= 01111 10100 +32d=+20h +10000 +10000 +32d=+20h +10000 +100100 +Kind code +100000 +1100000 +kind code +100000 +1000000 Binary 111001 1111100 111111 1100100 ASCII 9 | ? d So = (500,300) is sent or received in a GS command as "9|?d". An example in C (program fragments): #define GS 29 #define US 31 FILE *fp; /* File descriptor for terminal */ . . . fputc( GS, fp); coord( 75, 65); /* Move to 75,65 */ fputc( US, fp); fputs("A House", fp); /* Annotate at 75,65 */ fputc( GS, fp); /* Now draw lines... */ coord( 50, 50); coord(300, 50); /* Bottom side */ coord(300,200); coord( 50,200); /* Right wall, top */ coord(175,250); coord(300,200); /* Roof */ fputc( GS, fp); /* Start a new line */ coord( 50, 50); coord( 50,200); /* Left wall at 50,50 */ . . . coord(x, y) int x, y; { /* Send x,y coordinates to Tek 4010 */ fputc((y / 32) + 32, fp); /* High y */ fputc((y % 32) + 96, fp); /* Low y */ fputc((x / 32) + 32, fp); /* High x */ fputc((x % 32) + 64, fp); /* Low x */ } 1.16. IBM PC Kermit Technical Summaries Under normal circumstances, MS-Kermit takes advantage of the computer's hardware, and often bypasses DOS (sometimes even BIOS) to achieve high perfor- mance, to exercise special machine features, or to produce an attractive screen display. Thus, it is not in all respects a "well behaved" DOS program. MS-Kermit redirects interrupts 0BH (COM2/4) or 0CH (COM1/3), 16H, 23H, 24H and returns them when done. It uses the BIOS for keyboard, video display, and sys- tem information interrupts. It examines segment 40H for EGA operating modes and it does direct screen reads and writes. Memory for the screen roll back buffer is negotiated with DOS to leave room for a second copy of COMMAND.COM to run tasks within Kermit; about 90KB to 128KB is needed for the entire program. Video page zero is normally used, but page one is employed to save screens with non-standard dimensions. Hercules and other graphics mode displays are sup- ported only in Tektronix terminal mode. Kermit's timing delays are dynamically adjusted each time the serial port is started to accomodate machines of dif- ferent speeds; duration of the normal software timing loop is measured with the hardware timer chip and looping is adjusted to produce uniform delays on 8088 through 80386 machines. 1.16.1. Kermit-MS/IBM on Local Area Networks The IBM version of Kermit-MS has support for the IBM Local Area Network NetBIOS (and emulators) interface, Interrupt 5CH, with additional support for selected vendor specific features (presently just AT&T STARLAN), activated by the SET PORT NET command, described above. Communications across a LAN occur through the NetBIOS interface using virtual circuits (Sessions), named nodes, and con- ventional NetBIOS packets. Kermit-MS does not use LAN terminal interface packages nor the Redirector or similar functions. Kermit LAN operations are harmonious with normal network activity and many pairs of Kermits can communicate simultaneously. Kermit does not use conven- tional LAN File Server functions. Kermit uses the standard NetBIOS interrupt 5CH interface, for those who need to know such things, which means it will run on most LANS including IBM PC Net, IBM Token Ring, AT&T STARLAN, and many others, and will run with Novell NetWare software. Presently, Kermit knows some details of STARLAN and is able to send a BREAK across the net and can use ISN node names with long path parts. If STARLAN is not operating these features are not available. As more detailed information becomes available special features of other networks can be built-in. The sequence of operations is similar for a client or server Kermit. The SET PORT NET command is issued by both. This command causes Kermit to validate the presence of the Interrupt 5CH interface, test for vendor additions, test for a session already underway, establish and display a unique Kermit node name, but not make a network session. The node name of the remote server machine follows the word NET; this is not to be confused with our own node name discussed below. If an earlier LAN session is still active then the current remote node name field of the command is examined for presence of a name. If a name is given then Kermit asks the user whether to RESUME the session or start a NEW one. Starting a new one results in Kermit hanging up the old session (HANGUP) before proceeding; resuming an old one requires no further work at this point. When Kermit attaches to the network for the first time it needs to select a unique local node name so that two systems can form a Session by using these names as addresses. Kermit uses a simple algorithm to make the name. Kermit probes the network adapter board/software for the name of the local system. If the name is present Kermit makes its own name by appending a dot K (.K) to the local name. If the local name is absent then Kermit first tries a standard name of "mskermit.K"; should the network report that the name is not unique (another node is using the name) then the user is asked to choose a name. This process continues until a unique name is obtained or the user decides to quit. The final Kermit node name is reported on the screen; client Kermits will need to know the name of the server Kermit. Communication across the LAN begins differently for client and server Kermits. The server must be started first, by simply placing a Kermit in server mode. This results in a network Listen request being posted so that arriving packets with the correct node name can be delivered to the server Kermit. Next, a client Kermit tries to connect to the server by issuing a Kermit server command to the proper node name (as given in the client's SET PORT NET node command); REMOTE WHO is a satisfactory choice. The client machine actually issues a net- work Call to the server's node name to make a connection and then follows it with data packets holding the Kermit server request. The initial exchange of packets establishes a particular virtual circuit between the two nodes. If the connection cannot be started then the client Kermit reports this fact to the user. The most common causes of a failure at this point are: 1. The client Kermit did not specify the correct server Kermit node name (spelling errors, wrong case for letters, missing dot K), 2. One or both machines are using a network adapter board which is not the first in the machine; Kermit uses only the first board, 3. The LAN NetBIOS emulator does not fully support IBM standard virtual circuits, 4. The server machine was not started on the network before the client. A virtual circuit will be broken if a sender or receiver gets no response to a request within a short time interval set by the LAN hardware/software. However, the LAN procedures within Kermit automatically reestablish the circuit transparently to the user when new information is communicated; the last used remote node name is remembered internally for this purpose. This also means the server Kermit will respond to a connection from a new client Kermit if the first client is idle for say a minute or so. A session can be terminated by the user by issuing the HANGUP command or by exiting Kermit. A session will not be broken this way if the user on the client Kermit changes to a regular serial port. Finally, when Kermit returns control to DOS, but not via the PUSH command, its unique Kermit node name is removed from the network adapter board. During network communications Kermit uses network packets holding 256 bytes of data. If both Kermits are given the command SET RECEIVE PACKET 1000 then the network and Kermit will be used to best efficiency. Experience has shown that the client Kermit should have its TIMER OFF because the server may be asked to do an operation via DOS which does not complete before the client side would timeout. An observation of some token passing networks indicates that Kermit packets slightly longer than 256, 512, etc bytes result in marked slowing down because the remaining small piece is not sent until a net timer expires. Carrier sense (Ethernet, STARLAN) boards seem to be more agressive and export small packets immediately. Kermit can access files on the LAN file server via DOS even while using the LAN as a communications medium. Network administrators should note this point be- cause a user operating Kermit in Server mode can allow his or her file server directories to be available to other network users also running Kermit, without additional security checking of the other users. The network drives visible to the Server Kermit can become devices available for Kermit-to-Kermit file trans- fers, etc, unless the DISABLE command is used to confine access to the current disk and directory. A corollary is when files are accessible to DOS commands they can become public. 1.16.2. Use of Kermit-MS with External Device Drivers It is often desirable to supplement or modify the behavior of a DOS program by loading it with special external device drivers. These drivers may operate at either the DOS or BIOS level. When Kermit-MS accesses the BIOS directly, DOS-level drivers are ineffective. When Kermit accesses the hardware directly, both the DOS and the BIOS level drivers are locked out. Kermit-MS provides several mechanisms to allow these external drivers to operate as intended. Here are a few examples: