install.doc 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235
  1. .\" $Header$
  2. .if n .nr PD 1v
  3. .if n .nr LL 78m
  4. .if n .ll 78m
  5. .TL
  6. Amsterdam Compiler Kit Installation Guide
  7. .AU
  8. Ed Keizer
  9. (revised for 3rd and 4th distribution by Ceriel Jacobs)
  10. .AI
  11. Vakgroep Informatica
  12. Vrije Universiteit
  13. Amsterdam
  14. .NH
  15. Introduction
  16. .PP
  17. This document
  18. describes the process of installing Amsterdam Compiler Kit.
  19. It depends on your combination of hard- and software how
  20. hard it will be to install the Kit.
  21. This description is intended for a VAX running BSD 4.1
  22. .UX
  23. \.
  24. Installation on VAX BSD4.2/4.3 systems,
  25. Sun-2 or Sun-3 systems running Release 3.0 or newer, and some System V systems
  26. should be easy.
  27. Installation on PDP 11's running
  28. .UX
  29. Version 7, BSD 2.8, or 2.9
  30. should also be easy, as long
  31. as they have separate instruction and data space.
  32. Installation on machine's without this feature, like PDP 11/34,
  33. PDP 11/60 requires extensive surgery on some programs and is
  34. thought of as impossible.
  35. See section 7 for installation on other systems.
  36. .PP
  37. On small machines, like the PDP-11, the Modula-2 front-end is only available
  38. for 2 byte integer, 2 byte pointer machines, so you can not cross-compile
  39. Modula-2 programs for f.i. a MC68000, on a PDP-11.
  40. .NH
  41. Restoring tree
  42. .PP
  43. The process of installing Amsterdam Compiler Kit is quite simple.
  44. It is important that the original Amsterdam Compiler Kit
  45. distribution tree structure is restored.
  46. Proceed as follows
  47. .IP " \-" 10
  48. Create a directory, for example /usr/em, on a device
  49. with at least 25 Megabytes left.
  50. .IP " \-"
  51. Change to that directory (cd ...); it will be the working directory.
  52. .IP " \-"
  53. Extract all files from the distribution medium, for instance
  54. magtape:
  55. \fBtar x\fP.
  56. .IP " \-"
  57. Keep a copy of the original distribution to be able to repeat the process
  58. of installation in case of disasters.
  59. This copy is also useful as a reference point for diff-listings.
  60. .LP
  61. .bp
  62. The directories in the tree contain the following information:
  63. .sp 1
  64. .nr PD 0
  65. .IP "bin" 14
  66. .br
  67. the few utilities that knot things together.
  68. See the section about "Commands".
  69. .IP "lib"
  70. .br
  71. root of a tree containing almost all binaries and libraries used by
  72. commands.
  73. All files specific to a certain machine are collected in one subtree
  74. per machine. E.g. "lib/pdp", "lib/z8000".
  75. The names used here are the same names as used for subtrees
  76. of "mach".
  77. .IP "lib/descr"
  78. .br
  79. Command descriptor files used by the program ack.
  80. .IP "lib/LLgen"
  81. .br
  82. Files used by the LL(1) Parser-generator.
  83. .br
  84. .IP "lib/ego"
  85. .br
  86. Files used by the global optimizer.
  87. .br
  88. .IP "etc"
  89. .br
  90. The main description of EM sits here.
  91. Files (e.g. em_table) describing
  92. the opcodes and pseudos in use,
  93. the operands allowed, effect in stack etc. etc.
  94. Make in this directory creates most of the files in "h"
  95. and "util/data".
  96. This make should only be called when the EM definition is
  97. changed.
  98. .IP "include/_tail_cc"
  99. .br
  100. Include files needed by modules
  101. in the C library from lang/cem/libcc.
  102. Especially needed for "stdio".
  103. .IP "include/_tail_mon"
  104. .br
  105. More or less system independent include files needed by modules
  106. in the library lang/cem/libcc/mon.
  107. .IP "h"
  108. .br
  109. The #include files for:
  110. .TS
  111. l l.
  112. arch.h Definition of the ACK archive format.
  113. as_spec.h Used by EM assembler and interpreters.
  114. bc_io.h Used by the Basic run-time system.
  115. bc_string.h Used by the Basic run-time system.
  116. cg_pattern.h Used by the backend program "cg" and its bootstrap.
  117. cgg_cg.h Used by the backend program "ncg" and its bootstrap.
  118. em_abs.h Contains trap numbers and address for lin and fil
  119. em_flag.h Definition of bits in array em_flag in lib/em_data.a
  120. Describes parameters effect on flow of instructions
  121. em_mes.h Definition of names for mes pseudo numbers
  122. em_mnem.h instruction => compact mapping.
  123. em_path.h Pathnames used by \fIack\fP, intended
  124. for all utilities
  125. em_pseu.h pseudo instruction => compact mapping
  126. em_ptyp.h Useful for compact code reading/writing,
  127. defines classes of parameters
  128. em_reg.h Definition of mnemonics indicating register type.
  129. em_spec.h Definition of constants used in compact code
  130. local.h Various definitions for local versions
  131. pc_err.h Definitions of error numbers in Pascal
  132. pc_file.h Macro's used in file handling in Pascal
  133. pc_size.h Sizes of objects used by Pascal compiler and
  134. run-time system.
  135. em_reg.h Definition of names for register types.
  136. ocm_chan.h Used by the occam run-time system
  137. ocm_parco.h Used by the occam run-time system
  138. ocm_proc.h Used by the occam run-time system
  139. m2_traps.h Used by the Modula-2 run-time system
  140. .TE
  141. .IP "modules"
  142. .br
  143. root of a tree containing modules for compiler writers.
  144. .IP "modules/man"
  145. .br
  146. manual pages for all modules.
  147. .IP "modules/lib"
  148. .br
  149. contains module objects.
  150. .IP "modules/src"
  151. .br
  152. contains sources of the modules, each module in its own directory.
  153. .IP "modules/h"
  154. .br
  155. include files for some of the modules.
  156. .IP "modules/pkg"
  157. .br
  158. include files for some of the modules.
  159. .IP "doc"
  160. .br
  161. This directory contains the unformatted documents for the Kit.
  162. A list of the available documents can be found in the last section.
  163. .IP "doc/em"
  164. .br
  165. The EM-manual IR-81.
  166. .IP "doc/em/int"
  167. .br
  168. The EM interpreter written in Pascal.
  169. .IP "mkun"
  170. .br
  171. The PUBMAC macro package for nroff/troff from the Katholieke Universiteit at
  172. Nijmegen.
  173. It is used for the EM reference manual.
  174. The Makefile installs the macro package in
  175. /usr/lib/tmac.
  176. This package is in the public domain.
  177. .IP "mach"
  178. .br
  179. just there to group the directories with all sources for each machine.
  180. The section about "Machines" of this manual indicates which subdirectories
  181. are used for which systems.
  182. .br
  183. These directories have subdirectories named:
  184. .in +3n
  185. .TS
  186. l l.
  187. cg the backend (*.m => *.s)
  188. ncg the new backend (*.m => *.s)
  189. as the assembler (*.s => *.o) or
  190. assembler/linker (*.s + libraries => a.out)
  191. cv Conversion programs for a.out files.
  192. dl Down-load programs
  193. top the target optimizer
  194. libem Sources for EM runtime system, only depending on CPU type
  195. libbc Used to create Basic run-time system and libraries
  196. libcc Used to create C run-time system and libraries
  197. libpc Used to create Pascal run-time system and libraries
  198. liboc Used to create Occam run-time system and libraries
  199. libm2 Used to create Modula-2 run-time system and libraries
  200. libfp Used to create floating point library
  201. libsys Sources for system-dependent EM library
  202. test Various tests
  203. int Source for an interpreter
  204. .TE
  205. .in -3n
  206. The directory proto contains files used by most machines,
  207. like machine-independent sources and Makefiles.
  208. .in +3n
  209. .TS
  210. l l.
  211. mach/proto/cg Current backend sources.
  212. mach/proto/ncg New backend sources.
  213. mach/proto/as Assembler sources.
  214. mach/proto/top Target optimizer sources.
  215. mach/proto/fp FLoating point package sources.
  216. mach/proto/libg Makefile for compiling libraries.
  217. .TE
  218. .IP "emtest"
  219. .br
  220. Contains prototype of em test set.
  221. .IP "man"
  222. .br
  223. Man files for various utilities
  224. .IP "lang"
  225. .br
  226. Just there to group the directories for all front-ends
  227. .IP "lang/pc"
  228. .br
  229. Pascal front-end
  230. .IP "lang/pc/libpc"
  231. .br
  232. Source of Pascal run-time system (in EM or C)
  233. .IP "lang/pc/test"
  234. .br
  235. Some test programs written in Pascal
  236. .IP "lang/pc/pem"
  237. .br
  238. The Pascal compiler proper
  239. .IP "lang/cem"
  240. .br
  241. C front-end
  242. .IP "lang/cem/libcc"
  243. .br
  244. Directories with sources of C runtime system, libraries (in EM or C)
  245. .IP "lang/cem/libcc/gen"
  246. .br
  247. Sources for routines in chapter III of UNIX programmers manual,
  248. excluding Stdio
  249. .IP "lang/cem/libcc/stdio"
  250. .br
  251. Stdio sources
  252. .IP "lang/cem/libcc/math"
  253. .br
  254. Sources for mathematical routines, normally available with the
  255. \fB-lm\fP option to \fIcc\fP.
  256. .IP "lang/cem/libcc/mon"
  257. .br
  258. Sources for routines in chapter II, written in EM
  259. .IP "lang/cem/cemcom"
  260. .br
  261. The compiler proper
  262. .IP "lang/cem/ctest"
  263. .br
  264. C test set
  265. .IP "lang/cem/ctest/cterr"
  266. .br
  267. Programs developed for pinpointing previous errors
  268. .IP "lang/cem/ctest/ct*"
  269. .br
  270. The test programs.
  271. .IP "lang/basic/src"
  272. .br
  273. The compiler proper.
  274. .IP "lang/basic/lib"
  275. .br
  276. Basic run-time library source.
  277. .IP "lang/basic/test"
  278. .br
  279. Various Basic programs.
  280. .IP "lang/occam"
  281. .br
  282. Occam front-end.
  283. .IP "lang/occam/comp"
  284. .br
  285. The compiler proper.
  286. .IP "lang/occam/lib"
  287. .br
  288. Source of Occam run-time system (in EM or C).
  289. .IP "lang/occam/test"
  290. .br
  291. Some Occam programs.
  292. .IP "lang/m2"
  293. .br
  294. Modual-2 front-end.
  295. .IP "lang/m2/comp"
  296. .br
  297. The compiler proper.
  298. .IP "lang/m2/libm2"
  299. .br
  300. Source of Modula-2 run-time system (in EM, C and Modula-2).
  301. .IP "lang/m2/m2mm"
  302. .br
  303. Modula-2 makefile generator.
  304. .IP "lang/m2/test"
  305. .br
  306. Some Modula-2 example programs.
  307. .IP "util"
  308. .br
  309. Contains directories with sources for various utilities
  310. .IP "util/ack"
  311. .br
  312. The program used for translation with the Kit.
  313. .IP "util/opt"
  314. .br
  315. EM peephole optimizer (*.k => *.m).
  316. .IP "util/ego"
  317. .br
  318. The global optimizer.
  319. .IP "util/topgen"
  320. .br
  321. The target optimizer generator..
  322. .IP "util/misc"
  323. .br
  324. Decode (*.[km] => *.e) + encode (*.e => *.k).
  325. .IP "util/data"
  326. .br
  327. The C-code for `lib/em_data.a`.
  328. These sources are created by the Makefile in `etc`.
  329. .IP "util/ass"
  330. .br
  331. The EM assembler (*.[km] + libraries => e.out).
  332. .IP "util/arch"
  333. .br
  334. The archivers to be used for ALL EM utilities.
  335. .IP "util/cgg"
  336. .br
  337. A program needed for compiling backends.
  338. .IP "util/ncgg"
  339. .br
  340. A program needed for compiling the newest backends.
  341. .IP "util/cpp"
  342. .br
  343. The C preprocessor.
  344. .IP "util/shf"
  345. .br
  346. Various shell files.
  347. .IP "util/LLgen"
  348. .br
  349. The extended LL(1) parser generator.
  350. .IP "util/amisc"
  351. .br
  352. Contains some programs handling ACK a.out format, such as anm, asize.
  353. .IP "util/cmisc"
  354. .br
  355. Contains some programs to help in resolving name conflicts, and
  356. a dependency generator for makefiles.
  357. .IP "util/led"
  358. .br
  359. The ACK link-editor, reading ACK relocatable a.out format, and writing
  360. ACK a.out format.
  361. .IP "util/int"
  362. .br
  363. An EM interpreter, written in C. Very useful for checking out software.
  364. Unfortunately not available for small machines.
  365. .ne 4
  366. .LP
  367. All pathnames mentioned in the text of this document are relative to the
  368. ACK home directory, unless they start with '/'.
  369. .sp 1
  370. .NH
  371. Adapting ACK to your system
  372. .PP
  373. Before compiling the sources in the Kit some installation dependent
  374. actions have to be taken.
  375. Most of these are performed by an interactive shell script in the file
  376. .I first
  377. in a directory of the same name.
  378. .LP
  379. These actions are:
  380. .sp 1
  381. .IP \-
  382. Automatically checking whether you included the ACK bin directory in your
  383. shell PATH.
  384. See also the section on "commands".
  385. .IP \-
  386. Automatically setting the pathname of the parent directory in ../h/em_path.h.
  387. See also the section on "pathnames".
  388. .IP \-
  389. Discovering how to call
  390. .I cc
  391. to get it to include the
  392. .I lex
  393. library.
  394. .IP \-
  395. Asking you for the type of system you have
  396. and creating the shell script "ack_sys" in the Kit's bin directory.
  397. Several utilities make use of "ack_sys" to determine the type of
  398. system you have.
  399. The current choice is between:
  400. .sp 1
  401. .TS
  402. c c c
  403. l l l.
  404. answer system type default machine
  405. pdp_v7 PDP11 with sep I/D and version 7 pdp
  406. vax_bsd4_1a VAX11 with BSD4.1a vax4
  407. vax_bsd4_2 VAX11 with BSD4.2 vax4
  408. vax_sysV_2 VAX11 with System V.2 vax4
  409. pc_ix IBM PC with PC/IX i86
  410. xenix3 IBM AT with Microsoft Xenix V3.2 xenix3
  411. m68_unisoft Motorola 68000 with Unisoft UNIX m68k2
  412. m68_pmds Philips PMDS pmds
  413. m68_sysV_0 68000 with Uniplus UNIX System V.0 mantra
  414. sun3 Sun 3 Motorola 68020 workstation sun3
  415. sun2 Sun 2 Motorola 68010 workstation sun2
  416. SMALL Neither of the above, small address space i86
  417. ANY Neither of the above m68k2
  418. .TE
  419. .sp 1
  420. For some of these, the installation procedure has not been tested, as
  421. we don't have them.
  422. For others, the installation procedure has only been tested with earlier
  423. distributions, as we don't have those systems anymore.
  424. However,
  425. the pdp_v7, vax_bsd4_1a, sun3 and m68 systems are known to behave
  426. reasonably.
  427. The Sun systems should run Release 3.0 or newer.
  428. For ANY you can use any name you fancy,
  429. but the Kit will not be able to compile programs for your system.
  430. If you want to do that you have to read the section about "compilation
  431. on a different machine".
  432. .IP \-
  433. Automatically setting the default machine for which code is
  434. produced to your own type of system according to the table above.
  435. This in done in the file "h/local.h".
  436. See also the section 8.2.
  437. .IP \-
  438. Automatically editing a few description files that tell
  439. ACK to use your system's assembler.
  440. On the VAX the Kit uses the native assembler and linker.
  441. The description file lib/vax4/descr has to be altered to prevent
  442. attempts to assemble programs with unsuitable assemblers.
  443. The original descr file is copied to descr.orig.
  444. .IP \-
  445. The VAX backend cannot be booted on systems
  446. with a 16-bit address space systems.
  447. The program lib/cgg needs more memory than available to transform
  448. the table into files suitable for the C-compiler.
  449. Therefore files tables1.h and tables1.c have been provided in
  450. the directory mach/vax4/cg.
  451. These must be copied to tables.h and tables.c
  452. to get working code-generators for the VAX on PDP11's.
  453. You will hardly be able to use these, because the
  454. code generated by these programs cannot be
  455. assembled and loaded without a native VAX assembler,
  456. but its nice to be able to look at the code produced.
  457. The same problem occurs for the m68k2 backend and the m68020 backend,
  458. and the same solution is chosen.
  459. .IP \-
  460. On machines with a 16-bit address space, the C-compiler has no
  461. builtin preprocessor. Arangements are made to this effect.
  462. .IP \-
  463. On the PDP,
  464. .I ranlib
  465. is not used, because it does not work properly,
  466. at least, on our 2.9 BSD system it does'nt.
  467. This is done by creating a dummy shell script
  468. .I ranlib
  469. in the ACK bin directory.
  470. If you are sure that your
  471. .I ranlib
  472. does work properly, you can just remove the shell script before
  473. installing the Kit.
  474. .LP
  475. .sp 1
  476. Some actions still have to be done by hand.
  477. .sp 1
  478. .IP \-
  479. The installation of the PUBMAC macro package is not done
  480. automatically because you need super-user privileges to do
  481. that on most systems.
  482. This macro package is used with several of the documents
  483. provided in the Kit.
  484. .IP \-
  485. UNIX V7 as originally distributed contains a few bugs that
  486. prevent correct execution of some of the larger programs.
  487. See the section named "Fixes for the UNIX V7 system"
  488. about what to do.
  489. Berkeley 2.8 or 2.9 may also have some of these bugs.
  490. .IP \-
  491. The manual files for the Kit can be copied to their
  492. appropriate place in the system by giving the command "make install"
  493. in the man directory, but only
  494. .B after
  495. running the installation of the
  496. Kit itself.
  497. .NH
  498. Compiling the Kit
  499. .PP
  500. The next step in the installation process is to compile
  501. the sources in the Kit and install them in their places
  502. in the lib and bin directories.
  503. .PP
  504. Most directories containing sources have Makefiles
  505. used to compile and install the programs in that
  506. directory.
  507. All programs needed for compilation and/or cross compilation
  508. with the Kit are installed in the directories "bin" and "lib"
  509. by these Makefiles.
  510. These Makefiles adhere to a standard which is described in the
  511. section 9.
  512. .LP
  513. You do not have to start all these Makefiles separately.
  514. We wrote a shell script calling the make's needed to install
  515. the whole Kit.
  516. This script consists of the file TakeAction in the Kit's root
  517. directory and a few files called Action in some directories.
  518. The Action files describe in a very simple form which actions
  519. have to be performed in which directories.
  520. The default action is to start "make install && make clean".
  521. The output of each make is diverted to a file called "Out"
  522. in the same directory as the make was started in.
  523. If the make was successful (return code 0) the Out file is removed
  524. and the script TakeAction produces a small message telling you
  525. that it succeeded in fulfilling its goal.
  526. If the make was not successful (any other return code) the Out file
  527. is left alone for further examination and a small message telling you
  528. to look at that file is produced by TakeAction.
  529. .LP
  530. For some programs the scripts already know they can't be
  531. installed on your type of system.
  532. In that case they produce a message "Sorry, ....." and
  533. happily proceed with further installation commands.
  534. .PP
  535. Compilation of the whole Kit might take anything from a few
  536. hours to more than a day.
  537. If you do not want to install libraries etc. for a particular
  538. machine you can edit the file Action and remove the relevant entries.
  539. .PP
  540. If this compilation went reasonably successful you should be able
  541. to use the Kit.
  542. Read the next section and the manuals provided
  543. with the Kit (in the man directory) on how to use it.
  544. .NH 2
  545. Problems you may meet
  546. .NH 3
  547. on Unisoft m68000 systems.
  548. .PP
  549. The Unisoft C compiler has a bug which impedes the correct
  550. translation of the peephole optimizer.
  551. For a more detailed description of this phenomenen see
  552. the file "mach/m68k2/Unisoft_bug".
  553. .NH 3
  554. with backends
  555. .PP
  556. The backends for the PDP11, VAX with BSD4.1, Motorola 68000 and
  557. Intel 8086 have been heavily used by ourselves and are well tested.
  558. The backends for the other machines are known to run our own
  559. test programs,
  560. but might reveal errors when more heavily used.
  561. .NH 2
  562. An example output of TakeAction.
  563. .PP
  564. .DS
  565. System definition -- done
  566. EM definition -- done
  567. LL(1) Parser generator -- done
  568. EM definition library -- done
  569. C utilities -- done
  570. system-call interface module -- done
  571. string routines module -- done
  572. formatted print module -- done
  573. assertion module -- done
  574. memory allocation module -- done
  575. fast, linear time malloc -- done
  576. EM messages generation module -- done
  577. identifier table module -- done
  578. input module -- done
  579. ACK-object reading and writing module -- done
  580. EM-code reading module -- done
  581. EM code generation module -- done
  582. Modules -- done
  583. C preprocessor -- done
  584. ACK object utilities -- done
  585. Encode/Decode -- done
  586. Shell files in bin -- done
  587. EM assembler -- done
  588. EM Peephole optimizer -- done
  589. .
  590. .
  591. .
  592. EM Global optimizer -- done
  593. ACK archiver -- done
  594. Program 'ack' -- done
  595. Bootstrap for backend tables -- done
  596. Bootstrap for newest form of backend tables -- done
  597. LED link editor -- done
  598. TOPGEN target optimizer generator -- done
  599. C frontend -- done
  600. Basic frontend -- done
  601. Occam frontend -- done
  602. Intel 8086 assembler -- done
  603. Intel 8086 backend -- done
  604. Intel 8086 C libraries -- done
  605. Intel 8086 EM library -- done
  606. Intel 8086 Pascal library -- done
  607. Intel 8086 PC/IX systemcall library -- done
  608. Intel 8086 Basic library -- done
  609. Intel 8086 Occam library -- done
  610. Intel 8086 conversion program from ack.out --> PC/IX a.out -- done
  611. Intel 8086 support -- done
  612. .
  613. .
  614. .
  615. Motorola 68000 assembler -- done
  616. Motorola 68000 2-4 backend -- done
  617. Motorola 68000 2-4 conversion program -- done
  618. Motorola 68000 target optimizer -- done
  619. Motorola 68000 2-4 C libraries -- done
  620. Motorola 68000 2-4 EM library -- done
  621. Motorola 68000 2-4 Pascal library -- done
  622. Motorola 68000 2-4 System library -- done
  623. Motorola 68000 2-4 Basic library -- done
  624. Motorola 68000 2-4 Occam library -- done
  625. Sorry, Motorola 68000 interpreters can only be made on m68* systems
  626. Motorola 68000 2-4 support -- done
  627. .
  628. .
  629. .
  630. PDP 11 assembler -- done
  631. PDP 11 backend -- done
  632. PDP 11 target optimizer -- done
  633. Sorry, PDP 11 interpreter can only be made on pdp* systems
  634. Sorry, PDP 11 C libraries can only be made on pdp* systems
  635. Sorry, PDP 11 EM library can only be made on pdp* systems
  636. Sorry, PDP 11 systemcall library can only be made on pdp* systems
  637. Sorry, PDP 11 Pascal library can only be made on pdp* systems
  638. Sorry, PDP 11 Basic library can only be made on pdp* systems
  639. Sorry, PDP 11 Occam library can only be made on pdp* systems
  640. PDP 11 support -- done
  641. .
  642. .
  643. .
  644. Vax 4-4 backend -- done
  645. Sorry, Vax 4-4 C libraries can only be made on vax* systems
  646. Sorry, Vax 4-4 EM library can only be made on vax* systems
  647. Sorry, Vax 4-4 Occam library can only be made on vax* systems
  648. Sorry, Vax 4-4 Basic library can only be made on vax* systems
  649. Sorry, Vax 4-4 systemcall interface can only be made on vax* systems
  650. Vax target optimizer -- done
  651. Vax 4-4 support -- done
  652. M68020 assembler -- done
  653. M68020 backend -- done
  654. M68020 EM library -- done
  655. M68020 system call library -- done
  656. M68020 C libraries -- done
  657. M68020 PC library -- done
  658. M68020 Basic library -- done
  659. M68020 Occam library -- done
  660. Sorry, M68020 VME131 System V/68 R2V2.1 conversion can only be made on m68020 systems
  661. M68020 System V/68 support -- done
  662. Ack.out --> Sun 3 M68020 a.out format conversion program -- done
  663. Sun 3 M68020 systemcall library -- done
  664. Sun 3 M68020 C libraries -- done
  665. Sun 3 M68020 support -- done
  666. Ack.out --> Sun 2 M68000 a.out format conversion program -- done
  667. Sun 2 M68000 systemcall library -- done
  668. Sun 2 M68000 C libraries -- done
  669. Sun 2 M68000 support -- done
  670. .
  671. .
  672. .
  673. Failed for Pascal frontend, see lang/pc/pem/Out
  674. .DE
  675. .PP
  676. The lines starting with "Sorry, " tell you that certain programs cannot
  677. be translated on your machine.
  678. The lines starting with "Failed for" tell
  679. you that certain programs/libraries which were expected to,
  680. but did not compile.
  681. Only the Pascal frontend failed to compile in this example.
  682. If you want to repeat a certain part of the installation, look in
  683. the Action file for the directory in which that part is to be found.
  684. If that directory contains an Action file issue the command
  685. "sh EM_DIR/TakeAction", otherwise type "make install".
  686. .NH
  687. Commands
  688. .PP
  689. The following commands are available in the bin directory after compilation
  690. of the Kit:
  691. .sp 1
  692. .IP "\fIack\fP, \fIacc\fP, \fIabc\fP, \fIapc\fP, \fIocm\fP, \fIm2\fP and their links"
  693. .br
  694. The names mentioned here can be used to compile Pascal, C, etc... programs.
  695. Most of the links can be used to generate code for a particular
  696. machine.
  697. See also the section about "Machines".
  698. .IP \fIarch\fP
  699. .br
  700. The archiver used for the EM- and universal assembler/loader.
  701. .IP \fIaal\fP
  702. .br
  703. The archiver used for ACK objects.
  704. .IP \fIem\fP
  705. .br
  706. This program selects a interpreter to execute an e.out file.
  707. Interpreters exist for PDP-11 and Motorola 68000 systems.
  708. .IP \fIeminform\fP
  709. .br
  710. The program to unravel the post-mortem information of
  711. the EM interpretator for the PDP-11.
  712. .IP \fILLgen\fP
  713. .br
  714. The LL(1) parser generator.
  715. .IP \fIack_sys\fP
  716. .br
  717. A shell script producing an identification of your system.
  718. Used by some utilities to determine what is, and what is
  719. not feasible on your system. (Like translating PDP assembly).
  720. .IP \fImarch\fP
  721. .br
  722. A shell script used while compiling libraries.
  723. .IP "\fIasize\fP, \fIanm\fP, \fIastrip\fP"
  724. .br
  725. Do the same as \fIsize\fP, \fInm\fP and \fIstrip\fP, but for ACK object format.
  726. .IP \fImkdep\fP
  727. .br
  728. A dependency generator for makefiles.
  729. .IP "\fIcid\fP, \fIprid\fP, \fIcclash\fP"
  730. .br
  731. Some utilities for handling name clashes in C programs. Some
  732. systems have C-compilers with only 7 or 8 characters significant in
  733. identifiers.
  734. .IP \fIint\fP
  735. .br
  736. An EM interpreter. This one is written in C, and is very useful for checking
  737. out programs.
  738. .sp 1
  739. .LP
  740. We currently make the Kit available to our users by telling
  741. them that they should include the bin directory of the Kit in
  742. their PATH shell variable.
  743. The programs will still work when moved to a different
  744. directory or linked to.
  745. Copying should preferably be done with tar, since links are
  746. heavily used.
  747. Renaming of the programs linked to \fIack\fP will not always
  748. produce the desired result.
  749. This program uses its call name as an argument.
  750. Any call name not being \fIcc\fP, \fIacc\fP, \fIabc\fP, \fIpc\fP,
  751. \fIocm\fP, \fIm2\fP, or \fIapc\fP will be
  752. interpreted as the name of a 'machine description' and the
  753. program will try to find a description file with that name.
  754. The installation process will only touch the utilities in the Kit's bin
  755. directory, not your own copies.
  756. .NH
  757. Machines
  758. .PP
  759. Underneath you will find a table with entries for all commands in
  760. the bin directory used to (cross)compile for a particular machine.
  761. The name in the first column give the name in the bin directory.
  762. The column headed dir indicates which subdirectories of
  763. lib are needed for compilation.
  764. The column head i/p contains the integer and pointer size used in units of
  765. bytes.
  766. The subdirectories with the same name in mach contain the sources.
  767. A * in the column headed 'fp' indicates that floating point can be used
  768. for that particular machine. A + in that column indicates that floating
  769. point is only available under the '-fp' option. In this case, software
  770. floating point emulation is used.
  771. .TS
  772. c c c c c c c
  773. l l l l l l l.
  774. command system i/p languages fp dir remarks
  775. pdp PDP/UNIX V7 2/2 C * pdp needs sep. I/D
  776. Pascal No assembler
  777. Basic
  778. Occam
  779. Modula-2
  780. vax4 VAX/BSD 4.? 4/4 C * vax4 No assembler
  781. System V.2 Pascal
  782. Basic
  783. Occam
  784. Modula-2
  785. m68k2 M68000/Unisoft 2/4 C + m68k2
  786. Pascal
  787. Basic
  788. Occam
  789. Modula-2
  790. m68k4 M68000/Unisoft 4/4 C + m68k4
  791. Pascal m68k2
  792. Basic
  793. Occam
  794. Modula-2
  795. pmds M68000/PMDS 2/4 C + pmds Philips Micro
  796. Pascal m68k2 Devel. System
  797. Basic
  798. Occam
  799. Modula-2
  800. pmds4 M68000/PMDS 4/4 C + pmds4 Philips Micro
  801. Pascal m68k2 Devel. System
  802. Basic m68k4
  803. Occam
  804. Modula-2
  805. mantra M68000/SysV.0 4/4 C + mantra
  806. Pascal m68k2
  807. Basic m68k4
  808. Occam
  809. Modula-2
  810. m68020 M68020/V/68 4/4 C + m68020
  811. R2V2.1 Pascal
  812. Basic
  813. Occam
  814. Modula-2
  815. sun3 SUN 3 R3.0 4/4 C + sun3
  816. Pascal m68020
  817. Basic
  818. Occam
  819. Modula-2
  820. sun2 SUN 2 R3.0 4/4 C + sun2
  821. Pascal m68k4
  822. Basic m68k2
  823. Occam
  824. Modula-2
  825. i86 IBM PC/IX 2/2 C + i86 IBM PC with PC/IX
  826. Pascal Causes kernel crashes
  827. Basic
  828. Occam
  829. Modula-2
  830. xenix3 Microsoft Xenix V3 2/2 C + xenix3 IBM AT with Xenix
  831. Pascal i86
  832. Basic
  833. Occam
  834. Modula-2
  835. minix Minix PC 2/2 C + minix IBM PC running Minix
  836. Pascal i86
  837. Basic
  838. Occam
  839. Modula-2
  840. minixST ST Minix 2/4 C + minixST Atari ST running Minix
  841. Pascal m68k2
  842. Basic
  843. Occam
  844. Modula-2
  845. z8000 Zilog 8000 2/2 C z8000 Central Data
  846. Pascal CPU board
  847. Basic Uses assembler/loader
  848. Occam
  849. Modula-2
  850. em22 EM machine 2/2 C * em22 Needs interpreter
  851. Pascal
  852. Basic
  853. Occam
  854. Modula-2
  855. em24 EM machine 2/4 C * em24 Needs interpreter
  856. Pascal
  857. Basic
  858. Occam
  859. Modula-2
  860. em44 EM machine 4/4 C * em44 Needs interpreter
  861. Pascal
  862. Basic
  863. Occam
  864. Modula-2
  865. 6500 6502/BBC 2/2 C 6500 Uses assembler/loader
  866. Pascal
  867. Basic
  868. Occam
  869. Modula-2
  870. 6800 Bare 6800 6800 Assembler only
  871. 6805 Bare 6805 6805 Assembler only
  872. 6809 Bare 6809 6809 Assembler only
  873. ns Bare NS16032 4/4 C ns
  874. Pascal
  875. Basic
  876. Occam
  877. Modula-2
  878. i80 Hermac/z80 2/2 C i80
  879. Pascal
  880. Basic
  881. Occam
  882. Modula-2
  883. z80 Hermac/z80 2/2 C z80 \fIi80\fP is faster
  884. Pascal
  885. Basic
  886. Occam
  887. Modula-2
  888. s2650 Signetics 2650 s2650 Assembler only
  889. .TE
  890. .PP
  891. The commands \fBem22\fP, \fBem24\fP and \fBem44\fP
  892. produce e.out files with EM machine code which must be interpreted.
  893. The Kit contains three interpreters: one running under PDP 11/V7 UNIX,
  894. one for the M68000, running under the PMDS system, SUN systems,
  895. the Mantra system, etc, and one, written in C and running on large machines.
  896. The first one can only interpret 2/2 e.out files,
  897. the second takes 2/4 and 4/4 files,
  898. and the last one takes 2/2, 2/4 and 4/4.
  899. The PDP 11 interpreter executes floating point instructions.
  900. The interpreter for the M68000 traps if you try to use floating point.
  901. .LP
  902. The program \fBem\fP in the bin directory calls the appropriate
  903. interpreter.
  904. The interpreters are sought in the em22, em24 and em44
  905. subdirectories of lib.
  906. The third interpreter is available on large machines as the program \fIint\fP
  907. in the bin directory.
  908. .NH
  909. Compilation on a different machine.
  910. .PP
  911. The Kit be installed and used as a cross-compiler
  912. for C and Basic programs on any UNIX machine.
  913. The presence of most UNIX utilities is essential for compilation.
  914. A few of the programs you certainly need are: C-compiler, Yacc, sed,
  915. make and lex.
  916. Except for the Pascal compiler proper all programs
  917. can be translated on a normal UNIX system, like V7, BSD4.1.
  918. .NH 2
  919. Backend
  920. .PP
  921. The existence of a backend with a system call library
  922. for your system is essential
  923. if you wish to produce executable files for that system.
  924. Rewriting the system call library if the one supplied does
  925. not work on your system is fairly straightforward.
  926. If no backend exists for your CPU type you have to write one yourself
  927. which is a major undertaking.
  928. .NH 2
  929. Pascal
  930. .PP
  931. When you can produce executable code it is also possible to boot the Pascal
  932. Compiler,
  933. which is written in Pascal itself.
  934. The Kit contains the compact code files for the 2/2, 4/4 and 2/4
  935. versions of the Pascal compiler.
  936. The Makefile automatically tries to boot the Pascal compiler
  937. from one of these compact code files, if the compiler proves
  938. unable to compile itself.
  939. .NH 2
  940. Universal assembler/loader, link editor
  941. .PP
  942. The native assemblers and loaders are used on PDP-11 and VAX.
  943. The description files in lib/*/descr for other systems use our
  944. universal assembler and for most machines our link editor.
  945. The load file produced is not directly
  946. usable in any system known to us,
  947. but has to be converted before it can be put to use.
  948. The \fIcv\fP programs convert our a.out format into
  949. executable files.
  950. The \fIdl\fP programs present for some machines unravel
  951. our a.out files and transmit commands to load memory
  952. to a microprocessor over a serial line.
  953. The file man/ack.out.5 contains a description of the format of
  954. the universal assembler load file.
  955. It might be useful to those who wish or need to write their
  956. own conversion programs.
  957. Also, a module is included to read and write our a.out format.
  958. See modules/man/object.3.
  959. .NH 2
  960. Compiling libraries
  961. .PP
  962. The Kit contains sources for part II and III of the C-library.
  963. These files can be used to make libraries for the Ack C-compiler.
  964. The recompilation process uses a few include files.
  965. The include directory in the EM home directory contains the include files
  966. it needs.
  967. An effort has been made to make the part III stuff as system independent as
  968. possible.
  969. .NH
  970. Options
  971. .NH 2
  972. Default machine
  973. .PP
  974. There is one important option in h/local.h.
  975. The utility \fIack\fP uses a default machine name when called
  976. as \fIacc\fP, \fIcc\fP, \fIabc\fP, \fIapc\fP, \fIpc\fP, \fIocm\fP,
  977. \fIm2\fP, or \fIack\fP.
  978. The machine name used for default is determined by the
  979. definition of ACKM in h/local.h.
  980. The Kit is distributed with "vax4" as the default machine,
  981. but the shell script "first" in the directory "first" alters this
  982. to suit your own system.
  983. There is nothing against using the Kit as a cross-compiler
  984. and by default produce code that can't run on your own system.
  985. But...., you have to alter the Makefile for the Pascal frontend
  986. in that case.
  987. That Makefile assumes that calling \fBapc\fP and \fBacc\fP will
  988. produce a.out's that can run on your own system.
  989. Change the definitions of ACC and APC in that Makefile according to your
  990. needs.
  991. .NH 2
  992. Pathnames
  993. .PP
  994. Absolute pathnames are concentrated in "h/em_path.h".
  995. Only the Pascal runtime system and the utilities \fIack\fP and \fILLgen\fP use
  996. absolute pathnames to access files in the Kit.
  997. The tree is distributed with /usr/em as the working
  998. directory.
  999. The definition of EM_DIR in em_path.h should be altered to
  1000. specify the root
  1001. directory for the Compiler Kit distribution on your system.
  1002. This is done automatically the the shell script "first" in the
  1003. directory "first".
  1004. Em_path.h also specifies which directory should be used for
  1005. temporary files.
  1006. Most programs from the Kit do indeed use that directory
  1007. although some remain stubborn and use /tmp or /usr/tmp.
  1008. .LP
  1009. The shape of the tree should not be altered lightly because
  1010. most Makefiles and the
  1011. utility \fIack\fP know the shape of the ACK tree.
  1012. All pathnames in all Makefiles are relative, that is do not
  1013. have "/" as the first character.
  1014. The knowledge of the utility \fIack\fP about the shape of the tree is
  1015. concentrated in the files in the directory lib/*/descr and lib/descr/*.
  1016. .NH
  1017. Makefiles
  1018. .PP
  1019. Most directories contain a "Makefile".
  1020. Apart from commands applying to that specific directory these
  1021. files all recognize a few special commands.
  1022. When called with one of these they will apply the command to
  1023. their own directory and all subdirectories.
  1024. The special commands are:
  1025. .sp 1
  1026. .IP "install" 20
  1027. recompile and install all binaries and libraries.
  1028. .br
  1029. Some Makefiles allow errors to occur in the programs they call.
  1030. They ignore such errors and notify the user with the message
  1031. "~....... error code n: ignored".
  1032. Whenever such a message appears in the output you can ignore it
  1033. too.
  1034. .IP "cmp"
  1035. recompile all binaries and libraries and compare them to the
  1036. ones already installed.
  1037. .IP pr
  1038. print the sources and documentation on the standard output.
  1039. .IP opr
  1040. make pr | opr
  1041. .br
  1042. Opr should be an off-line printer daemon.
  1043. On some systems it exists under another name e.g. lpr.
  1044. The easiest way to call such a spooler is using a shell script
  1045. with the name opr that calls lpr.
  1046. This script should be placed in /usr/bin or EM_DIR/bin or
  1047. one of the directories in your PATH.
  1048. .IP clean
  1049. remove all files not needed for day-to-day use,
  1050. that is binaries not in bin or lib, object files etc.
  1051. .LP
  1052. Example:
  1053. .nf
  1054. .sp 1
  1055. make install
  1056. .sp 1
  1057. .fi
  1058. given as command in the home directory will cause
  1059. compilation of all programs in the directory and copying of the results
  1060. to the bin and lib directories.
  1061. .NH
  1062. Fixes for the UNIX V7 system
  1063. .PP
  1064. UNIX System V7 has a few bugs that prevent a part of or the whole Kit
  1065. from working properly. Berkeley 2.8 and/or 2.9 may also suffer from this
  1066. problem.
  1067. To be honest, we do not know which of the following changes are
  1068. essential to the functioning of our Kit. The change to "ld" is.
  1069. .PP
  1070. The file "doc/v7bugs.doc" gives for each of the following bugs
  1071. a small test program and a diff listing of the source files that have to be
  1072. modified.
  1073. .IP 1
  1074. Bug in the C optimizer for unsigned comparison
  1075. .nr PD 0
  1076. .IP 2
  1077. The loader 'ld' fails for large data and text portions
  1078. .IP 3
  1079. Floating point registers are not saved if more memory is needed.
  1080. .IP 4
  1081. Floating point registers are not copied to child in fork().
  1082. .nr PD 1v
  1083. .LP
  1084. Use the test programs to see if the errors are present in your system
  1085. and to check if the modifications are effective.
  1086. .PP
  1087. You may also have to change /usr/src/cmd/cc.c (/bin/cc) to pass the
  1088. .B -i
  1089. flag to
  1090. .I ld.
  1091. Also, /usr/src/cmd/ld.c (/bin/ld) may have to be changed to increase the
  1092. number of library positions it can hold.
  1093. On our (2.9 BSD) version, this is the constant
  1094. .I NROUT.
  1095. It must be at least 400.
  1096. This may require separate I&D.
  1097. Also, our version does not check that the table does not overflow.
  1098. .NH
  1099. Testing
  1100. .PP
  1101. Test sets are available in Pascal, C, Basic and EM assembly.
  1102. .IP em 8
  1103. .br
  1104. The directory emtest contains a few EM test programs.
  1105. The EM assembly files in these tests must be transformed into
  1106. load files.
  1107. These tests use the LIN and NOP instructions to mark the passing of each
  1108. test.
  1109. The NOP instruction prints the current line number during the
  1110. test phase.
  1111. Each test notifies its correctness by calling LIN with a unique
  1112. number followed by a NOP which prints this line number.
  1113. The test finishes normally with 0 as the last number printed
  1114. In all other cases a bug showed its
  1115. existence.
  1116. .IP Pascal
  1117. .br
  1118. The directory lang/pc/test contains a few Pascal test programs.
  1119. All these programs print the number of errors found and a
  1120. identification of these errors.
  1121. .sp 1
  1122. .ti +4
  1123. We also tested Pascal with the Validation Suite.
  1124. The Validation Suite is a collection of more than 200 Pascal programs,
  1125. designed by Brian Wichmann and Arthur Sale to test Pascal compilers.
  1126. We are not allowed to distribute it, but you may
  1127. request a copy from
  1128. .DS
  1129. Richard J. Cichelli
  1130. A.N.P.A.
  1131. 1350 Sullivan Trail
  1132. P.O. Box 598
  1133. Easton, Pennsylvania 18042
  1134. USA
  1135. .DE
  1136. .IP C
  1137. .br
  1138. The sub-directories in lang/cem/ctest contain C test programs.
  1139. The idea behind these tests is:
  1140. when you have a program called xx.c, compile it into xx.cem.
  1141. Run it with standard output to xx.cem.r, compare this file to
  1142. xx.cem.g, a file containing the 'ideal' output.
  1143. Any differences will point to implementation differences or
  1144. bugs.
  1145. Giving the command "run gen" or plain "run" starts this
  1146. process.
  1147. The differences will be presented on standard output.
  1148. The contents of the result files depend on the wordsize,
  1149. the xx.cem.g files on the distribution are intended for a
  1150. 32-bit machine.
  1151. .IP Basic
  1152. .br
  1153. The directory lang/basic/test contains some forty basic programs.
  1154. Not all of these programs are correct, some have syntactic errors,
  1155. some simply don't work.
  1156. The Makefile in that directory attempts to compile and run
  1157. these tests.
  1158. If it compiles its output is compared to a file with suffix .g
  1159. which contains the output to be expected.
  1160. The make should be started with its standard input diverted
  1161. to /dev/null.
  1162. An example of the output of a make is present in the file Out.std.
  1163. .NH
  1164. Documentation
  1165. .PP
  1166. Manual pages for Amsterdam Compiler Kit can be copied
  1167. to "/usr/man/man?" by the
  1168. following commands:
  1169. .DS
  1170. cd man
  1171. make install
  1172. .DE
  1173. but do this \fBafter\fR compiling the Kit.
  1174. .LP
  1175. Several documents are provided:
  1176. .TS
  1177. l l.
  1178. doc/toolkit.doc general overview (CACM article)
  1179. doc/em description of the EM machine architecture
  1180. doc/ack.doc format of machine description files (lib/*/descr)
  1181. doc/basic.doc Basic reference manual
  1182. doc/pcref.doc Pascal-frontend reference manual
  1183. doc/val.doc results of running the Pascal Validation Suite
  1184. doc/crefman.doc C-frontend description
  1185. doc/LLgen description of the LL(1) parser generator
  1186. doc/peep.doc internal documentation for the peephole optimizer
  1187. doc/cg.doc documentation for backend writers and maintainers
  1188. doc/regadd.doc addendum to previous document describing register variables
  1189. doc/ncg.doc documentation for the newest backends
  1190. doc/v7bugs.doc bugs in the V7 system and how to fix them
  1191. doc/6500.doc MSC 6500 backend description
  1192. doc/i80.doc Intel 8080 backend description
  1193. doc/z80.doc Zilog Z80 backend description
  1194. doc/m68020.doc Motorola M68000/M68020 backend description
  1195. doc/occam Occam-frontend description
  1196. doc/ego Global Optimizer description
  1197. doc/top Target Optimizer description
  1198. doc/int description of the EM interpreter written in C
  1199. doc/m2ref.doc Modula-2 frontend description
  1200. doc/install.doc this document
  1201. doc/install.pr this document (formatted)
  1202. .TE
  1203. .PP
  1204. The names in this list without a suffix are in fact a subdirectory.
  1205. Use the Makefile to get readable copies.
  1206. .LP
  1207. Good luck.