home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / CK5A188.ZIP / ckoker.bwr < prev    next >
Text File  |  1993-01-25  |  16KB  |  374 lines

  1. CKOKER.BWR          "Beware File" for C-Kermit Version 5A        -*- text -*-
  2.  
  3.                  OS/2 VERSION
  4.  
  5. Applies to version 5A(188)
  6.  
  7. Last update: Tue Jan 19 15:45:46 1993
  8.  
  9. Authors: Frank da Cruz, Christine M. Gianone, Columbia University.
  10.  
  11.   Copyright (C) 1985, 1992, Trustees of Columbia University in the City of New
  12.   York.  Permission is granted to any individual or institution to use this
  13.   software as long as it is not sold for profit.  This copyright notice must be
  14.   retained.  This software may not be included in commercial products without
  15.   written permission of Columbia University.
  16.  
  17. Report problems, suggestions, fixes, etc, to Frank da Cruz:
  18.  
  19.   Internet: fdc@watsun.cc.columbia.edu  (or)  fdc@columbia.edu
  20.   BITNET/EARN: FDCCU@CUVMA
  21.  
  22. Columbia University Center for Computing Activities
  23. 612 West 115th Street, New York, NY  10025  USA
  24.  
  25.  
  26. DOCUMENTATION
  27.  
  28. C-Kermit 5A is documented in the book "Using C-Kermit" by Frank da Cruz
  29. and Christine M. Gianone, Digital Press, Burlington, MA, USA.  Digital
  30. Press ISBN: 1-55558-108-0; Prentice-Hall ISBN: 0-13-037490-3.  Price: US
  31. $34.95.  In USA, call DECdirect at 1-800-344-4825, refer to order number
  32. EY-J896E-DP.  Available: January 1993.
  33.  
  34.  
  35. THE 16-BIT AND 32-BIT VERSIONS
  36.  
  37. OS/2 C-Kermit can be built in a 16-bit version, which works under both OS/2
  38. 1.x and 2.0, and in a 32-bit version, which works only under OS/2 2.0 and
  39. later.  The SHOW FEATURES command tells you which version you have.
  40.  
  41. The 16-bit version might run out of stack space and crash under certain
  42. conditions (the OS/2 message will be "Stack Overflow").  This is a limitation
  43. of the Microsoft C 6.00 development system it was built with, and of the
  44. underlying 16-bit architecture.
  45.  
  46. The 32-bit version does not (should not) crash, but it can't be used under
  47. OS/2 1.x.  So use the 32-bit version under OS/2 2.00 and later.
  48.  
  49.  
  50. GENERAL LIMITATIONS AND PROBLEMS
  51.  
  52. C-Kermit's performance -- and the performance of any other OS/2 communication
  53. software program -- can be improved significantly by using a 16550 or 16550A
  54. communications port controller (UART) rather than a 8650, 16450, 164C50, or
  55. other unbuffered UART.  Unbuffered UARTs interrupt the CPU once per character,
  56. whereas a buffered UART interrupts only once per 8-14 characters.
  57. Measurements performed during C-Kermit file transfer on an otherwise unloaded
  58. i486/33 processor under OS/2 2.0 show approximately 60% CPU usage with a
  59. buffered UART and 75%-100% using an unbuffered one.  And of course, as with
  60. all other OS/2 applications (and OS/2 itself), a faster CPU and more memory
  61. also help.
  62.  
  63. The public-domain serial communications driver, SIO.SYS, a replacement for
  64. COM.SYS, is supposed to speed up operation of DOS communication programs under
  65. OS/2 (it is not supposed to speed up native OS/2 communication programs like
  66. C-Kermit).  Prior to 14 Jan 93, C-Kermit would not work with SIO.SYS.  On 14
  67. Jan 93, a patch was installed to CKOTIO.C to work around this problem.  You
  68. can tell if you have this patch installed by issuing the SHOW VERSIONS
  69. command: the line "OS/2 Communications I/O" should indicate version 5A(102)
  70. or later, with a date of 14 Jan 93 or later.
  71.  
  72. If you refer to a disk drive that is not ready, or to a file on such a disk
  73. drive, the OS/2 critical error handler might pop up and require action from
  74. the keyboard.  This occurs during execution of commands by inferior processes,
  75. such as DIRECTORY, REMOTE DIRECTORY, DELETE, REMOTE DELETE, etc.  It does not
  76. occur in file transfer operations (e.g. "get a:oofa.txt", when sent to an OS/2
  77. C-Kermit server that does not have a diskette in drive A, will not cause this
  78. problem).  The "hard error box" will put a halt to unattended, scripted
  79. operations, and it also stops the operation of the OS/2 C-Kermit server if
  80. there is no human in attendance.  To work around: add the line "AUTOFAIL=YES"
  81. to CONFIG.SYS.  This eliminates the hard error box, but it applies
  82. system-wide, not just to C-Kermit.
  83.  
  84. The free disk space reported by the SPACE command, and by the OS/2 C-Kermit
  85. server in response to a REMOTE SPACE command, is somewhat smaller than the
  86. free space reported by the OS/2 directory command, because Kermit's report
  87. is based on K bytes.
  88.  
  89. Certain commands that rely on underlying CMD.EXE services, including DELETE
  90. and TYPE, do not accept full pathnames (or, at least they do not pass them
  91. correctly to CMD.EXE).
  92.  
  93. If the PUSH command, and related commands, do not work for you, check the
  94. definition of your OS/2 COMSPEC environment variable.
  95.  
  96. There is no way to change the OS/2 code page after you have started Kermit.
  97. RUN CHCP doesn't do it because it only affects the CMD.EXE process below,
  98. which, of course, exits immediately after running CHCP.
  99.  
  100. Reportedly (by some, but denied by others), if you make your window longer
  101. than 25 lines, scrolling can interfere with the screen colors during terminal
  102. emulation.
  103.  
  104. Printer support.  The good news:
  105.  
  106.  . The PRINT command works.
  107.  . Files can be transferred to PRN in the 32-bit version only.
  108.  . LOG SESSION PRN works in the 32-bit version.
  109.  . The Print-Screen key prints the current terminal emulation screen in the
  110.    32-bit version (not tested in the 16-bit version).
  111.  . Host-initiated transparent print operations work correctly in the 32-bit
  112.    version. 
  113.  
  114. The bad news:
  115.  
  116.  . There is no Print item in the C-Kermit window menu because C-Kermit
  117.    is a character-mode (VIO), rather than Presentation Manager (PM),
  118.    application. 
  119.  . Ctrl-Print-Screen has no effect.
  120.  . Host-initiated print operations are presently ignored by the 16-bit
  121.    version (because if they are not ignored, they cause a stack overflow).
  122.  . The following host-initiated print operations are not supported:
  123.    - ESC [ 0 i    (print current screen)   
  124.    - ESC [ 1 i    (print current line)
  125.    - ESC [ ? 5 i  (autoprint is treated like transparent print)
  126.  . Print operations, when attempted on an OS/2 system that has no printer
  127.    installed, can hang the Kermit program.
  128.  
  129. Wish list:
  130.  
  131.  . Make screen rollback instantaneous, as in MS-DOS Kermit.
  132.  . Add TCP/IP, LAN Manager, and other network support.
  133.  . 132-column mode for VT102 emulator, using horizontal scrolling if
  134.    graphics adapter does not support 132 columns.
  135.  . VT-320 emulation
  136.  . Tektronix emulation
  137.  
  138.  
  139. COMMUNICATIONS AND DIALING
  140.  
  141. Unless you have a very fast machine (say, 25 MHz or higher), OS/2 and its
  142. serial port drivers are not fast enough to keep up with serial input at 19200
  143. bps unless you have configured your connection for the optimum type of flow
  144. control, preferably RTS/CTS.  Symptoms of lost data include fractured terminal
  145. screens during CONNECT and packet retransmissions during file transfer.
  146.  
  147. SET LINE and SET PORT are synonyms, they do exactly the same thing: select the
  148. communication device.  The syntax is the same for both:
  149.  
  150.   SET LINE [ <device-name> ]
  151.   SET PORT [ <device-name> ]
  152.  
  153. If you omit the device name, C-Kermit reverts to its default communications
  154. device, which is normally COM1.
  155.  
  156. If you include a device name, these commands work as follows:
  157.  
  158.  1. If the device name is a single digit, 1 through 8, C-Kermit converts
  159.     this digit to the corresponding COM port name, COM1 through COM8.
  160.     For example, "set port 2" is converted to "set port com2".
  161.  
  162.  2. If the device name begins with an underscore character (_), and all of
  163.     the following characters are numeric (for example, _12), the number is
  164.     assumed to be a file descriptor for an already-open communication device
  165.     (more about this below).  If the device name begins with an underscore,
  166.     but any non-numeric characters follow, a syntax error results.
  167.  
  168.  3. Any other sequence of characters (including "COM1", etc) is accepted
  169.     literally as a device name. 
  170.  
  171. In cases (1) and (3), C-Kermit attempts to open the device, and then, if
  172. successful, checks to see whether it is a real communications device.  If not,
  173. the SET LINE / SET PORT command fails.  In case (3) (see below), no checking
  174. is done.  NOTE: You can also pass an open file descriptor to C-Kermit on
  175. the command line, e.g. "ckermit -l 4".  See the sample program at the end of
  176. this file.
  177.  
  178. Unless you use the MODE command to change it, the OS/2 communication port
  179. device driver requires DSR and CTS from the modem.  If your modem or
  180. communication device does not provide these signals, you can enable
  181. communication by telling the communication port driver not to require them,
  182. before starting C-Kermit (or in your CKERMIT.CMD file).  For example:
  183.  
  184.   MODE COM2 IDSR=OFF,ODSR=OFF,OCTS=OFF
  185.  
  186. On some machines, C-Kermit may appear to work even though DSR and CTS are
  187. not connected to anything, nor disabled using MODE.  This is because
  188. unconnected input lines tend to "float high".  Although this situation may not
  189. cause any problems, for safety's sake you should still disable these signals,
  190. if they are not legitimate, with the MODE command
  191.  
  192. If you have problems using COM3, COM4, or higher, it is likely that the OS/2
  193. communications manager, through which C-Kermit accesses all serial devices,
  194. does not know the address or interrupt number of your communication port.  You
  195. can specify this information in your OS/2 CONFIG.SYS file, in the line that
  196. starts the serial communication driver, COM.SYS:
  197.  
  198.   DEVICE=C:\OS2\COM.SYS (number,base-address,irq) ...
  199.  
  200. Here is an example that specifies the addresses and IRQs for COM3 and COM4,
  201. and leaves the default values for COM1 and COM2 alone:
  202.  
  203.   DEVICE=C:\OS2\COM.SYS (3,3E8,10) (4,2E8,15)
  204.  
  205. and here is an example that specifies these values for COM1 through COM4:
  206.  
  207.   DEVICE=C:\OS2\COM.SYS (1,3F8,4) (2,2F8,3) (3,3E8,10) (4,2E8,15)
  208.  
  209. Warning: the addresses and IRQs for COM3 and COM4 are not standardized, and
  210. can vary depending on the design and configuration of your communication
  211. board.  Consult the documentation that came with your communication board.
  212.  
  213.  
  214. TERMINAL EMULATION
  215.  
  216. SET DEBUG SESSION is currently not supported.
  217.  
  218. Various VT102 terminal features are not supported, including:
  219.  
  220.  . Blink
  221.  . Smooth scroll
  222.  . Switching between 80- and 132-column mode
  223.  
  224. and others are simulated:
  225.  
  226.  . Double-width and double-height lines
  227.  . Underlining
  228.  
  229. Scrolling is slow in an OS/2 Window.  This is because OS/2 is operating in
  230. graphics mode and must draw each dot (pixel) individually.  (Reportedly, IBM
  231. will be improving the speed in a forthcoming update of the screen manager --
  232. the new "graphics engine" that will be part of OS/2 2.00.1.)  Scrolling is
  233. fast if you run C-Kermit fullscreen, which uses character mode rather than
  234. graphics mode.  But when running C-Kermit fullscreen you lose the ability to
  235. cut and paste.
  236.  
  237. The cursor disappears briefly while the screen is being updated and appears
  238. again within a few milliseconds after screen activity stops.  This can be
  239. somewhat disconcerting, but increases the speed of screen updates.
  240.  
  241. SET FLOW XON/XOFF prevents you from transmitting Ctrl-S and Ctrl-Q characters
  242. to the host.  These characters are commands (Search and Quote) in EMACS.
  243.  
  244. If the host sends the escape sequence to put the terminal into 132-column
  245. mode, and subsequently sends data that would appear in the rightmost 52
  246. columns, this may interfere with existing data on the screen.  If C-Kermit is
  247. started in an OS/2 132-column fullscreen session under OS/2 2.0 (only possible
  248. on certain video adapters), it will display such data correctly but will
  249. always be in 132-column mode, even if only 80-column mode is used.
  250.  
  251. Key scan codes are not all the same as in MS-DOS Kermit.  Most ordinary keys
  252. have the same codes, but not as many keys are differentiated.  For example,
  253. all combinations of Ctrl, Shift, and Alt with a particular key do not
  254. necessarily produce different scan codes.  Also, there are no \Kverbs as in
  255. MS-DOS Kermit.
  256.  
  257. Shift-in/Shift-Out works only if you SET TERMINAL LOCKING-SHIFT ON.
  258.  
  259. There is presently no way to disable the answerback sequence ("OS/2 C-Kermit").
  260.  
  261. See the file CKOVTK.INI as a sample key mapping file for mapping the PC 101
  262. and 102 numeric keypad to VT102 functions.
  263.  
  264. SET KEY works with the Num Lock key, but several cautions are necessary:
  265.  
  266. 1. Num Lock has two different scan codes: \510 and \766.
  267. 2. Every time you push Num Lock, the scan code toggles.
  268. 3. Every time you push Num Lock, the keypad state toggles.
  269.  
  270. Assigning characters to Num Lock with SET KEY does not change this behavior.
  271.  
  272.  
  273. FILE TRANSFER
  274.  
  275. There is no way send the complete contents of a file in text mode if the file
  276. contains a Ctrl-Z character that is not the last character in the file.  In
  277. other words, Ctrl-Z is always treated as end-of-file when the FILE TYPE is set
  278. to TEXT.  There should be a SET EOF {CTRLZ, NOCTRLZ} command as in MS-DOS
  279. Kermit to control the treatment of Ctrl-Z characters in text files.
  280.  
  281. Be sure to activate the appropriate type of flow control before transferring
  282. files, especially if you are using long packets:
  283.  
  284.   SET FLOW RTS/CTS
  285.     Preferred, if the device your PC is immediately connected to supports it.
  286.  
  287.   SET FLOW XON/XOFF
  288.     Used end-to-end, but subject to noise corruption, propogation delays, etc.
  289.  
  290. By default OS/2 C-Kermit uses whatever flow control is already configured
  291. for the communications port driver at the time you started C-Kermit.
  292.  
  293.  
  294. HINTS and TIPS:  INVOKING C-KERMIT FROM ANOTHER PROGRAM
  295.  
  296. If you are writing a communications program and wish to incorporate the Kermit
  297. protocol within it, one way is to use the OS/2 function call DosExecPgm to
  298. call up C-Kermit.  You would supply the instructions for Kermit using
  299. command-line options, and Kermit would do the transfer, returning back to your
  300. program when it had finished.
  301.  
  302. The only problem with this scenario is that you might already have opened up
  303. the COM port within your program, so that when Kermit tries to do the same it
  304. gets an error code back from DosOpen.  The -l command line option gets round
  305. this problem.  It uses the fact that a child process inherits the open file
  306. handles of its parent.  -l takes one numeric parameter which is the handle of
  307. the COM port in question, and it must occur in front of any other command-line
  308. parameter which accesses the COM port.  The following is a complete C program
  309. written using the Microsoft C compiler version 5.1 and the Microsoft OS/2
  310. Software Development Toolkit, which illustrates how to use the -l command-line
  311. option.
  312.  
  313. #define    INCL_BASE
  314. #include <os2.h>
  315. /*
  316.  *    Example of how to use the C-Kermit -l option to invoke
  317.  *    Kermit from another program under OS/2.
  318.  */
  319. main(int argc, char *argv[]) {
  320. HFILE    ttyfd;
  321. USHORT    action;
  322. int    err,i;
  323. char    failname[80];
  324. char    args[80];
  325. RESULTCODES    res;
  326. struct dcb {            /* Device control block */
  327.     USHORT write_timeout;
  328.     USHORT read_timeout;
  329.     BYTE flags1, flags2, flags3;
  330.     BYTE error_replacement;
  331.     BYTE break_replacement;
  332.     BYTE xon_char;
  333.     BYTE xoff_char;
  334. } ttydcb;
  335.  
  336.     /*** Open a file ***/
  337.     if (err=DosOpen(argv[1],&ttyfd,&action,0L,0,1,0x0012,0L)) {
  338.         printf("Error %d opening %s\n",err,argv[1]);
  339.         exit(1);
  340.     }
  341.     if (err=DosDevIOCtl(&ttydcb,NULL,0x0073,1,ttyfd)) {
  342.         printf("Error %d from IOCTL on %s\n",err,argv[1]);
  343.             exit(1);
  344.     }
  345.     ttydcb.flags3 &= 0xF9;
  346.     ttydcb.flags3 |= 0x04;    /* Read "some" data from line */
  347.     DosDevIOCtl(NULL,&ttydcb,0x0053,1,ttyfd);
  348.  
  349.     /*** Call kermit ***/
  350.     strcpy(args,"ckermit");
  351.     i = strlen(args);
  352.     args[i++]=0;
  353.     sprintf(&args[i],"-l %d -q -s test.c",ttyfd);
  354.     i += strlen(&args[i]);
  355.     args[i++]=0;
  356.     args[i++]=0;
  357.     if (err=DosExecPgm(failname,80,EXEC_SYNC,args,NULL,&res,
  358.                             "CKERMIT.EXE")) {
  359.         printf("Error %d executing Kermit\n",err);
  360.         exit(1);
  361.     }
  362.     
  363.     /*** Print out return code ***/
  364.     printf("Termination code %d\n",res.codeTerminate);
  365.     printf("Result code %d\n",res.codeResult);
  366.  
  367.     /*** Close the file ***/
  368.     if (err=DosClose(ttyfd)) {
  369.         printf("Error %d closing %s\n",err,argv[1]);
  370.     }
  371. }
  372.  
  373. (End of CKOKER.BWR)
  374.