home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / researchmachines / rmlgendoc.txt < prev    next >
Text File  |  1985-07-10  |  10KB  |  303 lines

  1. File  RMKGEN.DOC
  2. ----------------        Chris Kennington    9th July 1985
  3.  
  4.  
  5.  
  6.         Generation of Research Machines Kermit
  7.         --------------------------------------
  8.  
  9.  
  10.  
  11. 0.  Modules Required and Status.
  12.     ----------------------------
  13.  
  14.      RM Kermit consists of two parts.  The high-level routines, coded in
  15. "C", are responsible for the whole program organization and behaviour.
  16. Low-level routines, mostly coded in assembler, provide the interfaces for
  17. driving the keyboard, screen and communications.  A base-package for the
  18. C code is also required.
  19.  
  20.      The C-coded routines, which were written at RML, have the status
  21. of "copyright - freely available", as requested by U. of Columbia.  (They
  22. do in fact contain a small amount of code originating from U of Columbia
  23. C-Kermit.)  The low-level interface routines, also written at RML, are
  24. RML copyright and their source-text is not generally available.  The
  25. distribution files of RM Kermit therefore consist of the C-coded source
  26. of the high-level routines plus object or REL files for the low-level ones.
  27.  
  28.      The high-level files for either version are:-
  29.  
  30.     RMKEXT.H    RMKMAIN.C    RMKDATA.C    RMKDISK.C
  31.     RMKKEY.C    RMKLINE.C    RMKPARM.C    RMKREC.C
  32.     RMKSEND.C    RMKUTIL2.C    RMKCSUPP.C
  33.  
  34. plus either        RMK480Z.C  or    RMKNIMB.C
  35.  
  36.  
  37.  
  38. 1.  480Z Interface Files.
  39.     ---------------------
  40.  
  41.      The files required to complete the 480Z version depend on whether
  42. the communications are to be via the disk-unit (IDC) or direct from the
  43. SIO4 port on the back of the 480Z (in which case network disks must be
  44. used).
  45.  
  46.      The relevant line-driver files for the IDC version are:
  47.  
  48.     IDCEQUS1.REL    IDCBASE.REL    IDCDRIV.REL
  49.  
  50.     The relevant line-driver files for the Network version are:
  51.  
  52.     SIOBASE1.REL    SIODRIV1.REL
  53.  
  54.      In both cases the base-package and interface files must 
  55. also be included (see also section 3 below):
  56.  
  57.     CS4COM.REL    RMKERMIT.REL    CBASE6.REL
  58.  
  59.  
  60.  
  61.  
  62. 2.  Nimbus Interface Files.    
  63.     -----------------------
  64.  
  65.      Both Nimbus versions (for Aux and Piconet communications) use
  66. the same basic code to drive the communications line.  The destinction
  67. between the two is in a short C-coded steering-file, whose name is
  68.  
  69.             RMKSAUX.C
  70.  
  71. for the Aux (RS422) version, and
  72.  
  73.             RMKSPIC.C
  74.  
  75. for the Piconet (RS232C) version.
  76.  
  77.      The low-level driver code is then supplied by:
  78.  
  79.         RMCOMMS.O    &    RMOUTC.O
  80.  
  81.      When a version of Kermit is released for the Data Communications
  82. Controller, this is expected to require a completely different version
  83. of the communications drivers.  Instructions for the generation of
  84. this version will be promulgated when it becomes available (expected
  85. late 1985). 
  86.  
  87.  
  88.  
  89. 3.  Handling of C-Coded Files.
  90.     --------------------------
  91.  
  92.      Development of RM Kermit on both 480Z and Nimbus has been carried out
  93. using the Aztec C-compiler, version 1.06d.  For internal reasons, the global
  94. header file RMKEXT.H is referred to in the C-sources as "b:kext.h"; suitable
  95. renaming must be done before any recompilation is undertaken, and attention
  96. may be needed to the disks on which files are located.  Aztec's .H files
  97. will also be required.
  98.  
  99.      Development of the 480Z version has encountered difficulties because
  100. the program is large enough to almost fill the TPA of a 56-Kbyte CP/M.
  101. The pre-exisiting low-level communications routines were in RML's own Z80
  102. assembly-code, which is assembled by RML ZASM to produce Microsoft-compatible
  103. .REL files.  Aztec's C-compiler was used to generate Intel assembly code,
  104. assembled by Microsoft's M80 to produce Microsoft .REL files.
  105. The main reason for splitting the source into so many small files was
  106. to permit this compilation under CP/M.  Linking by
  107. Microsoft's L80 linker was impossible (since this builds its module in
  108. store); Prospero's PROLINK was therefore used.  This has a restriction
  109. on the use of external data + offsets, which caused a few special types
  110. of C-statement to be avoided (these are flagged in the text).  In addition,
  111. PROLINK will not search the Aztec Microsoft-compatible library correctly,
  112. so a tailored library module CBASE6.REL was constructed by hand.  Also,
  113. for reasons internal to CP/M and the communications drivers, it was found
  114. necessary to initialize the driver package before initializing the
  115. C base-package; the Aztec C-initialization MBEGIN has therefore to be
  116. modified and is supplied as file RMKERMIT.REL (which also controls
  117. the name of the .COM module).  This version makes a call to s4go() and
  118. then a call to BDOS (to alter the bottom-of-BDOS pointers) before allowing
  119. Aztec-C to set up its stack.  Other methods of solving these problems are
  120. obviously possible.  If any user wishes to modify the current 480Z version,
  121. he will need M80 and PROLINK as well as Aztec-C, and may need to extract
  122. additional library modules from the Aztec base-package library.
  123.  
  124.      There were no such problems with the Nimbus version.  The .O (object)
  125. files supplied are direct outputs from Aztec's AS assembler, using
  126. 80186 assembly code which is very close to that for Microsoft MASM.
  127. Linkage has been carried out by Aztec's LN linker using the library
  128. C.LIB from Aztec-C 1.06d.
  129.  
  130.  
  131.  
  132. 4.  Linking Revised Versions.
  133.     -------------------------
  134.  
  135.      In either 480Z or Nimbus versions, insertion of revised communications
  136. code is very simple.  Once the new code has been assembled by ZASM / M80
  137. or AS respectively, it may be linked by PROLINK or LN using the appropriate
  138. one of the following directives:-
  139.  
  140.        -- for 480Z with IDC communications:
  141. c:
  142. a:PROLINK  d:rmkermit,cbase6,rmkdata,rmkmain,cs4com,rmkcsupp,idcbase,rmk480z,
  143.         rmkdisk,rmkkey,rmkparm,rmkrec,rmksend,rmkline,rmkutil2,
  144.         idcequs1,idcdriv
  145. d:
  146. REN  ikmit.com=rmkermit.com
  147. a:
  148.  
  149.  
  150.     -- for 480Z with direct SIO4 communications:
  151. c:
  152. a:PROLINK  d:rmkermit,cbase6,rmkdata,rmkmain,cs4com,rmkcsupp,siobase1,rmk480z,
  153.         rmkdisk,rmkkey,rmkparm,rmkrec,rmksend,rmkline,rmkutil2,
  154.         siodriv1
  155. d:
  156. REN  nkmit.com=rmkermit.com
  157. a:
  158.  
  159.  
  160.     -- for Nimbus with Aux communications:
  161.  
  162. LN  -f  alink
  163. REN  b:rmkermit.exe akmit.exe
  164.  
  165. where file "alink" consists of
  166.     -v -o b:rmkermit.exe
  167.     b:rmkmain.o  b:rmknimb.o  b:rmkdisk.o b:rmkparm.o
  168.     b:rmkdata.o  b:rmkline.o  b:rmkkey.o  b:rmkrec.o 
  169.     b:rmksend.o  b:rmkutil2.o b:rmkcsupp.o
  170.     b:rmksaux.o  b:rmcomms.o
  171.     a:rmoutc.o
  172.     a:c.lib
  173.  
  174.  
  175.     -- for Nimbus with Piconet communications
  176.  
  177. LN  -f  plink
  178. REN  b:rmkermit.exe pkmit.exe
  179.  
  180. where file "alink" consists of
  181.     -v -o b:rmkermit.exe
  182.     b:rmkmain.o  b:rmknimb.o  b:rmkdisk.o b:rmkparm.o
  183.     b:rmkdata.o  b:rmkline.o  b:rmkkey.o  b:rmkrec.o 
  184.     b:rmksend.o  b:rmkutil2.o b:rmkcsupp.o
  185.     b:rmkspic.o  b:rmcomms.o
  186.     a:rmoutc.o
  187.     a:c.lib
  188.  
  189.      All these files make certain assumptions about the disks on which
  190. specific files are located.  These are the locations used in the original
  191. development and may need changing if a different environment is used.
  192.  
  193.  
  194.  
  195. 5.  Total Rebuild  -  480Z.
  196.     -----------------------
  197.  
  198.      A "SUBMIT" file for total regeneration of 480Z Kermit is given
  199. below.  This is for a local-disk 480Z with MD2 IDC, assuming that
  200. the C-system is on a:, the sources on b:, most of the .RELs on c:,
  201. and leaving the generated .COMs on d:.  Note that Aztec's TINY library
  202. is used, and that careful attention has had to be given to the
  203. space allocated to the various tables during compilation.
  204.  
  205. cz  -DTINY -E20 -L12 -Y18 -MO d:kmain.mac b:rmkmain.c
  206. M80  c:kmain,=d:kmain/I
  207. era  d:kmain.mac
  208. cz  -DTINY -E20 -L12 -Y18 -MO d:kdata.mac b:rmkdata.c
  209. M80  c:kdata,=d:kdata/I
  210. era  d:kdata.mac
  211. cz  -DTINY -E20 -L12 -Y22 -MO d:k480z.mac b:rmk480z.c
  212. M80  c:k480z,=d:k480z/I
  213. era  d:k480z.mac
  214. cz  -DTINY -E25 -L12 -Y22 -MO d:kkey.mac b:rmkkey.c
  215. M80  c:kkey,=d:kkey/I
  216. era  d:kkey.mac
  217. cz  -DTINY -E25 -L12 -Y18 -MO d:kdisk.mac b:rmkdisk.c
  218. M80  c:kdisk,=d:kdisk/I
  219. era  d:kdisk.mac
  220. cz  -DTINY -E20 -L12 -Y18 -MO d:kline.mac b:rmkline.c
  221. M80  c:kline,=d:kline/I
  222. era  d:kline.mac
  223. cz  -DTINY -E20 -L12 -Y18 -MO d:kparm.mac b:rmkparm.c
  224. M80  c:kparm,=d:kparm/I
  225. era  d:kparm.mac
  226. cz  -DTINY -E20 -L12 -Y18 -MO d:krec.mac b:rmkrec.c
  227. M80  c:krec,=d:krec/I
  228. era  d:krec.mac
  229. cz  -DTINY -E20 -L12 -Y18 -MO d:ksend.mac b:rmksend.c
  230. M80  c:ksend,=d:ksend/I
  231. era  d:ksend.mac
  232. cz  -DTINY -E20 -L12 -Y18 -MO d:kutil2.mac b:rmkutil2.c
  233. M80  c:kutil2,=d:kutil2/I
  234. era  d:kutil2.mac
  235. cz  -DTINY -E20 -L12 -Y18 -MO d:kcsupp.mac b:rmkcsupp.c
  236. M80  c:kcsupp,=d:kcsupp/I
  237. era  d:kcsupp.mac
  238. era d:?kmit.com
  239. c:
  240. a:prol d:kermit,cbase6,kdata,kmain,cs4com,kcsupp,idcbase,k480z,kdisk,kkey,kparm,krec,ksend,kline,kutil2,idcequs1,idcdriv
  241. d:
  242. ren ikmit.com=kermit.com
  243. c:
  244. a:prol d:kermit,cbase6,kdata,kmain,cs4com,kcsupp,siobase1,k480z,kdisk,kkey,kparm,krec,ksend,kline,kutil2,siodriv1
  245. d:
  246. ren nkmit.com=kermit.com
  247. a:
  248. stat d:*.com
  249.  
  250.  
  251.  
  252. 6.  Total Rebuild  -  Nimbus.
  253.     -------------------------
  254.  
  255.      A suitable .BAT file for total regeneration of Nimbus Kermit is given
  256. below.  This assumes a standard C-system on a:, and all the text files etc.
  257. on b:.
  258.  
  259. REM  Compile all of Kermit & link it for Aux & Piconet
  260. a:
  261. CC b:rmkmain
  262. CC b:rmkdata
  263. CC b:rmkdisk
  264. CC b:rmkkey
  265. CC b:rmkline
  266. CC b:rmkparm
  267. CC b:rmkrec
  268. CC b:rmksend
  269. CC b:rmkutil2
  270. CC b:rmkcsupp
  271. CC b:rmknimb
  272. CC b:rmksaux
  273. CC b:rmkspic
  274. DIR b:rmk*.o/p
  275. LN -f alink
  276. REN b:rmkermit.exe akmit.exe
  277. LN -f plink
  278. REN b:rmkermit.exe pkmit.exe
  279. DIR b:?kmit.com
  280.  
  281.  
  282.  
  283. 7.  Conditional Compilations.
  284.     -------------------------
  285.  
  286.      The common C-files (RMKEXT.H and RMK*.C except 480Z and NIMB)
  287. mostly contain a small amount of #ifdef-controlled conditional
  288. compilation to distinguish between MSDOS (Nimbus) and CP/M (480Z)
  289. versions.  RMKDISK.C contains a lot of such conditionals.  All
  290. are keyed to the #define variable MPUZ80, supplied by Aztec as
  291. predefined in the CP/M-Z80 version of C 1.06 and not so defined
  292. in the MSDOS-8086 version.  Many of these conditionals are either
  293. trivial or organizational, but the whole area should be reviewed
  294. by anyone making major alterations to the source or the way in
  295. which it is used.  In particular, any attempt to produce an 8080
  296. version is likely to end up with MSDOS conditionals since the Aztec
  297. pre#defined variable will then be MPU8080.
  298.  
  299.  
  300.  
  301.     **********************************************************
  302.  
  303.