home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / com / utils / m2zmodem / m2zmodem.doc < prev    next >
Text File  |  1992-05-22  |  49KB  |  1,082 lines

  1. M2ZMODEM 2.12
  2. =============
  3.  
  4. Introduction
  5. ============
  6.    M2ZMODEM is a stand alone ZModem file transfer protocol for OS/2. 
  7. The primary intention is to supply other terminal programs or BBS's
  8. with the advanced Zmodem protocol, even if it is possible to use
  9. M2ZMODEM as a terminal program too, by invoking the terminal feature
  10. in this program.  The terminal functions are quite limited, but
  11. includes scripting, ZModem AUTO up and download.  The scripting
  12. ability makes it possible to auto dial, logon and much more.
  13.    The source is written in Modula-2 and compiled with JPI TopSpeed
  14. Modula-2 OS/2-compiler.
  15.  
  16.  
  17. Installation
  18. ============
  19.    The program was developed in the IBM OS/2 Extended Edition 1.20
  20. environment, but should work with any OS/2 version.  It uses the
  21. COM0x.SYS driver delivered with the operating system.  Install
  22. M2ZMODEM by:
  23.  
  24. *   Copy the files into any subdirectory on your harddisk (we use
  25.     C:\M2ZMODEM here as an example).
  26.  
  27. *   If you want to alter the default messages to another language,
  28.     you should copy the appropriate MSG-file, to M2ZMODEM.MSG.
  29.     There are different MSG-files included for different languages.
  30.     They are named "MSG.xxx" there xxx is replaced by a country
  31.     code.  To get swedish messages, you should type "COPY MSG.SV
  32.     M2ZMODEM.MSG".  The default language is english (if you miss
  33.     "your" language, please contact me and we could work it out).
  34.  
  35. *   Add this directory in your PATH and DPATH, either in your
  36.     CONFIG.SYS file or in a CMD-file (with the command
  37.     "SET DPATH=%DPATH%C:\M2ZMODEM;").
  38.  
  39. *   Add the line "DEVICE=C:\OS2\COM01.SYS" if you have an AT-
  40.     compatible system, or "DEVICE=C:\OS2\COM02.SYS" if you have
  41.     a PS/2 compatible system.
  42.  
  43. *   If you run OS/2 1.3 or earlier, and plan to use baudrates
  44.     higher than 19200 baud, insert the line "IOPL=SETBAUD" or
  45.     "IOPL=YES" in your CONFIG.SYS.  This will only work for
  46.     standard COM1 and COM2 ports.
  47.  
  48. *   If you plan to use the BBS protocol driver, with the SHELL
  49.     option, you should consider putting "AUTOFAIL=YES" in your
  50.     CONFIG.SYS (for OS/2 1.2 or later).  See more about this below
  51.     (BBS protocol driver).
  52.  
  53. *   Reboot your system.
  54.  
  55.    Now you should be ready to run M2ZMODEM.  You start the program
  56. by typing "M2ZMODEM" at the command prompt.  You may give several
  57. options on the command line, described below.  The program uses the
  58. three environment variables "M2Z", "RZ" and "SZ" if they exists.  The
  59. M2Z variable is always merged to the command line, when M2ZMODEM is
  60. started.  If you select to send by M2ZMODEM the environment variable
  61. "SZ" is also merged to the command line, and if you select receive
  62. the variable "RZ" is merged.
  63.    An example on how to use these environment variables is showed
  64. below:
  65.  
  66. SET M2Z=-l COM1 -b 19200 -h
  67. SET RZ=C:\DOWNLOAD\
  68. SET SZ=C:\UPLOAD\*.*
  69.  
  70.    You may now start a download by just typing "M2ZMODEM -r" on the
  71. command line, or start a upload by typing "M2ZMODEM -s".
  72.  
  73.    This program will only run in a OS/2 full screen or a Presentation
  74. Manager Text window, except for the optional Presentation Manager
  75. status window, which only runs with Presentation Manager.  Note that
  76. the terminal feature performance is decreased when running in a
  77. Presentation Manager text window.  ZModem file transfer is not
  78. affected by this, but the Presentation Manager status window
  79. processing does load the file transfer thread a little, which could
  80. affect performance when running high speed communications.  If you
  81. get performance problems, showing by extensive resending while
  82. receiving files, even if the communication connection is perfect, you
  83. should try to NOT load the PM status window.  You should also
  84. consider buying an enhanced 16550 UART.
  85.  
  86.    If you run OS/2 1.2 there is a potential problem for you.  The
  87. first COM0x-drivers supplied with the operating system, has com-
  88. patibility problems which makes it impossible to use the driver in
  89. hardware handshaking mode (the "-h" option).  If you have to use
  90. hardware handshaking, I recommend you to use the COM0x-driver
  91. supplied with OS/2 1.1.  There are no conflicts using the OS/2 1.1
  92. driver for OS/2 1.2.
  93.    If you run OS/2 1.2 or later, the program will automaticly fully
  94. use the extended hardware buffering in the 16550 UART, if existing. 
  95. One potential problem in using the hardware buffering capabilities
  96. is that the hardware handshaking has a slower response time, because
  97. the driver send up to 16 characters after a hardware handshaking
  98. signal.  This should not be any big problem, because in the most
  99. cases you want to enable the hardware handshaking to communicate with
  100. modern high speed modems, with a higher DTE/DCE rate than the link
  101. speed.  These modems have buffering capabilities, and they usually
  102. allow this behaviour.
  103.  
  104.  
  105. Performance
  106. ===========
  107.    During development special care was taken to manage high speed
  108. file transfers in background operation.  Performance tests have
  109. proved that there are no problems to perform file transfers with
  110. about 1700 cps throughput over a 19200 baud connection, from the COM1
  111. device to the COM2 device in background operation (not using the
  112. extended hardware buffering).  This means that the computer was busy
  113. with both receiving and sending during the tests.  A 16 Mhz 386/SX
  114. computer was used for the performance tests.  Disk I/O is internally
  115. buffered in blocks of 16 kB.  The performance is reduced a lot if the
  116. operating system begins to swap memory to the harddisk during a file
  117. transfer.  This situation is not recommended.
  118.  
  119.  
  120. Start options
  121. =============
  122.    When starting the program you may use the following options:
  123.  
  124. -a fn    Executes script file specified by "fn".  Only valid if you
  125.          invoke the terminal feature by the "-i" option.
  126.  
  127. -b n     Select baudrate specified by "n" (n=decimal value between
  128.          110 and 19200, as specified in the COM0x.SYS documentation). 
  129.          If not specified the system default will be used.
  130.  
  131. -c       The file transfer will be directly followed by another, do
  132.          not send ZFIN to close ZModem connection.  If not specified
  133.          the ZFIN header will be sent.
  134.  
  135. -d       Suppress checking for carrier loss.  If not specified the
  136.          program will abort if carrier loss is detected.
  137.  
  138. -e env   Searchs for the environment variable "env" and merges this
  139.          to the command line options.  It is possible to merge
  140.          several environment variables into the same command line. 
  141.          By using the OS-command SET, one may simplify the startup
  142.          options for M2Z.
  143.  
  144. -f n     Scan for COMx file handles and select the n'th found for
  145.          communication (n=decimal 0 < n < 65536).
  146.  
  147. -h       Enables hardware handshaking CTS/RTS.  Software handshaking
  148.          by Xon/Xoff is always enabled.
  149.  
  150. -his     Enables history logging.  Only used in combination with the
  151.          "-i" option.  When enabled, it is possible to scroll
  152.          backwards to see old lines.  This is done by putting the
  153.          keyboard in ScrollLock-mode, and press the Up-arrow key. 
  154.          This feature creates a file called M2ZMODEM.HIS, that may
  155.          be inspected after the program is terminated.  This option
  156.          might slow down execution.  Default is to disable this
  157.          option.
  158.  
  159. -i       Invokes the on line terminal feature.
  160.  
  161. -l dev   Select device specified by "dev" for communication.
  162.  
  163. -n       No sound when file transfer complete.  Normally a beep is
  164.          performed before program ends.
  165.  
  166. -o fn    Place log information in file specified by "fn".  Note that
  167.          the file "fn" is incremented without any warning, if the
  168.          file exists.
  169.  
  170. -p n     Specifies which translate table to use for the terminal
  171.          session.  The "n" parameter is equal to the COUNTRY
  172.          parameter specified in the CONFIG.SYS file.  If "n" is set
  173.          to zero, no translation will occur.  If this option is not
  174.          specified the system country code will be used.  This option
  175.          is only acted on if you invoke the terminal feature. 
  176.          Currently only country 001, 046, 047 and 358 is implemented
  177.          (US/Sweden/Norway/Finland).  Other country codes use the
  178.          USA character set.
  179.  
  180. -pm      Loads the Presentation Manager status reporting window.
  181.  
  182. -prot x  Specify another file transfer protocol.  The default
  183.          protocol to use is Zmodem, but by specifying this parameter
  184.          you may select the one indicated by "x".  Replace "x" by
  185.          XMODEM, XMODEM1K, YMODEM, YMODEMB, YMODEMG, YMODEMGB for
  186.          Xmodem, Xmodem/1K, Ymodem, Ymodem Batch, Ymodem-G or Ymodem-
  187.          G Batch.  By replacing "x" with "BBS" you load a user
  188.          interface for the remote system (a BBS protocol driver). 
  189.          This is suitable when you want to use M2Z to handle up and
  190.          downloads in your BBS.
  191.  
  192. -prty x  Specifies that the program should execute with priority x,
  193.          where x is replaced by a decimal value.  Current available
  194.          choices are: 0=Normal priority, 1=Default priority, 2=Time
  195.          Critical priority.  Prty 0 will usually give the best
  196.          result, if you want to work with other programs in the
  197.          foreground (this is the lowest priority).  Prty 2 will give
  198.          the M2Zmodem program a very high priority, resulting in good
  199.          performance in this program, while other programs get very
  200.          little time to execute.  Prty 1 is equal to prty 0 if the
  201.          baud rate is below 9600 and  equal to prty 2 if the baud
  202.          rate is 9600 or higher.  Prty 1 is the default action, but
  203.          I recommend you to try prty 0 first, and see if you
  204.          encounter any problems, and in that case you could switch
  205.          back to prty 1.
  206.  
  207. -q       Suppress status messages and keyboard scanning.  If not
  208.          specified status messages will be displayed and keyboard be
  209.          scanned for operator abort.
  210.  
  211. -r dir   Receive files into path specified by "dir".  If you want to
  212.          download into default directory, specify the "-r" option
  213.          last on the command line, and omit the "dir" parameter.
  214.  
  215. -ren     If the file already exists when receiving, the received file
  216.          will be renamed, with the prefix "1_", "2_" and so on.  This
  217.          is the default action.
  218.  
  219. -res     If the file already exists when receiving, it is assumed
  220.          that the existing file is incomplete, and is incremented by
  221.          the received file.  If the existing file is greater than the
  222.          received file, the received file is ignored.
  223.  
  224. -s fn    Send file(s) specified by "fn".  You may use wildcards to
  225.          specify batch transfers.
  226.  
  227. -skip    If the file already exists when receiving, the received file
  228.          will be skipped.
  229.  
  230. -t       Suppress conversion of file names to upper cases.  Normally
  231.          all file names are converted to all lower cases during send,
  232.          and converted back to all upper cases by the receiver.  By
  233.          specifying this parameter the file names are transfered
  234.          exactly as they appear in the operating system.
  235.  
  236. -u n     Select file handle specified by "n" for communication
  237.          (n=decimal value 0 <= n < 65536).
  238.  
  239.    The options may be placed in any order, but must be separated by
  240. spaces and prefixed with the minus sign.
  241.  
  242.  
  243. Invoking M2ZMODEM from another communication program
  244. ====================================================
  245.   If you want to execute the program from your own communication
  246. program, there are different techniques available for this, depending
  247. on how your communication program is written.  The problem is how to
  248. specify which communication port to use, because some communication
  249. programs does not allow other programs to access the same port as the
  250. communication program.  In any case, the communication program must
  251. have the possibility to execute a child process (DosExecPgm), or
  252. there is no way to invoke the Zmodem software, if you do not exit the
  253. communication program first, and executes Zmodem from the OS/2
  254. command line.
  255.  
  256.    If your software has opened the communication device with the
  257. SHARE mode field set to DENY NONE, you just invoke Zmodem as you do
  258. from the command line, using the "-l" option, by specifying the
  259. device name to use.
  260.  
  261.    If your software has opened the communication device with the
  262. SHARE mode field set to anything else than DENY NONE and has set the
  263. INHERITANCE field set to TRUE, you could try to invoke Zmodem by
  264. specifying the device handle to use, using the "-u" option.  This is
  265. only possible if the communication program used makes the device
  266. handle available to the user.
  267.  
  268.    If your software has opened the communication device with the
  269. SHARE mode field set to anything else than DENY NONE and has set the
  270. INHERITANCE field set to TRUE, but does not make the device handle
  271. available for the user, you could try to invoke Zmodem by using the
  272. "-f" option.  In most cases you should select "-f 1" option, which
  273. makes the Zmodem software scan all available device handles, and
  274. locks to the first appropriate device handle for communications.  If
  275. your communication program only supports one open communication
  276. device at the time, this should work fine.  If on the other hand,
  277. your software supports multiple concurrent open communication
  278. devices, it could be hard to know which occurence to use.  It is NOT
  279. always that way that COM1 is the first occurence and COM2 the second
  280. and so on.  It is rather so that the first occurence corresponds to
  281. the port first opened.  If you program first opens COM2 then COM3 and
  282. last COM1, these ports will correspond to "-f 1", "-f 2" and "-f 3"
  283. respectively.
  284.  
  285.    Any device that is compatible with COM0x.SYS may be used.  The
  286. only restriction is that the device name can not begin with the
  287. percent sign ("%COM10" is illegal).
  288.  
  289.    When M2ZMODEM exits, the return code is set to:
  290.  
  291. 0        If at least one file was sent/received.
  292. 1        If a command line parse error occured.
  293. 2        If send or receive failed.
  294. Zmodem specifikations
  295. =====================
  296.    The baudrate is not limited in the software, but the COM0x.SYS
  297. drivers currently only supports speeds from 110 up to 19200 bauds. 
  298. The communication line is always set to 8 databits, no parity and 1
  299. stopbit.  The line characteristics is restored to its previous
  300. condition when exiting the program (except for the baud rate). 
  301. Software handshaking with Xon/Xoff is always enabled, and hardware
  302. handshaking with CTS/RTS is optionally enabled.  The DTR signal is
  303. always set and RTS is set, if not used for hardware handshaking.  All
  304. these parameters are reset to their previous conditions when exiting.
  305.  
  306.    All filenames are sent exactly as they appear in the operating-
  307. system over the Zmodem protocol (upper and lower cases filenames will
  308. be sent).  Operating systems not supporting both upper and lower case
  309. filenames always send filenames in lower case.  When M2Zmodem
  310. receives files it will try to determine if the filename is a long
  311. filename (if it should permit both upper and lower case filenames). 
  312. If the received filename contains ANY upper case letter, or if it
  313. does not conform to the 8+3 MS-DOS naming convention, it will use the
  314. filename exactly as received, otherwise the filename will be
  315. converted to all upper case.  This means that if you transfer files
  316. between two M2Zmodem programs, the filename will be transmitted
  317. exactly as it appears in the operating system, except if the filename
  318. is ALL lower case, and conforms to the 8+3 format.  By specifying the
  319. "-t" option, you can disable conversion alltogether, resulting in
  320. filenames with all lower case, if it isn't sent by a operating system
  321. supporting both upper and lower case filenames.
  322.  
  323.    The program will select 32 bit CRC error checking if receiver has
  324. indicated this capability.
  325.  
  326.    File compression and decryption is not yet implemented in
  327. M2ZMODEM.  The program escapes control characters as specified in
  328. Omen technology documentation.  8th bit escaping and escaping of all
  329. control characters is not yet implemented.
  330.  
  331.    If a file already exists when receiving, the program may resume
  332. the file (increment it), rename the file or skip it.  The default
  333. action is to rename the file, but this may be altered by the command
  334. line options.  If the file is renamed this is done by giving the
  335. received file name a prefix of "1_", "2_" and so on.  Note that if
  336. you run on a HPFS-drive it is possible that the new file name, will
  337. not conform to the 8+3 standard "old" file name format.  And if you
  338. on the other hand don't run a HPFS-drive, the file name prefix is
  339. truncated to 8 characters.
  340.  
  341.    During a file transfer, it is possible to abort the ZModem session
  342. by pressing the Escape key (if you are lucky).
  343.  
  344.  
  345. OTHER FILE TRANSFER PROTOCOLS
  346. =============================
  347.    The M2ZMODEM program may use other file transfer protocols than
  348. the default (and best) Zmodem protocol.  By specifying the "-prot"
  349. option you may select another.  These currently are:
  350.  
  351. XMODEM            Xmodem.
  352. XMODEM1K          Xmodem with optionally 1024 bytes block length. 
  353.                   While receiving block length is detected automa-
  354.                   ticly, which means there is no difference between
  355.                   XMODEM and XMODEM1K for receive sessions.
  356. YMODEM            Ymodem with optionally 1024 bytes block length. 
  357.                   This is the same as Xmodem, but the file name, and
  358.                   some other parameters are sent to the receiver.
  359. YMODEMB           Ymodem batch, is the same as YMODEM, but a batch
  360.                   file transfer protocol, making it possible to send
  361.                   several files in a session.
  362. YMODEMG           Ymodem-G, is the same as YMODEM, but the protocol
  363.                   does not wait for ACK/NAK between the data blocks. 
  364.                   This protocol should only be used with modems using
  365.                   error correction, because it can't recover any
  366.                   transmission errors.
  367. YMODEMGB          The same as Ymodem-G, but a batch protocol.
  368. BBS               By specifying this parameter, you put M2Z in server
  369.                   mode (BBS protocol driver).  See more about this
  370.                   below.
  371.  
  372.    When not using batch protocols, only the FIRST found file, if you
  373. specify a wild card file specification, is sent.
  374.  
  375.    The Ymodem-G protocol is not recommended for receiving files in
  376. high speeds when not running the program in foreground, because this
  377. protocol does not support error recovery.  There will be a risk of
  378. overruns, making the whole transfer abort.  Generally the ZModem
  379. protocol is the best, and the therefore the effort has been con-
  380. centrated on evaluating a good implementation of this protocol.
  381.  
  382.  
  383. BBS PROTOCOL DRIVER
  384. ===================
  385.    By specifying the option "-prot BBS" you put M2Z in server mode. 
  386. M2Z will display a menu with available protocols on the remote
  387. system, and ask the user to select one of these.
  388.    Then M2Z will ask for which files to up/download.  If the user
  389. specified a batch file transfer protocol, it is possible to use
  390. wildcards and/or specify multiple files, separated by spaces.  After
  391. this, the user will be asked to start his/her file transfer proce-
  392. dure.
  393.    This interface is suitable if you want to install M2Z to handle
  394. up and downloads in your BBS.  The parameters to the "-r" and "-s"
  395. options, should only contain valid path names in this case, and NOT
  396. filenames (it is not necessary to specify any pathname at all).  A
  397. path name is terminated with a backslash.  An example is showed
  398. below:
  399.  
  400. M2ZMODEM -l COM1 -b 19200 -s C:\TXTFILES\ -prot BBS -h
  401.  
  402.    This command line will start M2Zmodem for the COM1 device, 19200
  403. baud, and start the BBS protocol driver, and only pick files from the
  404. C:\TXTFILES\ directory.  Hardware handshaking will be used.
  405.  
  406. M2ZMODEM -l COM1 -b 19200 -r C:\UPLOAD\ -prot BBS
  407.  
  408.    This line will start the BBS protocol driver and put all uploaded
  409. files in the C:\UPLOAD\ directory.
  410.  
  411.    If no action is taken within the BBS protocol driver for about 1
  412. minute, the program is terminated by itself, to prevent a user from
  413. hanging the BBS.
  414.  
  415.    To pass parameters to the BBS protocol driver, there is an
  416. environment string "M2ZBBS" you may set.  The string may contain
  417. several parameters, separated by spaces, or by ";".  Possible
  418. parameters are:
  419.  
  420.          BAUD.xxx Tells the protocol driver to user the baudrate
  421.                   "xxx" (decimal value) to estimate download time. 
  422.                   This parameter does NOT affect the real line
  423.                   characterstics.  If this parameter is not specified
  424.                   the protocol driver will read the real baudrate
  425.                   from the device used.  If "0" is specified, the
  426.                   parameter is ignored, and the real baudrate will
  427.                   be used.
  428.          MAX.xxx  Sets the download limit.  Replace "xxx" with a
  429.                   decimal value.  The string "MAX.512000" would set
  430.                   the download limit to 512000 bytes.  Default is no
  431.                   dwonload limit.
  432.          NODIR    This option disables listing of selected files,
  433.                   before a download.  Only a summary of how many
  434.                   files, and bytes are displayed.  Default is to
  435.                   display a directory.
  436.          PATH.xxx Sets the protocol driver to use the path names in
  437.                   the "xxx" environment string, as download direc-
  438.                   tories.  The "xxx"-environment should contain
  439.                   pathnames terminated by a backslash, separated by
  440.                   ";" or space.  If specified when starting when a
  441.                   user does an upload, only the first path in "xxx"
  442.                   will be acted on.  The environment string "xxx" is
  443.                   only acted on up to the 2048 first characters.
  444.          SHELL.xx Sets the password to access the SHELL command, to
  445.                   "xx".  "xx" may be any string, but only the first
  446.                   15 characters are checked.  The password should NOT
  447.                   contain the ";" character.  If the password is set
  448.                   to "YES", no password check is done at all.  If the
  449.                   password is set to "NO", the user will not be able
  450.                   to shell at all.  Default is to not let the user
  451.                   shell at all.
  452.          TERM.xxx There "xxx" is a terminal name. Available terminals
  453.                   are:
  454.                             ANSI     Sends ANSI-BBS sequences.
  455.                             TTY      Does not send any terminal
  456.                                      sequences at all, but CR, BS and
  457.                                      FF.
  458.                             0        The same as "TTY" above.
  459.                             1        The same as "ANSI" above.
  460.          TIME.xxx There "xxx" is replaced by the amount of time left
  461.                   for the user in seconds.  Default is no time limit.
  462.  
  463.    Be careful with the SHELL option.  Only text applications may be
  464. run in the SHELL, and not even all of the text applications runs well
  465. in the SHELL.  OS/2 commands run well in the SHELL, and some other
  466. programs too.
  467.    If no input or output was made for the last five minutes, the
  468. SHELL will be automaticly closed, and you will be returned to the
  469. HOST menu.
  470.    You always close the SHELL manually by pressing the ESC-key twice
  471. while in the SHELL.  If a program hangs because it was not suitable
  472. to run in the SHELL, you should be able to kill this program by
  473. pressing the ESC-key.
  474.    Note that a SHELL user have a lot of power in your system.  He/she
  475. may delete any files, format disks, change your userlist.
  476.  
  477.    If you plan to use the BBS protocol driver, with the SHELL option,
  478. you should consider putting "AUTOFAIL=YES" in your CONFIG.SYS (for
  479. OS/2 1.2 or later).  This will disable the error pop-ups and give a
  480. error message instead.  This is necessary for the SHELL option,
  481. because error pop-ups can't be fetched by the BBS protocol driver. 
  482. If an hard error occurs while you run the SHELL option, and you have
  483. not enabled the AUTOFAIL option, the program will "hang" awaiting
  484. response from the "real" keyboard.
  485.  
  486.    A setup example is showed below:
  487.  
  488. SET NORMAL=C:\TWIT\;C:\NORMAL\;C:\SECRET\;D:\;
  489. SET EXTRA=%NORMAL%D:\EXTRA\;
  490. SET SYSOP=%EXTRA%D:\SYSOP\;D:\SECRET\;
  491. SET M2ZBBS=TERM.ANSI;MAX.512000;NODIR;PATH.NORMAL
  492. M2ZMODEM -l COM1 -b 19200 -prot BBS -s C:\TWIT\;
  493.  
  494.    This sequence will load the protocol driver, and the user will be
  495. able to download files from the paths specified in the "NORMAL"
  496. environment string.  If you replace the "PATH.NORMAL" string by 
  497. "PATH.SYSOP" the user will be able to download files from the paths
  498. specified in the "SYSOP" environment string instead.  If the argument
  499. passed with "PATH." is not valid like "PATH.UNKNOWN", the path
  500. specified on the command line will be used, in this example the 
  501. "C:\TWIT\" path.  If no path is specified on the command line, the
  502. current directory will be used.
  503.  
  504.    The same rules apply to uploads, but only the first path specified
  505. will be used.  If you load M2Z by:
  506.  
  507. M2ZMODEM -l COM1 -b 19200 -prot BBS -r C:\UPLOAD\
  508.  
  509.    If the "EXTRA" user uploads files, the files will be placed in the
  510. "C:\TWIT\" path.  If the "UNKNOWN" user uploads a file, it will be
  511. placed in the "C:\UPLOAD\" path.
  512.  
  513.    Upper or lower cases are not significant.  To pass parameters back
  514. from the BBS protocol driver, the environment string "M2ZBBSRC" is
  515. reserved.  Currently no parameters are returned from the BBS protocol
  516. driver.
  517.  
  518.    Yet another example on how you may use the BBS protocol driver. 
  519. Suppose you have a door in your BBS-system, that starts the CMD-file
  520. M2ZDOOR.CMD and passes the following parameters:
  521.  
  522.          %1       Download limit in Kbytes for download passed as a
  523.                   decimal value.
  524.          %2       Level for the user passed as a decimal value
  525.                   between 1 and 9.
  526.  
  527.    Before the BBS is started, the following environment strings are
  528. set:
  529.  
  530.          SET LEVEL1=C:\DISGRACE\;C:\TWIT\;
  531.          SET LEVEL2=%LEVEL1%C:\LIMITED\;
  532.          SET LEVEL3=%LEVEL2%C:\NORMAL\;
  533.          SET LEVEL4=%LEVEL3%C:\WORTHY\;
  534.          SET LEVEL5=%LEVEL4%C:\PRIVIL\;
  535.          SET LEVEL6=%LEVEL5%C:\FAVORED\;
  536.          SET LEVEL7=%LEVEL6%C:\CLERK\;
  537.          SET LEVEL8=%LEVEL7%C:\ASSTSYSOP\;
  538.          SET LEVEL9=%LEVEL8%C:\SYSOP\;
  539.  
  540.    The M2ZDOOR.CMD file could now look like:
  541.  
  542.          @ECHO OFF
  543.          SET M2ZBBS=TERM.ANSI;MAX.%1000;PATH.LEVEL%2;
  544.          M2ZMODEM -l COM1 -b 19200 -prot BBS -s C:\TWIT\;
  545.  
  546.  
  547. FILE SERVER PROGRAM
  548. ===================
  549.    A simple program to set up a file server is included, called
  550. M2ZSERV.  It is suitable primary for personal use, when you want to
  551. fetch files from your business machine, when you are at home, to just
  552. mention an example.  It is NOT a full featered BBS, but is much
  553. easier to setup.  You start the program by typing:
  554.  
  555.          M2ZSERV device
  556.  
  557.    Replace "device" with the device name you want to set up the
  558. server for, like "COM1".  You have to put your modem into auto
  559. answer, and the cabling must deliver the DCD line correctly (or set
  560. to constant high, but it is not recommended).  Dropping DTR should
  561. result in a hang up, but it is not necessary.
  562.  
  563.    When carrier is detected the program will ask for a "Enter"
  564. keystroke, and wait for one second to get this keystroke.  If the
  565. keystroke was not received, the program will alter the baudrate to
  566. the next lower, and try again.  The program cycles all baudrates
  567. around until the "Enter" keystroke is detected (or carrier lost). 
  568. The baudrates scanned is 19200, 9600, 2400, 1200 and 300 baud.  By
  569. this scanning, the program should be compatible with any modem
  570. supporting auto answer.
  571.  
  572.    After the program has fixed for a baudrate, it will ask for
  573. username and password, validate them by checking the USERLIST.BBS
  574. file, and fetch the user level.  The format for USERLIST.BBS is
  575. showed by the example file included (each entry MUST be followed by
  576. a CR/LF sequence).  There are four parameters defined (yet), each
  577. terminated by a ";".
  578.  
  579.          1.       User name (not case sensitive)
  580.          2.       Password (case sensitive)
  581.          3.       User level (not case sensitive)
  582.          4.       Shell password (case sensitive).  If this field
  583.                   contains the word "YES", no password check will be
  584.                   done.  If this field contains "NO", the user will
  585.                   not be able to shell at all.  All other combi-
  586.                   nations sets the password according to the field. 
  587.                   Only the first 15 characters are validated, and the
  588.                   password should not contain the ";" character.  Se
  589.                   more about the SHELL option above (BBS protocol
  590.                   driver).
  591.          5.       Complete callback string.  If this is empty, no
  592.                   callback processing will be used.
  593.  
  594.    An example:
  595.  
  596.          Mikael Wahlgren;secret;Sysop;shellpassword;ATDT1234567
  597.          Who knows;my secret;Twit;NO;;
  598.  
  599.    The program will ask if the user wants to download, upload or
  600. disconnect, and loads the appropriate BBS protocol driver interface. 
  601. The user will return to this menu after each file transfer request. 
  602. The user will be able to access directories for download, according
  603. to the environment string, complying with the user level you set. 
  604. If you set the user level to "SYSOP" for an user, the user will be
  605. able to access "C:\", "C:\SYSOP\", "C:\EXAMPLE\HELLO", if the
  606. environment string "SYSOP" is previously set to:
  607.  
  608.          SET SYSOP=C:\;C:\SYSOP\;C:\EXAMPLE\HELLO\;
  609.  
  610.    When the user has selected up or download, the M2ZSERV program
  611. will execute the M2ZBBS.CMD batch file (by calling "CMD /C M2ZBBS %1
  612. %2"), with the parameters:
  613.  
  614.          %1       Operation.  "-s" for download and "-r" for upload.
  615.          %2       User level.
  616.    
  617.    By altering the included M2ZBBS.CMD file, you may select different
  618. options in the M2ZMODEM BBS protocol driver.
  619.  
  620.    The only way to terminate the M2Z HOST mode, is by pressing CTRL-
  621. BREAK or CTRL-C when the session is in foreground.
  622.  
  623.  
  624. TERMINAL FEATURE
  625. ================
  626.    I simple but fast terminal feature is implemented in the program. 
  627. It emulates an ANSI terminal, and it is possible to execute scripts
  628. (automatic terminal sessions) and upload/download files with the
  629. ZModem protocol.
  630.    The terminal function has built in translate tables for different
  631. countries.  The correct translate table is automaticly activated by
  632. inspecting the COUNTRY-code specified in your CONFIG.SYS file (if no
  633. other translate table is specified by the "-p" option).  Currently
  634. only 001, 046 and 358 country tables are implemented.
  635.    The terminal session has AUTO ZModem Up/Download capability, which
  636. means it detects when you requested a ZModem file transfer from a BBS
  637. and automaticly invokes the Up/Download routines.  You may also
  638. request download or upload manually by pressing the PgDn or PgUp
  639. function keys.
  640.    You may execute a script file by pressing ALT-S and give the file
  641. name of the script.  The M2ZMODEM script language is a very simple
  642. way to automate terminal sessions.  The following commands are
  643. available:
  644.  
  645. INITIAL "string"                     Sends "string" to the remote at.
  646.  
  647. RESPOND "await" "string"             Whenever "await" is received
  648.                                      "string" is sent to the remote.
  649.  
  650. DELAYED RESPOND "await" "string" "n" Whenever "await" is received
  651.                                      "string" is sent to the remote,
  652.                                      after "n" seconds delay (n=deci-
  653.                                      mal value).
  654.  
  655. QUIT "await"                         Whenever "await" is received the
  656.                                      script execution is finishing and
  657.                                      you are back to normal terminal
  658.                                      operation.
  659.  
  660. EXIT                                 Marks end of script file.
  661.  
  662.    With scripting it is possible to perform redial, logon, download,
  663. logoff and much more, by just specifying a script file.  A sample
  664. script file, which will redial a BBS and then logon to the system
  665. is showed:
  666.  
  667. INITIAL "ATDT 12345678!"
  668. DELAYED RESPOND "BUSY" "ATDT 12345678!" "5"
  669. DELAYED RESPOND "NO DIALTONE" "ATDT 12345678!" "5"
  670. RESPOND "Press Escape twice to load BBS" "@@"
  671. RESPOND "Password: " "secret!"
  672. RESPOND "Name: " "My Name!"
  673. RESPOND "More (Y/N)" "N"
  674. QUIT "Main menu"
  675. QUIT "NO CARRIER"
  676. EXIT
  677.  
  678.    Note that it not is significant in which order you place your
  679. script instructions.  Each instruction is valid concurrently as long
  680. as the script is executed.  You abort a script execution by pressing
  681. the escape key.  In text strings "!" are replaced with <Enter> (03H)
  682. and "@" are replaced by <Esc> (1BH).  Only the first 100 instructions
  683. are acted on.  Upper and lower cases are significant.  It is still
  684. possible to use the terminal functions while executing a script file.
  685.  
  686.    By pressing ALT-D you will display the dialling directory.  The
  687. dialling directory is placed in a file called "M2ZMODEM.DIR", and
  688. has the following format:
  689.  
  690. Name;Number;Scriptfile;
  691. Mikael Wahlgren;4631196417;AutoDial;
  692. .
  693. .
  694. .
  695. Example;123;AutoDial;
  696.  
  697.    The first parameter is the name of the entry, the second parameter the
  698. phone number to use, and the third parameter is the script file used for
  699. dialling.  If you select an entry in the dialling directory, the program
  700. will load the associated script file, and replace all occurencies of "#"
  701. in the script file, by the phone number in the dialling entry, and then
  702. execute the script.  An example of a dialling script file is included and
  703. called AUTODIAL.
  704.  
  705.    You exit the terminal session (and the whole program) by pressing
  706. ALT-X.
  707.    Note, that it is impossible to abort the program with CTRL-C if
  708. running the terminal session.
  709.  
  710.  
  711. PRESENTATION MANAGER SUPPORT
  712. ============================
  713.    There is a limited support for Presentation Manager.  By speci-
  714. fying the "-pm" option on the command line, you can load a Presen-
  715. tation Manager ZModem file transfer status window.  This window
  716. displays the same information as the PopUp in text windows.
  717.    It is possible to interface with the communication program, in
  718. order to write an own status window, or monitor the file transfer
  719. status.  This is done by writing a Presentation Manager application,
  720. with the file name "M2ZPM.EXE", which opens a named pipe called
  721. "\PIPE\M2ZPM" in message mode (as client).  The message block is
  722. defined like:
  723.  
  724.          WORD     Message type
  725.          DWORD    Value 1
  726.          DWORD    Value 2
  727.          DB 40    40 character ASCIIZ
  728.  
  729.    Possible message types are:
  730.  
  731.          0        Send before each transfer session.  This message
  732.                   is sent only once per transmission, even if it is
  733.                   a batch transfer.
  734.          1        ASCIIZ contains file name.
  735.          2        Value 1 contains file size.
  736.          3        ASCIIZ contains file transfer message.
  737.          4        Value 1 contains ZModem frame type.
  738.          5        Value 1 contains throughput value, Value 2 contains
  739.                   file position, ASCIIZ contains calculated remaining
  740.                   file transfer time.
  741.          6        Value 1 contains amount of ZModem errors.
  742.  
  743.    The pipe is closed when the M2ZMODEM program exits.  Before the
  744. pipe is closed, it is reset, to ensure that the client has read all
  745. messages.  A non working client that won't read the pipe, could
  746. prevent M2ZMODEM from exiting successfully.  A buffer of 1024 bytes
  747. is allocated to the pipe.  If the buffer is full, M2ZMODEM won't
  748. write any messages to the buffer, until it clears.  The client should
  749. not assume that the whole message block is always transfered.  It is
  750. possible that the message is truncated to include only the valid part
  751. of the message block.
  752.  
  753.  
  754. RELEASE LOG
  755. ===========
  756.  
  757.  - Version 1.00 1989-12-11
  758. ==========================
  759.    First official release of M2ZMODEM.  All previous versions is just
  760. test shoots.
  761.  
  762.  - Version 1.01 1990-01-06
  763. ==========================
  764.    All source is packed in the .EXE file and no DLL's are used any
  765. more.
  766.  
  767.   The status reporting window is altered and irrelevant information
  768. removed.
  769.  
  770.   Filenames not complying with the 8+3 format is supported.
  771.  
  772.   File transfers greater than 64 Kb correctly closed.
  773.  
  774.  - Version 1.11 1990-01-09
  775. ==========================
  776.   Remaining transfer time deisplayed instead of total transfer time.
  777.  
  778.   Faster ZModem session shutdown (Over and Out operation improved).
  779.  
  780.   Keyboard scanning changed to improve compatibility with other
  781. programs calling M2ZMODEM.  A DosGetFocus is called before trying to
  782. access the keyboard.  M2ZMODEM locked if the calling program was
  783. blocked awaiting for characters from the keyboard in the previous
  784. versions.
  785.  
  786.   The VIO is switched to ANSI-mode and the cursor is hidden when
  787. M2ZMODEM starts, and restored to its previous state when exiting.
  788.  
  789.  - Version 2.00 1990-01-19
  790. ==========================
  791.   The full power of the 16550 extended hardware buffering is enabled
  792. by setting the receive trigger level at 8 characters and transmit
  793. buffer load count to 16 characters.  See more about this above.
  794.  
  795.   The parameters for the COM-port is restored to its previous condi-
  796. tion, when exiting the program.  This was not done correctly before.
  797.  
  798.   A simple terminal feature with scripting ability is implemented. 
  799. By specifying the "-i" option the program will go on line in ANSI
  800. terminal mode.  See more about the terminal feature above.
  801.  
  802.   The cursor and ANSI state is unaltered when starting the program
  803. without parameters.  Previously the program put the screen into ANSI
  804. off.
  805.  
  806.  - Version 2.01 1990-01-20
  807. ==========================
  808.    The terminal functions are enhanced with break signal, clear
  809. screen, help screen.
  810.  
  811.    The hang-up command has been altered to both lower DTR and send
  812. the AT-command for hang up.
  813.  
  814.    The license file system is introduced.
  815.  
  816.    The status reporting window is now designed as a "pop-up".  The
  817. screen is restored to its previous condition when exiting.  The
  818. colors are selected to be compatible with both color, black/white,
  819. monochrome display adapters.  When exiting the program, the color
  820. attributes are reset, regardless of the condition when entering the
  821. program.
  822.  
  823.    The log file is now incremented, if it already exists, and not
  824. overwritten.  Each log record is marked with date and time.
  825.  
  826.  - Version 2.02 1990-01-31
  827. ==========================
  828.    The status window is altered.  Instead of showing the block check
  829. status, the transfer rate is displayed.
  830.  
  831.    The possibility to set environment variables, and refer to these
  832. with the "-e" option is added.  It is possible to merge several
  833. environment variables together at the same command line.
  834.  
  835.    The file transfer time estimate is calculated in a smarter way. 
  836. The current CPS value is used for the calculation, instead of the
  837. baudrate.  This makes the time estimate more correct for modems with
  838. a higher DTE-DCE line speed, than the link speed.
  839.  
  840.  - Version 2.03 1990-02-01
  841. ==========================
  842.    When running at speeds of 9600 baud or higher, or using the
  843. default baud rate, the process priority is changed to class 3 (Time
  844. Critical).
  845.  
  846.    Some minor corrections have been made in the log file.
  847.  
  848.    The transfer time is displayed in minutes with only one decimal,
  849. to avoid the similarity with the mm:ss format (making you believe it
  850. is displaying minutes and seconds).
  851.  
  852.    A Presentation Manager status reporting window is now implemented. 
  853. This is loaded by specifying the "-pm" option.
  854.  
  855.    The program may now resume, rename or skip a file, if it already
  856. exists on the target system.  Which action to take, depends on the
  857. command line options.  Default is to rename the file.
  858.  
  859.    If file modification time was not specified in the ZFILE header,
  860. an incorrect (and abnormal) file time was set.  This is corrected,
  861. and the file time is set to the current time, if not specified.
  862.  
  863.    The XModem category file transfer protocols are added.  By using
  864. the option "-prot" you may select Xmodem, Xmodem/1K, Ymodem, Ymodem-
  865. Batch, Ymodem-G or Ymodem-G-Batch.  The protocols are called
  866. "XMODEM", "XMODEM1K", "YMODEM", "YMODEMB", "YMODEMG" and "YMODEMGB"
  867. resp.
  868.  
  869.  - Version 2.04, 1990-02-13
  870. ===========================
  871.    Some minor changes have been made in the log file, in respect to
  872. X/Ymodem file transfers.
  873.  
  874.    The BBS Protocol Driver is loaded.  This is a user interface for
  875. those who want to use the M2Z to handle up and download in the BBS. 
  876. This is loaded by specifying the option "-prot BBS".
  877.  
  878.    The Presentation Manager status window program M2ZPM, would cause
  879. a hang, if the stream of messages from M2Z was too active.  This
  880. should now be fixed.
  881.  
  882.    If an upload was requested, with a system just echoing back the
  883. characters, the system would circle around sending NAKs to itself.
  884. This is corrected, and now the system sends ZRQINITs every 10 second.
  885.  
  886.    It is now possible to abort transfers by pressing the left mouse
  887. button at the "<Abort>" field.
  888.  
  889.    Some corrections have been made in the Ymodem protocols.
  890.  
  891.    The program is now easily "translatable" to other languages, by
  892. putting almost all messages in a message file.
  893.  
  894.    Asynchronous write processing has been implemented in the Zmodem
  895. protocol, to increase the throughput.  A test seemed to indicate that
  896. the performance increased a little (but not much).
  897.  
  898.  - Version 2.05, 1990-02-19
  899. ===========================
  900.    The synonyms "0" for "TTY" and "1" for "ANSI" terminals in the BBS
  901. interface parameters are added.
  902.  
  903.    The parameter "TIME." is added in the BBS interface, and a simple
  904. time estimate is displayed before a transfer.  The time estimate,
  905. does not count with the overhead of different protocols.
  906.  
  907.    Hang when unathorized user logged into the M2Z HOST, removed.
  908.  
  909.    The remaining time in the file transfer status window is now back
  910. to the "mm:ss" format, but now really displays minutes:seconds.
  911.  
  912.    New registration information.
  913.  
  914.    SHELL function in M2Z HOST program.
  915.  
  916.  - Version 2.06, 1990-04-27
  917. ===========================
  918.    The screen dump fature is altered to append CR/LF at end of each
  919. row, to allow text editing.
  920.  
  921.    The redisplay feature is added (see "-his" option above).
  922.  
  923.    The treatment of upper/lower cases in filenames is altered, to be
  924. more automatic.  Now M2Zmodem will makes its very best to determ if
  925. it is a "long" filename, and if upper/lower case characters should
  926. be kept.  The only case when M2Zmodem will fail to keep the same
  927. format of the filename is if the filename contains ONLY lower case
  928. characters and conforms to the 8+3 character old DOS naming conven-
  929. tion, in which case the filename will be converted to all upper
  930. cases.  This conversion may be overrided by the "-t" option.
  931.  
  932.    Some cosmetical changes in menus and messages.  M2Zmodem now uses
  933. window popups.
  934.  
  935.    The keyboard handling is altered, to also enable the arrow keys
  936. on the numerical part of the keyboard (if not in NumLock mode).  The
  937. separate arrow keys are treated the same way as before.
  938.  
  939.    The SHELL to OS/2 option in the BBS protocol driver is fixed.  In
  940. previous version, you could get a protection error when exiting the
  941. SHELL mode.  This should now be fixed.
  942.  
  943.    It is now possible to alter the COM parameters (baudrate, parity,
  944. data and stop bits) in the terminal session by pressing ALT-P.
  945.  
  946.    The mouse is now used in the terminal session.  The mouse button
  947. 1 (usually the left one) will send the character at the mouse pointer
  948. location, to the COM port.  Mouse button 2 (usually the right one)
  949. will send ANSI escape sequences to the COM port, to position the
  950. cursor at the same location as the mouse pointer.  It is possible to
  951. "drag" the mouse, when the left button is pressed, in order to send
  952. a string.
  953.  
  954. - Version 2.07, 1990-05-06
  955. ==========================
  956.  
  957.    The external program Os2You (also a MW-product) is used for
  958. shelling to OS/2.
  959.  
  960. - Version 2.08, 1990-07-29
  961. ==========================
  962.  
  963.    M2ZServ is capable of callback processing.
  964.  
  965.    M2Zmodem is altered to not conflict with Os2You if used concur-
  966. rently on the same communication port.
  967.  
  968. - Version 2.09, 1990-09-11
  969. ==========================
  970.  
  971.    Documentation corrected.  Script command INITIATE replaced with
  972. INITIAL (only in documentation, have always been INITIAL in program).
  973.  
  974.    Dialling directory added.
  975.  
  976.  
  977. - Version 2.10, 1991-02-17
  978. ==========================
  979.  
  980.    Changed compiler.  Changed behaviour of some keys, like Ctrl-P,
  981.    grey Enter.
  982.  
  983.  
  984. - Version 2.11, 1991-08-26
  985.  
  986.    Changed compiler, and fixed file date.  This version is also
  987.    compatible with PMTERM.
  988.  
  989.    Zmodem file transfer now works with named pipes to use the protocol
  990.    via the asynchronous network gateway implemented by Os2You.
  991.  
  992.    Zmodem file transfers would hang in certain situations (ZCRC header).
  993.    This is now fixed.
  994.  
  995.  
  996. - Version 2.12, 1992-05-22
  997.  
  998.    Incorporated SetBaud, which now enables baudrates up to 115200 baud.
  999.    If you are running OS/2 1.3 or lower, insert the line "IOPL=SETBAUD"
  1000.    or "IOPL=YES" in your CONFIG.SYS, and you will now be able to use
  1001.    baudrates up to 115200 bauds.
  1002.  
  1003.  
  1004.  
  1005. - Planned enhancements
  1006. ======================
  1007. *        ASCII upload.
  1008. *        Prestel emulation.
  1009. *        Better redisplay function.
  1010.  
  1011. GUARANTEE
  1012. =========
  1013.    This software is released "as is".  I believe it works as
  1014. described in this documentation, but if it does not, I am not
  1015. responsible for any harm you may suffer from this.  I will try to
  1016. correct any bugs you report.  Even if you register the product this
  1017. will be true.
  1018.  
  1019.  
  1020. Important license information
  1021. =============================
  1022. It is illegal (or at least unethical) to patch the program in any way.
  1023. Any reverse engineering (disassembling or monitoring) is not an approved
  1024. use of the application.
  1025.  
  1026. If you register the software with 300 SEK (about $50), you will get a
  1027. license file and a copy of the most recent version of the program.  In
  1028. this case, you will also get rid of the registration screen during logon.
  1029.  
  1030. If you use the program on a regular basis, or in commercial use, you must
  1031. register with minimum the above mentioned sum for each machine running
  1032. the program.  For use in the Scandinavian countries (Sweden, Norway and
  1033. Denmark), I have the right to refuse registration of a user and prohibit
  1034. commercial use of the program, if I wish.  This will be the case, if the
  1035. use of the program conflicts with commercial interests related to me.
  1036.  
  1037. You are encouraged to spread this program (without registration file)
  1038. to anyone that might be interested.
  1039.  
  1040. If you want to register, send swedish banknotes, or let bank transfer
  1041. money to my account (note that you should send all money in swedish
  1042. currency), or pay by VISA or MC.  If you pay by VISA or MC, please
  1043. complete the ORDER.DOC form and mail or fax it to me.
  1044.  
  1045. My address is:
  1046.  
  1047. Mikael Wahlgren
  1048. Kransen 4E
  1049. S-416 72  GOTHENBURG
  1050. Sweden
  1051.  
  1052. Fax   +46 31 196417
  1053. Phone +46 31 196074
  1054.  
  1055.  
  1056. ACKNOWLEDGMENTS
  1057. ===============
  1058.    J. R. Louvau's source code TPZSFZ for DOS, was "looked at" while
  1059. developing this source (which is completely different, and in another
  1060. language, but the Pascal source gave some useful hints).
  1061.  
  1062.    Joaquim Homrighausen's 32 bits CRC calculation was altered and
  1063. implemented in this source.
  1064.  
  1065.    Chuck Forsberg, Omen Technology and Telenet developed the ZModem
  1066. protocol.
  1067.  
  1068.    Jensen & Partners International developed the TopSpeed Modula-2
  1069. OS/2 compiler, which is a very powerful development environment for
  1070. OS/2 programming.
  1071.  
  1072.  
  1073.  
  1074. TRADEMARKS
  1075. ==========
  1076. OS/2     is a trademark of IBM Corporation.
  1077. PS/2     is a registered trademark of IBM Corporation.
  1078. PC/AT    is a registered trademark of IBM Corporation.
  1079. IBM      is a registered trademark of International Business Machines
  1080.          Corporation.
  1081. Omen     is a trademark of Omen Technology Incorporated.
  1082. 386/SX   might be a trademark of Intel Corporation.