home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / c-kermit / ckiker.txt < prev    next >
Text File  |  2020-01-01  |  16KB  |  331 lines

  1. PREFACE
  2.  
  3. Most of this short introduction to C-Kermit is by Jack Rouse of the
  4. Software Distillery and SAS Institute.  The current supporter of Amiga
  5. Kermit is Stephen Walton, reachable via email as
  6. "stephen.walton@csun.edu" on the Internet.
  7.  
  8. INTRODUCTION
  9.  
  10. This version of Amiga Kermit is a port of the Unix C-Kermit which attempts
  11. to reproduce as much of the functionality of Unix version as possible.  I
  12. had two main goals in porting C-Kermit:  I wanted a reliable remote file
  13. transfer utility, and I wanted to investigate the use of the AmigaDOS
  14. and Exec environments.
  15.  
  16. Amiga Kermit currently provides a line oriented user interface.  I currently
  17. have no specific plans to implement menuing, but there are several places in
  18. Kermit where a menu interface would be an asset.  In this version of Kermit,
  19. I have concentrated on the functional aspects.
  20.  
  21. As I have stated before, this is a port of the Unix C-Kermit.  The
  22. definitive documentation is the book, "Using C Kermit," by Frank da
  23. Cruz and Christine Gianone.  Therefore, only Amiga specific features
  24. are noted below.
  25.  
  26. INVOKING C-KERMIT
  27.  
  28. Amiga Kermit is usually invoked from a CLI process.  However, you can
  29. also start it from a Tool type icon.  Create a Tool icon, called
  30. Kermit.info, and make sure that it contains a ToolType entry for
  31. WINDOW= followed by some window specification.  This is actually a
  32. small dummy window, as C Kermit will open and use its own window.
  33.  
  34. From a CLI window, you generally enter:
  35.    KERMIT
  36. or
  37.    RUN KERMIT
  38. to execute Kermit and start up the Kermit command interpreter.  Make sure
  39. you set your stack to at least 10000 with the AmigaDOS Stack command first.
  40. Kermit will create its own window and greet you with:
  41.  
  42.    Executing s:CKERMIT.INI for Amiga...
  43.     Services directory is s:CKERMIT.KSD
  44.    Executing s:CKERMOD.INI...
  45.    Good Evening.
  46.    C-Kermit 6.0.192, 6 Sep 96, for Commodore Amiga (SAS/C)
  47.     Copyright (C) 1985, 1996,
  48.      Trustees of Columbia University in the City of New York.
  49.    Default file-transfer mode is TEXT
  50.    Type ? or HELP for help.
  51.    [Work:src/kermit/ck/192] C-Kermit>
  52.  
  53.    assuming that you are using the default distributed S:CKERMIT.INI file.
  54. The cursor will appear following the C-Kermit> prompt.  Typing ? will
  55. produce a list of the items that can be entered at any point.  Typing ?
  56. here will produce a list of commands:
  57.  
  58.  add           directory     introduction  quit          stop
  59.  answer        disable       kermit        read          suspend
  60.  apc           do            local         receive       switch
  61.  ask           echo          log           redial        take
  62.  askq          eightbit      lookup        reget         translate
  63.  assign        enable        mail          reinput       transmit
  64.  bug           end           minput        remote        type
  65.  bye           evaluate      mmove         rename        undefine
  66.  cd            exit          move          resend        version
  67.  check         finish        msend         retrieve      wait
  68.  clear         for           msleep        return        while
  69.  close         get           news          run           who
  70.  comment       getc          open          save          write
  71.  connect       getok         output        script        write-line
  72.  date          goto          pause         send          xecho
  73.  declare       hangup        pdial         server        xif
  74.  decrement     help          print         set
  75.  define        if            psend         show
  76.  delete        increment     push          space
  77.  dial          input         pwd           statistics
  78. or one of the tokens: !#;:@
  79.  
  80. Typing ? at various points during command entry will help you navigate
  81. through the command processor.  The 'help' command is also quite useful.
  82. Typing 'help' alone gets information about command entry:
  83.  
  84.   C-Kermit 6.0.192, 6 Sep 96, Copyright (C) 1985, 1996,
  85.   Trustees of Columbia University in the City of New York.
  86.  
  87.     Type INTRO   for a brief introduction to C-Kermit.
  88.     Type VERSION for version and copyright information.
  89.     Type HELP    followed by a command name for help about a specific command.
  90.     Type NEWS    for news about new features.
  91.     Type BUG     to learn how to get technical support.
  92.     Press ?      (question mark) at the prompt, or anywhere within a command,
  93.                  for a menu (context-sensitive help, menu on demand).
  94.  
  95.     From system level, type "kermit -h" for help about command-line options.
  96.    
  97.   DOCUMENTATION: "Using C-Kermit" by Frank da Cruz and Christine M. Gianone,
  98.   2nd Edition, Digital Press / Butterworth-Heinemann 1997, ISBN 1-55558-164-1.
  99.   To order: +1 212 854-3703 or +1 800 366-2665.  PLEASE PURCHASE THE MANUAL.
  100.   It shows you how to use C-Kermit and answers your questions; sales of this
  101.   book are the primary source of funding for C-Kermit development and support.
  102.  
  103. but 'help' can be used with command lines to get command descriptions.  For
  104. example:
  105.  
  106.    C-Kermit>help bye
  107.    Shut down and log out a remote Kermit server
  108.  
  109. The Kermit command processor is normally exited with the 'EXIT' command.
  110. During Kermit protocol, you can type CTRL-C or CTRL-D to interrupt and
  111. exit Kermit.  Depending on the version of the C runtime libraries used
  112. to link Kermit, the interrupt may also be active during command input, but
  113. it is disabled during connect mode.  You will get a requestor when the
  114. interrupt is activated to allow you to choose to continue Kermit.  However,
  115. any serial read or write that was interrupted will still be aborted.
  116.  
  117. Kermit can also be used without the command processor by specifying an
  118. action on the command line.  You can enter 'kermit -h' at the CLI prompt
  119. to get a list of command line options.  However, unless input is redirected,
  120. or the -q (quiet) option is specified, Kermit will still create a window
  121. for protocol monitoring and interruption.  'KERMIT <*' can be used to
  122. run Kermit completely within the CLI window; however, this does not allow
  123. you to enter control characters, and no console input is seen until you
  124. enter return.  Input and output can be redirected to files to take advantage
  125. of C-Kermit command line file transfer options.  Unfortunately, AmigaDOS
  126. does not implement pipes (yet).
  127.  
  128. KERMIT INITIALIZATION AND SERIAL SETTINGS
  129.  
  130. Amiga Kermit uses the serial device or a reasonable emulation thereof.
  131. Three sources are used to initialize the serial parameters.  First, the
  132. default serial configuration, as set by Preferences, is copied.  This
  133. includes baud rate, and under version 1.2 of the Workbench, parity, modem
  134. control (7-wire vs. 3-wire), and flow control. Second, command line
  135. parameters can be used to override these settings. For example:
  136.    kermit -b 1200 -p e
  137. can be used to select 1200 baud and even parity independently of the
  138. Preferences settings.  Finally, if the command processor is used,
  139. Kermit looks for a "CKERMIT.INI" initialization file, first in the "s:"
  140. directory, then in the current directory, providing that the disk
  141. containing each directory is present in the Amiga.  The "CKERMIT.INI"
  142. file contains C-Kermit commands which can be used to initialize the
  143. C-Kermit environment as desired.
  144.  
  145. C Kermit is distributed with a default CKERMIT.INI file which you
  146. should always use.  It includes some Amiga-specific initialization;
  147. sugggestions for more are welcome.  CKERMIT.INI also executes the
  148. commands contained in the file CKERMOD.INI, which is searched for along
  149. the same path as CKERMIT.INI itself.  Your personal customization
  150. commands should be done here.
  151.  
  152. The Kermit SET LINE command has a special form in Amiga Kermit, namely:
  153.  
  154. SET LINE device/unit
  155.  
  156. where "device" is the name of a device (including the .device extension)
  157. and "unit" is the unit number.  The default setting is equivalent to
  158.  
  159.    C-Kermit>SET LINE serial.device/0
  160.  
  161. to give a simple example.
  162.  
  163. Kermit allows you to set any baud rate between 110 and 292000 baud;
  164. however, it will complain if the baud rate is nonstandard (I added this
  165. feature after several attempts to use my modem at 12000 baud).  Rates of
  166. 110 and 111 baud are implemented as 112 baud.  Rates above 38400 baud can
  167. be used for connect mode, but they are not very useful for file transfer.
  168. The file transfer rate is limited by packet retries due to transfer
  169. errors, and the overhead time spent constructing packets.
  170.  
  171. Amiga Kermit opens the serial device in exclusive mode by default.
  172. However, an open in shared mode can be forceed by following the name
  173. and unit number on the SET LINE command with "/S";  for example:
  174.  
  175.    C-Kermit>SET LINE SERIAL.DEVICE/0/S
  176.  
  177. This allows other programs, like dialers, to use the serial line at the
  178. same time, without exiting Kermit.  This could also allow in theory a
  179. terminal emulator to be used simultaneously with Kermit.  However, if
  180. two programs are reading from the serial line at the same time, the
  181. results are unpredictable.  Any such program, therefore, would have to
  182. be disabled from reading while Kermit is performing file transfer or is
  183. in connect mode.  For these reasons, Commodore-Amiga strongly
  184. recommends against sharing the serial port, but Amiga Kermit includes
  185. the capability should you need it.
  186.  
  187. Note that Kermit since does its own parity generation and stripping, so
  188. it always sets the serial device to use eight bit characters with no
  189. parity.
  190.  
  191. WILDCARDING
  192.  
  193. Both the SEND command invoked from the Amiga and a GET sent to an Amiga
  194. in server mode use allow wildcarding, in the Unix style.  Thus, '*'
  195. wildcard matches an arbitrary string while '?' matches an arbitrary
  196. character.  Therefore, to get all the C source files which begin with 'cki'
  197. from the Amiga server, you could use the command:
  198.  
  199.    C-Kermit>GET cki*.c
  200.  
  201. Multiple '*' wildcards can be used in a pattern; however, beware that
  202. most Unix C-Kermit's may not completely support this form.  Also, the
  203. wildcarding that is used in local and remote server commands that invoke
  204. AmigaDOS commands is the AmigaDOS form.
  205.  
  206. LOCAL AND REMOTE COMMANDS
  207.  
  208. Amiga Kermit provides several ways to invoke AmigaDOS commands from within
  209. Kermit.  Entering '!' at the Kermit prompt will create a CLI process running
  210. in its own window, and wait for it to terminate.  The form '! command' will
  211. invoke the given command command with its output going to Kermit's window.
  212. There is currently no way to pause the output of commands invoked his way,
  213. other than the stopgap use of the right mouse button.  The form 'REMOTE
  214. HOST command' can be sent to the Amiga server to execute the given command
  215. remotely on the Amiga.  Because of the way AmigaDOS Execute() function
  216. works, commands invoked in either the '! command' or 'REMOTE HOST command'
  217. forms have NIL: as their standard input.  Some AmigaDOS commands that
  218. require input, such as DiskCopy and Format, do not recognize the immediate
  219. end of file that they receive under this condition, causing them to hang.
  220.  
  221. In addition to the methods given above, various AmigaDOS commands are
  222. invoked by local Kermit commands, and generic remote commands.  These
  223. are listed below:
  224.  
  225.    AmigaDOS command    Local command      Remote generic command
  226.    DELETE files        --none--           REMOTE DELETE files
  227.    TYPE files          --none--           REMOTE TYPE files
  228.    INFO                SPACE              REMOTE SPACE
  229.    LIST obj            DIRECTORY obj      REMOTE DIRECTORY
  230.    STATUS              --none--           REMOTE WHO
  231.  
  232. Any parameters to these commands are expected to use AmigaDOS conventions,
  233. including AmigaDOS wildcarding.  Note that in order to pass a '?' through
  234. the C-Kermit command processor, it must be prefixed with a '\'.
  235.  
  236. You can change the current directory of the Kermit process locally with the
  237. CWD command and remotely with REMOTE CWD.  The local CWD command prints
  238. out the name of the current directory afterwards.  If no new directory
  239. is given, the current directory is not changed, so CWD alone can be used
  240. to determine where the current directory is.  (The default CKERMIT.INI
  241. supplied with Kermit creates a prompt with the current dirrectory in
  242. it.)
  243.  
  244. SERVER MODE
  245.  
  246. Amiga Kermit completely implements server mode, including the ability
  247. to execute CLI commands remotely.  Currently CLI commands are executed
  248. with their standard output directed to RAM:PIPE-HOLDER, which is then
  249. written back to the commanding Kermit after the command completes.
  250.  
  251. There are a few limitations on the commands that can be executed remotely.
  252. First of all, if they produce voluminous output, the output should be
  253. redirected (redirection is supported on the REMOTE HOST command line)
  254. to avoid using all free memory for the output file.  However, the
  255. commanding Kermit will probably timeout in the middle of the execution
  256. of any such command.  The best way to use these commands is to
  257.    REMOTE HOST RUN command >outfile parameters
  258. then use REMOTE WHO (which invokes STATUS) to monitor the command for
  259. completion.
  260.  
  261. The input stream for remote commands is NIL:, which is not handled
  262. intelligently by all Amiga commands.  For example, 'REMOTE HOST diskcopy
  263. df0: to df1:' hangs indefinitely while waiting for NIL: to press return.
  264. Finally, since each command is executed in a separate CLI, commands that
  265. set unshared process parameters, like 'cd',  will have null effect (but
  266. 'REMOTE CWD dir' can be used instead).
  267.  
  268. While server mode is active, AmigaDOS requestors are disabled.  This
  269. avoids requiring operator intervention to reset a requestore when the Amiga
  270. server is told to use a file on a disk that does not exist or is write
  271. protected.  However, disabled requestors are currently not inherited by the
  272. CLI processes that the server creates to execute remote commands.
  273. Therefore, a remote AmigaDOS command can still cause the server to become
  274. hung.
  275.  
  276. To shut down the Amiga server, enter BYE or FINISH at the commanding
  277. Kermit.  FINISH exits to whatever level the server was invoked from,
  278. while BYE exits Amiga Kermit altogether.
  279.  
  280. CONNECT MODE
  281.  
  282. Connect mode on Amiga Kermit currently provides you with a standard
  283. AmigaDOS console device window.  Using the default Preferences
  284. setting, this gives a 23 row by 77 column screen.  However, the
  285. MoreRows program allows you to increase the size of the Workbench
  286. window beyond the 640 by 200 default size; increasing the number of
  287. rows by 8 and the number of columns by 16 will allow a 24 row by 80
  288. column Kermit window.  The Amiga console device is used to provide
  289. ANSI terminal emulation.  While you are in connect mode, you can give
  290. single character commands which are prefixed by an escape character
  291. which can be set from within C-Kermit.  By default, the escape
  292. character is CTRL-\.  You can use '<escape>H' to close the serial
  293. device and exit connect mode, which makes the DTR line drop causing
  294. most modems to hang up the phone line.
  295.  
  296. You can currently get a 25 by 80 screen in Kermit by means of a kludge.
  297. Entering the Kermit command line
  298.  
  299.      echo \27[25t\27[80u\27[3x\27[10y\12 
  300.  
  301. activates console device private escape sequences that cause the console
  302. to use a 25 by 80 region, overwriting the borders of the Kermit window.
  303. Using window gadgets will cause the borders to be redisplayed, but the
  304. display can be cleaned up by typing ctrl-L in command mode.  To reset
  305. the window to its normal condition, allowing resizing, use:
  306.  
  307.  
  308.     ECHO \\033[t\\033[u\\033[x\\033[y\\014
  309.  
  310. and then activate a window gadget to refresh the borders.  These commands
  311. can be placed into Kermit TAKE files.
  312.  
  313. In addition to the standard connect mode commands, extra logging control
  314. has been added.  If a session log file is open, the '<escape>Q' sequence
  315. allows you to temporarily suspend logging.  The '<escape>R' sequence
  316. resumes logging if it has been suspended.
  317.  
  318. Features have also been added to prevent deadlocks while in connect mode
  319. due to spurious XOFF's or bad modem control line states.  When connect
  320. mode is unable to send serial output, keyboard characters are queued until
  321. they can be transmitted.  Queuing continues as long as space is available
  322. in the output buffer.  If the buffer, which is 64 characters long, fills up,
  323. the next keyboard input is discarded and the display 'beeps'.  To get out
  324. of a deadlock situation, you can either exit connect mode, or send a break.
  325. In either case, the output queue is flushed, and current serial output
  326. character is given one second to finish transmitting.  If it does not
  327. complete, the output is aborted, and XOFF mode reset as appropriate.  Then
  328. connect mode is exited or a break is sent, as specified.  When output
  329. characters are queued, connect status (accessed by '<escape>S') will
  330. indicate the number of queued output characters.
  331.