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, Part 6 of 6 Message-ID: <579@leah.Albany.Edu> Date: 23 Jan 88 21:54:13 GMT References: <20064@amdcad.AMD.COM> <574@leah.Albany.Edu> <575@leah.Albany.Edu> <578@leah.Albany.Edu> Organization: The University at Albany, Computer Services Center Lines: 282 ------------------------------------------------------------------------------- - IBM's ANSI.SYS console driver operates at the DOS level. It allows the major IBM PC keys to be redefined, and also interprets selected ANSI-format escape sequences for screen control. It works fine at Kermit-MS command level, except SHOW KEY does not recognize strings assigned to keys via ANSI.SYS, and fine at CONNECT level. To use ANSI.SYS at CONNECT level, issue the Kermit-MS commands SET KEY OFF (to read keys via DOS) and SET TERMINAL NONE (to display characters through DOS). - Blind people often have speaking or Braille machines attached to their PCs. DOS-level device drivers are generally used to redirect screen output to these devices, which works OK at DOS or MS-Kermit command level. SET TERMINAL NONE will allow this redirection to take place during CONNECT. But these devices also need to have the computer's output appear as a coherent stream of text, so users should also take care to inform the remote host to format its output for a "dumb" or hardcopy terminal. In addition, Kermit-MS' normal file transfer display does not mesh well with these devices, but that can be remedied using SET DISPLAY SERIAL. - People with motor impairments may be using special keyboard replace- ments supported by DOS-level device drivers. As with ANSI.SYS, Kermit-MS may be directed to use such keyboard drivers with the com- mand SET KEY OFF. - Other keyboard drivers are available that work, like Kermit-MS, at BIOS level. Examples include ProKey and SuperKey. These may be used at DOS or Kermit-MS command level as well as during CONNECT. - Conceivably, drivers exist that allow DOS communication programs to emulate terminals other than ANSI. You should be able to use them, if they exist, in conjunction with Kermit-MS by telling Kermit to SET TERMINAL NONE, but the speed may not be high because of the interven- ing DOS call. 1.16.3. Kermit-MS/IBM Serial Port Information Kermit-MS for IBM PC's and compatibles does testing of serial ports before use. This section describes those tests so users may understand what Kermit does. When a serial port is selected by the SET PORT COMx command Kermit looks at low memory addresses in segment 40H assigned to hold the base address of each COMx port; COM1 is in word 40:0H, COM2 is in word 40:2H, and so on. If the value in the appropriate word is binary zero then Kermit declares the port to be un- available. Otherwise, Kermit runs read-only (i.e., safe) tests at the base ad- dress to validate the presence of an official 8250 UART chip. If the tests fail Kermit indicates it will do i/o through the slow Bios pathway; some PC clones need to work this way even though the Bios has speed problems even at 1200 baud. Otherwise, interrupt driven i/o will be done through the 8250 UART (that is very fast). There is a special case when a communications board is present, set for COM2, but a normal COM1 serial port is not. Kermit detects this situation, issues a short notice and uses the available COM2 board. Many machines now have more than two serial ports, yet there is no standard about addresses for COM3 and COM4. PC DOS 3.30 does not assign them either be- cause it is really a problem of the system ROM Bios boot code run when the power is turned on. However, Kermit will use COM3 and/or COM4 if the base ad- dress of a port is placed in low memory words 40:4H (COM3) or 40:6H (COM4); the tests described above are then carried out. One restriction is that the Inter- rupt ReQuest number (IRQ in the serial port board manual) must be IRQ4 for COM3 (and for COM1) and IRQ3 for COM4 (and for COM2). Check the board and its manual. DOS utility DEBUG can be used to create a short program to insert the board's addresses into the segment 40H memory locations; a sample program is given below. ------------------------------------------------------------------------------- Serial Port Base Address IRQ Conventions COM1 03F8H 4 IBM standard COM2 02F8H 3 IBM standard COM3 ? 4 Board, Kermit wants IRQ4 COM4 ? 3 Board, Kermit wants IRQ3 Table 1-11: IBM PC/XT/AT Serial Port Numbers ------------------------------------------------------------------------------- The addresses shown as query marks are to be found in the board's reference manual; values such as 2E8H and 2E0H would be common. However, there is no standard for anything to do with COM3 and COM4. Assuming that you have selected an address in harmony with the rest of the sys- tem (good luck on that part), set the board's switches or jumpers, and use DEBUG to insert the address(es) in segment 40H memory. The example below creates a small program named SETCOM3.COM to put address 02E8H into the memory word 40:04H for COM3 and writes the program to drive A. (Disregard the xxxx items below): A> DEBUG don't type these comments -n a:setcom3.com sets name of output file -a assemble command xxxx:100 mov ax,40 value 40h xxxx:103 mov es,ax put it into register es xxxx:105 mov ah,02 the 02 part of 02E8H xxxx:107 mov al,e8 the E8 part of same xxxx:109 es: xxxx:10A mov [4],ax store in 40:4 for com3 ([6] for com4)> xxxx:10D int 20 return to DOS xxxx:10F blank line to end assemble mode -r cx show contents of register cx CX 0000 : 0f set register cx to write 0fh bytes -w write material to the disk file -q quit debug A> DEBUG setcom3.com -u unassemble to see if all is well -q quit debug Note, for COM4, use [6] above rather than [4], and of course employ your board's port address in place of 02E8H (check the manual). Finally, try it: A> setcom3 run the program A> DEBUG now see what's down there -d 40:00 display bytes in seg 40H ( Shows many bytes. See yours? Good. ) -q A> A small side effect noted in practice is the first time the extra port is used there may be garbage from it. Just return to the Kermit prompt and try again, if necessary SET PORT to the other COM lines momentarily, all should be well the second time. More technical comments, for those with an interest. When Kermit finishes with a port it disables interrupts for that serial port and returns the IRQ signal line to its state found when Kermit started since many devices can share the same Interrupt ReQuest line but only one device at a time can be active on an IRQ. If you find that transmissions are good but there is no reception then another device has stolen the IRQ; disable it or find a guru. Kermit will work with non-standard addresses for COM1 and COM2 but the IRQ's must be as in the table above. Accessing a non-existent port produces a message and all com- munications are discarded safely in the bit bucket. 1.16.4. CTTY COMx for IBM Machines The DOS command CTTY COMx redirects the standard input and output from the keyboard and screen, respectively, to the indicated communications channel. If a Kermit Server is operated this way, "through the back port", then both DOS and Kermit can access the port hardware simultaneously; a deadlock develops on IBM machines. The items below refer to only the IBM version of Kermit-MS. Kermit-MS/IBM version 2.30 successfully resolves the deadlock in the following manner. When Kermit requires the serial port it also attaches itself to Inter- rupt 16H, the Bios RS232 serial port routine. Code within Kermit receives the DOS serial port requests via Interrupt 16H and either passes the request to the Bios if the COM line is not that used by Kermit or it handles the request in- ternally for conflicting situations. When the same port is used by both DOS and Kermit, Kermit discards DOS output material (typically a prompt, but could be the dreaded Abort, Retry, Ignore message) and returns a success code to DOS, it returns an ascii Backspace code to DOS read requests (this is a key item to keep DOS complacent while Kermit communicates), and it returns reasonable status for modem status. The interception ceases when Kermit releases the port, such as when the Kermit prompt is displayed, and this lets DOS converse out the serial port. It is worth restating that a large number of programs bypass DOS to achieve higher performance. When such programs are started through the back door they may still require input from the real keyboard and will hang, waiting for it. There is nothing to do about this situation except a) don't let it happen, b) contact the local operator to push some keys. Kermit-MS is not a Bulletin Board Server. 1.16.5. Screen Sizes and the EGA Board, IBM Versions Support has been included for Enhanced Graphics Adapter (EGA) video display boards which can be configured for other than the standard 80 columns by 25 lines, say 132 columns or 43 lines or other. Three boards, the Tseng Labs EVA board with the 132 column kit installed, the ATI EGA Wonder, and the Video 7 Deluxe, can be controlled directly by Kermit for 80/132 column changes. Other boards need to be placed in the desired display mode by the user. Kermit then adapts to the settings if the board obeys standard rules for using the Bios EGA memory areas in segment 40H. The Video-7 Vega Deluxe board has been used suc- cessfully in all screen sizes, including 132 columns by 43 lines, with an NEC Multisync monitor. The IBM EGA board has several noteworthy bugs which are now standards. One is the cursor dots are not always on the correct scan lines when the number of screen lines is other than 25. Kermit-MS attempts to compensate for this at- tribute. Screen roll back space is fixed in size so there are fewer pages for more dense screens; standard screens use an internal buffer, non-standard screens use a buffer plus video page 1. ANSI.SYS is hard coded for 25 line dis- plays so all DOS i/o will eventually overwrite itself on line 25; the emulator does not use DOS i/o. Commercial replacements for ANSI.SYS should be able to use all screen lines. Screen dumps work correctly if done with Kermit commands. DOS PrintScreen may or may not, depending on your EGA board. When the VT102 receives escape sequences to change between 80 and 132 column modes the screen is reset and the Tseng Labs, ATI, or Video 7 board is asked to change modes (but only if that board is present); other display adapters are left in their current state. The right margin is enforced strongly so a board in 132 column mode will not display material to the right of column 80 if the emulator is in 80 column mode. Similarly, material to the right of column 80 is not preserved in the emulator if the display adapter is operating in 80 column mode; real VT102s keep that invisible material in hardware memory whereas the emulator does not. Reference is made to line 25 in the emulator; this is normally the status/mode line in Kermit. Real VT102's have only 24 line displays. If the display adapter is set for a different number of lines per screen then the 25th line is interpreted to mean the bottom display adapter line, such as line 43. Should the host access the status/mode line then the line is declared to be disabled (same as SET MODE OFF) so that Kermit's own status information does not over- write the host's when the screen is restored. Toggling a disabled mode line has no effect; only SET MODE ON will enable it again. The Heath-19 terminal has the unusual feature that disabling the mode line (ESC y 1) also clears it. 1.16.6. Kermit-MS/IBM Printer Control The IBM PC MS-Kermit VT102 terminal emulator also supports full transparent printing of 8-bit binary bytes. The escape sequence "ESC [ 5 i" turns on transparent printing, in which all further 8-bit characters are sent directly to the printer, bypassing the SET TRANSLATION INPUT filter, and are not shown on the screen. Escape sequence "ESC [ 4 i" turns off transparent printing and the escape sequence is not sent to the printer. Non-transparent printing is controlled by the "ESC [ ? 5 i" and "ESC [ ? 4 i" sequences. Such printing simply duplicates text intended for the screen, excluding escape sequences. The text also appears on the screen. Kermit-MS accesses the system printer through DOS calls several ways; neither the Bios nor the hardware are used. Files directed to the printer by the SET DESTINATION PRINTER command are written by opening a file with the name PRN (DOS's name for the system printer) and writing to it the same as to a disk file; DOS provides limited buffering. LOGging to device PRN works the same way, as can be noticed by the last line or so not being printed until the log file is CLOSED. DOS is used again while emulating a terminal in CONNECT mode. If the VT102 emulator found in the IBM PC is used for transparent or Controller printing (via arcane escape sequences sent from the host) single characters are written to DOS file handle 4, the DOS standard print device. If the screen is echoed to the printer via the typical Control PrtSc key combination, or equiv- alent, single characters are written by the DOS function 05H Printer Output call. In both cases of terminal emulation the printer's ready status is found by the DOS IOCTL 44H call. Only the Control PrtSc case results in the PRN mes- sage being displayed on the status line. Finally, the classical IBM PC Shift PrtSc command to copy the whole screen to the printer is unknown to Kermit be- cause the system Bios traps the key combination and does not tell Kermit about it. If the Control P command is given to DOS before Kermit starts then again characters are echoed by the system Bios without Kermit's knowledge; this situation can result in lost characters. Print spoolers generally operate by being told an existing filename and then in the background they steal cpu cycles to read from disk and write to the printer. The DOS PRINT command invokes such a spooler. Although an active Kermit does not feed these software programs directly the spooler and Kermit can compete for cpu cycles and characters can be lost. If a non-DOS resident program intercepts characters destined for the printer device and spools them Kermit does not know about it and similar competion can occur. During file transfers printing is carefully sequenced to occur only when the local Kermit is in control of the communications line so that a small pause will not result in missing characters arriving at the serial port. When ter- minal emulation is active then printing competes for cpu time with the serial port routines. Generally, the serial port wins such contests if the port is interrupt driven (Generic Kermit is not interrupt driven, so beware). However, the printing itself can use enough cpu cycles to delay processing of characters to the screen and eventually the receive buffer of the serial port fills to the high water mark and an XOFF flow control character is sent to the host to suspend further transmissions until we send an XON. If FLOW is NONE then ex- pect lost characters at the serial port. Experience with ordinary IBM PC's through 80386 machines at very high baud rates indicates no characters are lost when FLOW is XON/XOFF. However, it is possible on some machines for the printer to have priority over the serial port, and hence to have lost charac- ters, especially if a Terminate Stay Resident program intercepts characters destined for the printer and keeps interrupts turned off too long. ------------------------------------------------------------------------------- That's all! Enjoy! Eric M. Boehm