aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Brooksby2013-05-11 17:52:01 +0100
committerRichard Brooksby2013-05-11 17:53:40 +0100
commit2f79ef3b9ead1de4eac7bdc960bedd9f29cb3c1c (patch)
tree58d14eac4eb93c460eb7fd58544d49a6e2372216
parent9f81b9b8a03805e9cee010f818ec5b74c70da638 (diff)
downloademacs-2f79ef3b9ead1de4eac7bdc960bedd9f29cb3c1c.tar.gz
emacs-2f79ef3b9ead1de4eac7bdc960bedd9f29cb3c1c.zip
Converting design.mps.config to restructuredtext. rewriting, correcting, clarifying, and generally bringing it up-to-date.
Removing misplaced obsolete design text from mpstd.h. Tidying up the format of a couple of other docs. Copied from Perforce Change: 181717 ServerID: perforce.ravenbrook.com
-rw-r--r--mps/code/mpstd.h45
-rw-r--r--mps/design/config.txt606
-rw-r--r--mps/design/config/index.html537
-rw-r--r--mps/design/guide.hex.trans.txt24
-rw-r--r--mps/design/index.html2
-rw-r--r--mps/readme.txt26
6 files changed, 640 insertions, 600 deletions
diff --git a/mps/code/mpstd.h b/mps/code/mpstd.h
index 61a20d3cbf2..8298e98be26 100644
--- a/mps/code/mpstd.h
+++ b/mps/code/mpstd.h
@@ -9,51 +9,22 @@
9 * documentation, or, in the case of GCC, from the compiler itself. 9 * documentation, or, in the case of GCC, from the compiler itself.
10 * References to the documentation appear above each detection line. 10 * References to the documentation appear above each detection line.
11 * 11 *
12 * For more details on how this file fits into the MPS build system,
13 * and an explanation of all the MPS_* defines, see design.config.pf
14 * "MPS Configuration" <../design/config.txt>
15 *
12 * .macos.ppc.align: MacOS / PowerPC requires 8 bytes alignment (in 16 * .macos.ppc.align: MacOS / PowerPC requires 8 bytes alignment (in
13 * general). See "Mac OS Runtime Architecture", table 4-2. 17 * general). See "Mac OS Runtime Architecture", table 4-2.
14 */
15
16#ifndef mpstd_h
17#define mpstd_h
18
19/* DESIGN NOTES
20 * ------------
21 * [These should be moved to a proper buildsys design doc. RHSK]
22 *
23 * mpstd.h does two main things:
24 * 1. platform detection by looking at preprocessor symbols;
25 * 2. setting variables (eg. MPS_PF_STRING, MPS_WORD_WIDTH).
26 *
27 * Sometimes the platform is *already* known by the buildsystem:
28 * - the Global Graphics buildsystem always sets CONFIG_PF_*.
29 * - the Ravenbrook buildsystem knows the platform and may (but
30 * typically does not) set CONFIG_PF_*.
31 *
32 * Regardless of this, mpstd.h still attempts to detect the platform.
33 * (This is intentional). However if both CONFIG_PF_* and
34 * CONFIG_PF_STRING are set, then mpstd.h performs a third function:
35 * 3. checking that the detected platform corresponds to that
36 * specified by CONFIG_PF_*.
37 *
38 * Sometimes no MPS buildsystem is in use, so the platform *must*
39 * be detected. For example, when client software #includes mps.h,
40 * we want it to just work out of the box with whatever compiler is
41 * being used. In other words we do not require the client to define
42 * CONFIG_PF_*.
43 * (This is the case that justifies mpstd.h doing platform detection
44 * by looking at preprocessor symbols; otherwise we'd simply use
45 * CONFIG_PF_*).
46 * 18 *
47 * mpstd.h fails if it cannot detect the platform (even if CONFIG_PF_* 19 * mpstd.h fails if it cannot detect the platform (even if CONFIG_PF_*
48 * is specified). This is intentional. mpstd.h does *not* allow 20 * is specified). This is intentional. mpstd.h does *not* allow
49 * CONFIG_PF_* to override the platform as detected from preprocessor 21 * CONFIG_PF_* to override the platform as detected from preprocessor
50 * symbols. This is intentional. 22 * symbols. This is intentional. [This needs justifying. RB 2013-05-11]
51 *
52 * References:
53 * GG buildsys use of CONFIG_PF_*:
54 * <http://info.ravenbrook.com/mail/2005/03/01/15-45-17/0.txt>
55 */ 23 */
56 24
25#ifndef mpstd_h
26#define mpstd_h
27
57 28
58/* Visual C++ 2.0, Books Online, C/C++ Book, Preprocessor Reference, 29/* Visual C++ 2.0, Books Online, C/C++ Book, Preprocessor Reference,
59 * Chapter 1: The Preprocessor, Macros, Predefined Macros. 30 * Chapter 1: The Preprocessor, Macros, Predefined Macros.
diff --git a/mps/design/config.txt b/mps/design/config.txt
new file mode 100644
index 00000000000..ab640a9f205
--- /dev/null
+++ b/mps/design/config.txt
@@ -0,0 +1,606 @@
1MPS Configuration
2=================
3
4:Tag: design.mps.config
5:Author: Richard Brooksby
6:Date: 1997-02-19
7:Status: incomplete design
8:Revision: $Id$
9:Copyright: See section `C. Copyright and License`_.
10
11
12Introduction
13------------
14
15_`.intro`: This document describes how the `Memory Pool System
16<http://www.ravenbrook.com/project/mps/>`_ source code is configured so
17that it can target different architectures, operating systems, build
18environments, varieties, and products.
19
20
21
22Requirements
23------------
24
25_`.req.import`: The MPS must be simple to include in third-party projects.
26
27_`.req.arch`: Allow architecture specific configurations of the MPS, so
28that we can vary the MPS according to the target architecture.
29
30_`.req.os`: Allow operating system specific configurations of the MPS,
31so that we can vary the MPS according to the target OS.
32
33_`.req.builder`: Allow build environment specific configurations of the
34MPS, so that we can vary the MPS according to the compiler, etc.
35
36_`.req.var`: Allow configurations with different amounts of
37instrumentation (assertions, metering, etc.).
38
39_`.req.impact`: The configuration system should have a minimal effect on
40maintainability of the implementation.
41
42_`.req.port`: The system should be easy to port across platforms.
43
44_`.req.maint`: Maintenance of the configuration and build system should
45not consume much developer time.
46
47
48Retired requirements
49....................
50
51_`.req.prod`: Allow product specific configurations of the MPS, so that
52we can build variants of the MPS for use in different products. This
53requirement has been retired on 2012-09-03 as part of work on the
54variety-reform_ branch. Client-specific customisation of the MPS will
55be handled in source control, while the MPS source remains generic, to
56reduce costs and increase reliability. See [RB_2012-09-13]_.
57
58
59
60Definitions
61-----------
62
63_`.def.platform`: A *platform* is a combination of an architecture
64(.def.arch_), an operating system (.def.os_), and a builder
65(`.def.builder`_). The set of supported platforms is maintained in the
66`Platforms section of "Building the Memory Pool System"
67<../manual/html/guide/build.html#platforms>`_.
68
69_`.def.arch`: An *architecture* is processor type with associated calling
70conventions and other binary interface stuff these days often called the
71`ABI <http://en.wikipedia.org/wiki/Application_binary_interface>`_.
72Most importantly for the MPS it determines the layout of the register
73file, thread context, and thread stack.
74
75_`.def.os`: An *operating system* is the interface to external resources.
76Most importantly for the MPS it determines the low level interface to
77virtual memory (if any) and threading.
78
79_`.def.builder`: A *builder* is the tools (C compiler, etc.) used to make
80the target (.def.target). The MPS minimises use of compiler-specific
81extensions, but this is handy for suppressing warnings, inlining hints,
82etc.
83
84_`.def.var`: A *variety* determines things like the amount of debugging,
85internal consistency checking, annotation, etc. In modern IDEs this
86called a "build configuration" and the usual default is to have two:
87"debug" and "release". The MPS predates this convention, but the concept
88is the same.
89
90_`.def.prod`: A *product* is the intended product into which the MPS will
91fit, e.g. ScriptWorks, Dylan, etc. We no longer maintain this concept
92as a dimension of configuration since .req.prod_ has been retired.
93
94_`.def.target`: The *target* is the result of the build.
95
96
97Overview
98--------
99
100_`.import.source`: The MPS can be simply included in client products as
101source code. Since `version 1.110`_ we made it possible to simply
102include the file ``mps.c`` in a client's build process, without
103requiring a separate build of the MPS or linking a library. This is
104described `section 2.3.1, "Compiling for production" of the MPS manual
105<../manual/html/guide/build.html#compiling-for-production>`_.
106
107.. _`version 1.110`: http://www.ravenbrook.com/project/mps/version/1.110/
108
109_`.no-gen`: No generated code or external tools are required. On most
110platforms the only tool is the C compiler. On 64-bit Windows we require
111the assembler since Microsoft withdrew in-line assembler from their C
112compiler.
113
114_`.no-spaghetti`: Several of the MPS team have worked on some extremely
115messy code bases which used a great number of ``#ifdef`` statements.
116These quickly became very expensive to maintain and develop. The
117general rule in the MPS is "no ``#ifdefs``". Instead, platform-specific
118code is kept in separate source files and selected by carefully controlled
119``#ifdefs``, such as in `mps.c <../code/mps.c>`_.
120
121_`.min-dep`: Dependency on a particular configuration should be
122minimized and localized when developing code. This is enshrined in the
123general rules for implementation [ref?] that are enforced by MPS
124development procedures including code review and inspection.
125
126
127The Build System
128----------------
129
130Abstract Build Function
131.......................
132
133_`.build.fun`: The MPS implementation assumes only a simple "build
134function" that takes a set of sources, possibly in several languages,
135compiles them with a set of predefined preprocessor symbols, and links
136the result with a set of libraries to form the target::
137
138 target := build(<defs>, <srcs>, <libs>)
139
140_`.build.sep`: Separate compilation and linkage can be seen as a
141memoization of this function, and is not strictly necessary for the
142build. Indeed, since `version 1.110` we found that modern compilers are
143quite happy to compile the whole MPS in one go `.import.source`_.
144
145_`.build.cc`: A consequence of this approach is that it should always be possible
146to build a complete target with a single UNIX command line calling the compiler
147driver (usually "cc" or "gcc"), for example::
148
149 cc -o main -DCONFIG_VAR_DF foo.c bar.c baz.s -lz
150
151_`.build.defs`: The "defs" are the set of preprocessor macros which are to be
152predefined when compiling the module sources::
153
154 CONFIG_VAR_<variety-code>
155
156The variety-codes are the letter code that appears after "variety." in
157the tag of the relevant variety document (see variety.*) converted to
158upper case. Currently (2012-09-03):
159
160_`.var.hot`: ``HOT``
161 Intended for release in products. Optimised, reduced internal
162 checking, especially on the `critical path <critical-path.txt>`_
163 [RB_2012-09-07]_.
164
165_`.var.cool`: ``COOL``
166 Intended for use during development. Moderately thorough internal
167 consistency checking. Reduced optimisation to allow for
168 single-stepping.
169
170_`.var.rash`: ``RASH``
171 No internal checking at all. Slight performance improvement over
172 `.var.hot`_ at the cost of early detection of memory management
173 bugs. We do not advise use of this variety, as memory management
174 bugs tend to be extremely expensive to deal with.
175
176_`.var.diag`: ``DIAG`` (deprecated)
177 This variety does some client-specific analysis and produces some
178 specialised diagnostic output, and is not intended for general use.
179 It will be phased out of the open sources.
180
181_`.default.hot`: If no ``CONFIG_VAR`` is present, ``HOT`` is assumed in
182`config.h`_.
183
184_`.build.srcs`: The "srcs" are the set of sources that must be compiled in order
185to build the target. The set of sources may vary depending on the
186configuration. For example, different sets of sources may be required to build
187different architectures. [This is a dependency between the makefile (or whatever)
188and the module configuration in `config.h`_.]
189
190_`.build.libs`: The "libs" are the set of libraries to which the compiled sources
191must be linked in order to build the target. For example, when building a test
192program, it might include the ANSI C library and an operating system interface
193library.
194
195
196File Structure
197..............
198
199_`.file.dir`: The MPS source code is arranged in a single directory
200called "code" containing all the sources for the whole family of
201targets.
202
203_`.file.base`: The names of sources must be unique in the first eight
204characters in order to conform to FAT filesystem naming restrictions.
205(Do not scoff -- this has been an important requirement as recently as
2062012!)
207
208_`.file.ext`: The extension may be up to three characters and directly
209indicates the source language.
210
211_`.file.platform`: Platform-specific files include the platform code
212in their name. See `.mod.impls`_.
213
214
215Modules and Naming
216..................
217
218_`.mod.unique`: Each module has an identifier which is unique within the MPS.
219
220_`.mod.impls`: Each module has one or more implementations which may be
221in any language supported by the relevant build environment.
222_`.mod.primary`: The primary implementation of a module is written in
223target-independent ANSI C in a source file with the same name as the
224module. _`.mod.an`: Where there are platform-specific implementations
225and an inferior portable ANSI C fallback implementation, "an" is used in
226place of the platform code. _`.mod.secondary`: The names of other
227implementations should begin with the same prefix (the module id or a
228shortened version of it) and be suffixed with on or more target
229parameter codes (defined below). In particular, the names of assembly
230language sources must include the target parameter code for the relevant
231architecture.
232
233_`.mod.example`: For example, the stack scanner is defined in `ss.h
234<../code/ss.h>`_ (which is platform-independent). It has some
235platform-independent C in `ss.c <../code/ss.c>`_ and, for example,
236`ssw3i6mv.c <../code/ssw3i6mv.c>`_ is specific to Windows on the x64
237architecture built with Microsoft Visual C.
238
239
240Build System Rationale
241......................
242
243_`.build.rat`: This simple design makes it possible to build the MPS
244using many different tools. Microsoft Visual C and other graphical
245development tools do not support much in the way of generated sources,
246staged building, or other such stuff. The Visual C and Xcode "project"
247files correspond closely to a closure of the build function
248(`.build.fun`_). The simplicity of the build function has also made it
249easy to set up builds using NMAKE (DOS), MPW (Macintosh), and to get the
250MPS up and running on other platforms such as FreeBSD and Linux in very
251little time. The cost of maintaining the build systems on these various
252platforms is also reduced to a minimum, allowing the MPS developers to
253concentrate on primary development. The source code is kept simple and
254straightforward. When looking at MPS sources you can tell exactly what
255is going to be generated with very little context. The sources are not
256munged beyond the standard ANSI C preprocessor.
257
258_`.build.port`: The portability requirement (`.req.port`_) implies that
259the build system must use only standard tools that will be available on
260all conceivable target platforms. Experience of development
261environments on the Macintosh (Metrowerks Codewarrior) and Windows NT
262(Visual C++) indicates that we cannot assume much sophistication in the
263use of file structure by development environments. The best that we can
264hope for is the ability to combine a fixed list of source files,
265libraries, and predefined preprocessor symbols into a single target.
266
267_`.build.maint`: The maintainability requirement (`.req.maint`_) implies
268that we don't spend time trying to develop a set of tools to support
269anything more complicated than the simple build function described
270above. The effort in constructing and maintaining a portable system of
271this kind is considerable. Such efforts failed in the Electronic
272Publishing division of Harlequin.
273
274
275Implementation
276--------------
277
278[ Now in impl.h.config, may symbols out of date. GavinM 1997-08-07 ]
279
280_`.impl`: The two implementation files `config.h`_ and `mpstd.h`_ can be
281seen as preprocessor programs which "accept" build parameters and "emit"
282configuration parameters (`.fig.impl`_). The build parameters are
283defined either by the builder (in the case of target detection) or by
284the build function (in the case of selecting the variety).
285
286_`.fig.impl`::
287
288 build parameters configuration parameters
289
290 CONFIG_VAR_DF --> config.h --> MPS_VAR_DF, ASSERT_MPM, etc.
291
292 _WIN32 --> mpstd.h --> MPS_OS_W3, etc.
293
294_`.impl.dep`: No source code, other than the directives in `config.h`_
295and `mpstd.h`_, should depend on any build parameters. That is,
296identifers beginning "CONFIG\_" should only appear in impl.h.config.
297Code may depend on configuration parameters in certain, limited ways, as
298defined below (`.conf`_).
299
300.. _`config.h`: <../code/config.h>
301.. _`mpstd.h`: <../code/mpstd.h>
302
303
304Target Platform Detection
305.........................
306
307_`.pf`: The target platform is "detected" by the preprocessor directives in
308`mpstd.h`_.
309
310_`.pf.form`: This file consists of sets of directives of the form::
311
312 #elif <conjunction of builder predefinitions>
313 #define MPS_PF_<platform code>
314 #define MPS_OS_<operating system code>
315 #define MPS_ARCH_<architecture code>
316 #define MPS_BUILD_<builder code>
317 #define MPS_T_WORD <word type>
318 #define MPS_T_ULONGEST <longest unsigned integer type>
319 #define MPS_WORD_SHIFT <word shift>
320 #define MPS_PF_ALIGN <minimum alignment>
321
322_`.pf.detect`: The conjunction of builder predefinitions is a constant
323expression which detects the target platform. It is a logical AND of
324expressions which look for preprocessor symbols defined by the build
325environment to indicate the target. These must be accompanied by a
326reference to the build tool documentation from which the symbols came.
327For example::
328
329 /* "Predefined Macros" from "Visual Studio 2010" on MSDN
330 * <http://msdn.microsoft.com/en-us/library/b0084kay(v=vs.100).aspx>. */
331
332 #elif defined(_MSC_VER) && defined(_WIN32) && defined(_M_IX86)
333
334_`.pf.codes`: The declarations of the platform, operating system,
335architecture, and builder codes define preprocessor macros corresponding
336the the target detected (`.pf.detect`_). For example::
337
338 #define MPS_PF_W3I3MV
339 #define MPS_OS_W3
340 #define MPS_ARCH_I3
341 #define MPS_BUILD_MV
342
343_`.pf.word`: The declaration of ``MPS_T_WORD`` defines the unsigned
344integral type which corresponds, on the detected target, to the machine
345word. It is used to defined the MPS Word type (design.mps.type.word).
346[Insert backwards ref there.] (We avoid using ``typedef`` here because
347`mpstd.h`_ could potentially be included in assembly language source
348code.) For example::
349
350 #define MPS_T_WORD unsigned long
351
352_`.pf.word-width`: The declaration of ``MPS_WORD_WIDTH`` defines the
353number of bits in the type defined by `MPS_T_WORD` (`.pf.word`_) on the
354target. For example::
355
356 #define MPS_WORD_WIDTH 32
357
358_`.pf.word-shift`: The declaration of ``MPS_WORD_SHIFT`` defines the log
359to the base 2 of ``MPS_WORD_WIDTH``. For example::
360
361 #define MPS_WORD_SHIFT 5
362
363_`.pf.pf-align`: The declaration of ``MPS_PF_ALIGN`` defines the minimum
364alignment which must be used for a memory block to permit any normal
365processor memory access. In other words, it is the maximum alignment
366required by the processor for normal memory access. For example::
367
368 #define MPS_PF_ALIGN 4
369
370_`.pf.ulongest`: The declaration of ``MPS_T_ULONGEST`` defines the
371longest available unsigned integer type on the platform. This is
372usually just ``unsigned long`` but under Microsoft C on 64-bit Windows
373``unsigned long`` is just 32-bits (curse them!) For example::
374
375 #define MPS_T_ULONGEST unsigned __int64
376
377_`.pf.pf-string`: The declaration of ``MPS_PF_STRING`` defines a string
378that is used to identify the target platform in `version.c
379<../code/version.c>`_. For example::
380
381 #define MPS_PF_STRING "w3i6mv"
382
383
384Target Varieties
385................
386
387_`.var`: The target variety is handled by preprocessor directives in
388impl.h.config. _`.var.form`: The file contains sets of directives of
389the form::
390
391 #elif defined(CONFIG_VAR_DF)
392 #define MPS_VAR_DF
393 #define ASSERT_MPSI
394 #define ASSERT_MPM
395 etc.
396
397_`.var.detect`: The configured variety is one of the variety
398preprocessor definitions passed to the build function (`.build.defs`_),
399e.g. ``CONFIG_VAR_HOT``. These are decoupled so that it's possible to
400tell the difference between overridden settings etc. [Explain.]
401
402_`.var.symbols`: The directives should define whatever symbols are
403necessary to control annotations. These symbols parameterize other
404parts of the code, such as the declaration of assertions, etc. The
405symbols should all begin with the prefix ``MPS_VAR\_``.
406
407
408[Tidy this up:]
409Note, anything which can be configured, is configured, even if it's just
410configured to "NONE" meaning nothing. This makes sure that you can't
411choose something by omission. Where these symbols are used there will
412be a #error to catch the unused case. Exception: To allow simple
413building of the MPS with "cc -c mps.c" we choose CONFIG_VAR_HOT by
414default.
415[This is a general principle which applies to other configuration stuff too.]
416
417
418Source Code Configuration
419-------------------------
420
421_`.conf`: This section describes how the configuration may affect the
422source code of the MPS.
423
424_`.conf.limit`: The form of dependency allowed is carefully limited to
425ensure that code remains maintainable and portable (`.req.impact`_).
426
427_`.conf.min`: The dependency of code on configuration parameters should
428be kept to a minimum in order to keep the system maintainable
429(`.req.impact`_).
430
431
432Configuration Parameters
433........................
434
435_`.conf.params`: The compilation of a module is parameterized by::
436
437 MPS_ARCH_<arch-code>
438 MPS_OS_<os-code>
439 MPS_BUILDER_<builder-code>
440 MPS_PF_<platform-code>
441
442
443Abstract and Concrete Module Interfaces
444.......................................
445
446_`.abs.caller`: Basic principle: the caller musn't be affected by
447configuration of a module. This reduces complexity and dependency of
448configuration. All callers use the same abstract interface. Caller
449code does not change.
450
451_`.abs.interface`: Abstract interface includes:
452
453- method definitions (logical function prototypes which may be macro methods)
454- names of types
455- names of constants
456- names of structures and fields which form part of the interface, and
457 possibly their types, depending on the protocol defined
458- the protocols
459
460_`.abs.rule`: The abstract interface to a module may not be altered by a
461configuration parameter. However, the concrete interface may vary.
462
463For example, this isn't allowed, because there is a change in the interface::
464
465 #if defined(PROT_FOO)
466 void ProtSpong(Foo foo, Bar bar);
467 #else
468 int ProtSpong(Bar bar, Foo foo);
469 #endif
470
471This example shows how::
472
473 #ifdef PROTECTION
474 void ProtSync(Space space);
475 /* more decls. */
476 #else /* PROTECTION not */
477 #define ProtSync(space) NOOP
478 /* more decls. */
479 #endif /* PROTECTION */
480
481or::
482
483 #if defined(PROT_FOO)
484 typedef struct ProtStruct {
485 int foo;
486 } ProtStruct;
487 #define ProtSpong(prot) X((prot)->foo)
488 #elif defined(PROT_BAR)
489 typedef struct ProtStruct {
490 float bar;
491 } ProtStruct;
492 #define ProtSpong(prot) Y((prot)->bar)
493 #else
494 #error "No PROT_* configured."
495 #endif
496
497Configuration parameters may not be used to vary implementations in C files.
498For example, this sort of thing::
499
500 int map(void *base, size_t size)
501 {
502 #if defined(MPS_OS_W3)
503 VirtualAlloc(foo, bar, base, size);
504 #elif defined(MPS_OS_SU)
505 mmap(base, size, frob);
506 #else
507 #error "No implementation of map."
508 #endif
509 }
510
511This violates `.no-spaghetti`_.
512
513
514To document
515-----------
516- What about constants in config.h?
517- Update files to refer to this design document.
518- Explain the role of ``mps.c``
519- Reference to ``build.txt``
520- Procedures for adding an architecture, etc.
521- Reduce duplication in this document (especially after
522 `Configuration Parameters`_ which looks like it's been pasted in from
523 elsewhere.)
524
525
526A. References
527-------------
528
529.. [MPS_Manual] "Memory Pool System documentation"; Ravenbrook Limited;
530 <http://www.ravenbrook.com/project/mps/master/manual/html/>.
531
532.. [RB_2012-09-07] "The critical path through the MPS"; `Richard Brooksby <RB>`_;
533 Ravenbrook Limited; 2012-09-07;
534 <http://www.ravenbrook.com/project/mps/master/design/critical-path>.
535
536.. [RB_2012-09-13] "The Configura CET custom mainline"; `Richard
537 Brooksby <RB>`_; Ravenbrook Limited; 2013-09-13;
538 <https://info.ravenbrook.com/mail/2012/09/13/16-43-35/0/>.
539
540.. [PP_2005-03-01] "MPS platforms"; Pekka Pirinen; Global Graphics;
541 <https://info.ravenbrook.com/mail/2005/03/01/15-45-17/0.txt>.
542
543
544B. Document History
545-------------------
546
547- 1997-02-19 RB_ Initial draft based on discussions of configuration at
548 meeting.general.1997-02-05.
549
550- 1997-02-20? RB_ Various improvements and clarifications to the draft
551 discussed between RB_ and NB_ at meeting.general.1997-02-19.
552
553- 2002-06-07 RB_ Converted from MMInfo database design document.
554
555- 2012-09-03 RB_ Updated for variety-reform_ branch, to remove untrue
556 things, though the document could do with a rewrite.
557
558- 2013-05-11 RB_ Converted to reStructuredText. Clarified various
559 sections, brought some up-to-date, and removed obsolete junk.
560
561.. _variety-reform: http://www.ravenbrook.com/project/mps/branch/2012-08-15/variety-reform/
562.. _RB: http://www.ravenbrook.com/consultants/rb/
563.. _NB: http://www.ravenbrook.com/consultants/nb/
564
565
566C. Copyright and License
567------------------------
568
569Copyright (C) 2013 Ravenbrook Limited. All rights reserved.
570<http://www.ravenbrook.com/>. This is an open source license. Contact
571Ravenbrook for commercial licensing options.
572
573Redistribution and use in source and binary forms, with or without
574modification, are permitted provided that the following conditions are
575met:
576
5771. Redistributions of source code must retain the above copyright
578 notice, this list of conditions and the following disclaimer.
579
5802. Redistributions in binary form must reproduce the above copyright
581 notice, this list of conditions and the following disclaimer in the
582 documentation and/or other materials provided with the distribution.
583
5843. Redistributions in any form must be accompanied by information on how
585 to obtain complete source code for this software and any
586 accompanying software that uses this software. The source code must
587 either be included in the distribution or be available for no more than
588 the cost of distribution plus a nominal fee, and must be freely
589 redistributable under reasonable conditions. For an executable file,
590 complete source code means the source code for all modules it contains.
591 It does not include source code for modules or files that typically
592 accompany the major components of the operating system on which the
593 executable file runs.
594
595**This software is provided by the copyright holders and contributors
596"as is" and any express or implied warranties, including, but not
597limited to, the implied warranties of merchantability, fitness for a
598particular purpose, or non-infringement, are disclaimed. In no event
599shall the copyright holders and contributors be liable for any direct,
600indirect, incidental, special, exemplary, or consequential damages
601(including, but not limited to, procurement of substitute goods or
602services; loss of use, data, or profits; or business interruption)
603however caused and on any theory of liability, whether in contract,
604strict liability, or tort (including negligence or otherwise) arising in
605any way out of the use of this software, even if advised of the
606possibility of such damage.**
diff --git a/mps/design/config/index.html b/mps/design/config/index.html
deleted file mode 100644
index 829addd1a94..00000000000
--- a/mps/design/config/index.html
+++ /dev/null
@@ -1,537 +0,0 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
3<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
4
5<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
7<head>
8
9<title>The design of MPS configuration</title>
10
11</head>
12
13<body bgcolor="#FFFFFF" text="#000000" link="#000099" vlink="#660066" alink="#FF0000">
14
15<div align="center">
16
17<p>
18<a href="/">Ravenbrook</a> /
19<a href="/project/">Projects</a> /
20<a href="/project/mps/">Memory Pool System</a> /
21<a href="/project/mps/master/">Master Product Sources</a> /
22<a href="/project/mps/master/design/">Design Documents</a>
23</p>
24
25<p><i><a href="/project/mps/">Memory Pool System Project</a></i></p>
26
27<hr />
28
29</div>
30
31<pre>
32 THE DESIGN OF MPS CONFIGURATION
33 design.mps.config
34 incomplete design
35 richard 1997-02-19
36
37INTRODUCTION
38
39<a id="intro" name="intro">.intro</a>: This document describes how the MPS configuration is parameterized so
40that it can target different architectures, operating systems, build
41environments, varieties, and products.
42
43<a id="bg" name="bg">.bg</a>: For background see [build system mail, configuration mail,
44meeting.general.something]
45
46
47Document History
48
49<a id="hist.0" name="hist.0">.hist.0</a>: Initial draft created by Richard Brooksby &lt;richard&gt; on 1997-02-19
50based on discussions of configuration at meeting.general.1997-02-05.
51
52<a id="hist.1" name="hist.1">.hist.1</a>: Various improvements and clarifications to the draft discussed between
53Richard and Nick Barnes &lt;nickb&gt; at meeting.general.1997-02-19.
54
55
56REQUIREMENTS
57
58<a id="req.arch" name="req.arch">.req.arch</a>: Allow architecture specific configurations of the MPS.
59
60<a id="req.os" name="req.os">.req.os</a>: Allow operating system specific configurations of the MPS.
61
62<a id="req.builder" name="req.builder">.req.builder</a>: Allow build environment (compiler, etc.) specific configurations
63of the MPS.
64
65<a id="req.prod" name="req.prod">.req.prod</a>: Allow product specific
66configurations of the MPS. [This requirement has been retired on
672012-09-03. Client-specific customisation of the MPS will be handled by
68configuration management, while the MPS source remains generic, to
69reduce costs and increase reliability. RB 2012-09-03]
70
71<a id="req.var" name="req.var">.req.var</a>: Allow configurations with different amounts of instrumentation
72(assertions, metering, etc.).
73
74<a id="req.impact" name="req.impact">.req.impact</a>: The configuration system should have a minimal effect on
75maintainability of the implementation.
76
77<a id="req.port" name="req.port">.req.port</a>: The system should be easy to port across operating systems.
78
79<a id="req.maint" name="req.maint">.req.maint</a>: Maintenance of the configuration and build system should not
80consume much developer time.
81
82
83
84DEFINITIONS
85
86<a id="def.platform" name="def.platform">.def.platform</a>: A platform is a combination of an architecture (.def.arch), an
87operating system (.def.os), and a builder (.def.builder). The set of supported
88platforms is platform.*.
89
90<a id="def.arch" name="def.arch">.def.arch</a>: An architecture is processor type with associated calling
91conventions and other binary interface stuff.
92
93<a id="def.os" name="def.os">.def.os</a>: An operating system is the interface to external resources.
94
95<a id="def.builder" name="def.builder">.def.builder</a>: A builder is the tools (C compiler, etc.) used to make the target
96(.def.target).
97
98<a id="def.var" name="def.var">.def.var</a>: A variety is a combination of annotations such as assertions,
99metering, etc.
100
101<a id="def.prod" name="def.prod">.def.prod</a>: A product is the intended product into which the MPS will fit, e.g.
102ScriptWorks, Dylan, etc.
103
104<a id="def.target" name="def.target">.def.target</a>: The target is the result of the build.
105
106
107OVERVIEW
108
109- No automatically generated code. Use only C compiler and linker.
110- Simple build function (design.mps.buildsys.????)
111- Avoid conditional code spaghetti in implementations.
112- Dependency on a particular configuration should be minimized and localized
113when developing code.
114
115
116THE BUILD SYSTEM
117
118
119Abstract Build Function
120
121<a id="build.fun" name="build.fun">.build.fun</a>: The MPS implementation assumes only a simple "build function" which
122takes a set of sources, possibly in several languages, compiles them with a set
123of predefined preprocessor symbols, and links the result with a set of
124libraries to form the target:
125
126 target := build(&lt;defs&gt;, &lt;srcs&gt;, &lt;libs&gt;)
127
128<a id="build.sep" name="build.sep">.build.sep</a>: Separate compilation and linkage can be seen as a memoization of
129this function, and is not strictly necessary for the build.
130
131<a id="build.cc" name="build.cc">.build.cc</a>: A consequence of this approach is that it should always be possible
132to build a complete target with a single UNIX command line calling the compiler
133driver (usually "cc" or "gcc"), for example:
134
135 cc -o main -DCONFIG_VAR_DF foo.c bar.c baz.s -lz
136
137<a id="build.defs" name="build.defs">.build.defs</a>: The "defs" are the set of preprocessor macros which are to be
138predefined when compiling the module sources.
139
140 CONFIG_VAR_&lt;variety-code&gt;
141
142The variety-codes are the letter code that appears after "variety." in the
143tag of the relevant variety document (see variety.*) converted to upper case.
144Currently (2012-09-03): RASH, HOT, COOL, DIAG, TI
145
146If no CONFIG_VAR is present, HOT is assumed in <code/config.h>.
147
148<a id="build.srcs" name="build.srcs">.build.srcs</a>: The "srcs" are the set of sources that must be compiled in order
149to build the target. The set of sources may vary depending on the
150configuration. For example, different sets of sources may be required to build
151on different architectures. [This is a dependency between the makefile (or whatever)
152and the module configuration in config.h.]
153
154<a id="build.libs" name="build.libs">.build.libs</a>: The "libs" are the set of libraries to which the compiled sources
155must be linked in order to build the target. For example, when building a test
156program, it might include the ANSI C library and an operating system interface
157library.
158
159
160File Structure
161
162<a id="file.dir" name="file.dir">.file.dir</a>: Each product consists of a single directory (corresponding to a HOPE
163compound) containing all the sources for the whole family of targets.
164<a id="file.base" name="file.base">.file.base</a>: The names of sources must be unique in the first eight characters
165in order to conform to FAT filesystem naming restrictions. <a id="file.ext" name="file.ext">.file.ext</a>: The
166extension may be up to three characters and directly indicates the source
167language.
168
169[Where is the set of valid extensions and languages defined?]
170
171
172Modules and Naming
173
174<a id="mod.unique" name="mod.unique">.mod.unique</a>: Each module has an identifier which is unique within the MPS.
175<a id="mod.impls" name="mod.impls">.mod.impls</a>: Each module has one or more implementations which may be in any
176language supported by the relevant build environment. <a id="mod.primary" name="mod.primary">.mod.primary</a>: The
177primary implementation of a module is written in target-independent ANSI C in a
178source file with the same name as the module. [This seems to be with an "an"
179suffix now. GavinM 1997-08-07] <a id="mod.secondary" name="mod.secondary">.mod.secondary</a>: The names of other
180implementations should begin with the same prefix (the module id or a shortened
181version of it) and be suffixed with on or more target parameter codes (defined
182below). In particular, the names of assembly language sources must include the
183target parameter code for the relevant architecture.
184
185
186Build System Rationale
187
188<a id="build.rat" name="build.rat">.build.rat</a>: This simple design makes it possible to build the MPS using many
189different tools. Microsoft Visual C++, Metrowerks Codewarrior, and other
190graphical development tools do not support much in the way of generated
191sources, staged building, or other such stuff. The Visual C and Metrowerks
192"project" files correspond closely to a closure of the build function
193(.build.fun). The simplicity of the build function has also made it easy to
194set up builds using NMAKE (DOS), MPW (Macintosh), and to get the MPS up and
195running on other platforms such as FreeBSD and Linux in very little time. The
196cost of maintaining the build systems on these various platforms is also
197reduced to a minimum, allowing the MM Group to concentrate on primary
198development. The source code is kept simple and straightforward. When looking
199at MPS sources you can tell exactly what is going to be generated with very
200little context. The sources are not munged beyond the standard ANSI C
201preprocessor.
202
203<a id="build.port" name="build.port">.build.port</a>: The portability requirement (.req.port) implies that the build
204system must use only standard tools that will be available on all conceivable
205target platforms. Experience of development environments on the Macintosh
206(Metrowerks Codewarrior) and Windows NT (Visual C++) indicates that we cannot
207assume much sophistication in the use of file structure by development
208environments. The best that we can hope for is the ability to combine a fixed
209list of source files, libraries, and predefined preprocessor symbols into a
210single target.
211
212<a id="build.maint" name="build.maint">.build.maint</a>: The maintainability requirement (.req.maint) implies that we
213don't spend time trying to develop a set of tools to support anything more
214complicated than the simple build function described above. The effort in
215constructing and maintaining a portable system of this kind is considerable.
216Such efforts have failed in EP.
217
218
219IMPLEMENTATION
220
221[ Now in impl.h.config, may symbols out of date. GavinM 1997-08-07 ]
222
223<a id="impl" name="impl">.impl</a>: The two implementation files impl.h.config and impl.h.mpstd can be seen
224as preprocessor programs which "accept" build parameters and "emit"
225configuration parameters (.fig.impl). The build parameters are defined either
226by the builder (in the case of target detection) or by the build function (in
227the case of selecting the variety).
228
229<a id="fig.impl" name="fig.impl">.fig.impl</a>:
230
231 build parameters configuration parameters
232
233 CONFIG_VAR_COOL --&gt; config.h --&gt; ASSERT_AND_CHECK, TELEMETRY, etc.
234
235 _WIN32 --&gt; mpstd.h --&gt; MPS_OS_W3, etc.
236
237<a id="impl.dep" name="impl.dep">.impl.dep</a>: No source code, other than the directives in impl.h.config and
238impl.h.mpstd, should depend on any build parameters. That is, identifiers
239beginning "CONFIG_" should only appear in impl.h.config. Code may depend on
240configuration parameters in certain, limited ways, as defined below (.conf).
241
242
243Target Platform Detection
244
245<a id="pf" name="pf">.pf</a>: The target platform is "detected" by the preprocessor directives in
246impl.h.mpstd.
247<a id="pf.form" name="pf.form">.pf.form</a>: This file consists of sets of directives of the form:
248
249 #elif &lt;conjunction of builder predefinitions&gt;
250 #define MPS_PF_&lt;platform code&gt;
251 #define MPS_OS_&lt;operating system code&gt;
252 #define MPS_ARCH_&lt;architecture code&gt;
253 #define MPS_BUILD_&lt;builder code&gt;
254 #define MPS_T_WORD &lt;word type&gt;
255 #define MPS_WORD_SHIFT &lt;word shift&gt;
256 #define MPS_PF_ALIGN &lt;minimum alignment&gt;
257
258<a id="pf.detect" name="pf.detect">.pf.detect</a>: The conjunction of builder predefinitions is a constant expression
259which detects the target platform. It is a logical AND of expressions which
260look for preprocessor symbols defined by the build environment to indicate the
261target. These must be accompanied by a reference to the build tool
262documentation from which the symbols came. For example:
263
264 /* Visual C++ 2.0, Books Online, C/C++ Book, Preprocessor Reference, */
265 /* Chapter 1: The Preprocessor, Macros, Predefined
266
267 #elif defined(_MSC_VER) &amp;&amp; defined(_WIN32) &amp;&amp; defined(_M_IX86)
268
269<a id="pf.codes" name="pf.codes">.pf.codes</a>: The declarations of the platform, operating system, architecture,
270and builder codes define preprocessor macros corresponding the the target
271detected (.pfm.detect). For example:
272
273 #define MPS_PF_W3I3MV
274 #define MPS_OS_W3
275 #define MPS_ARCH_I3
276 #define MPS_BUILD_MV
277
278<a id="pf.word" name="pf.word">.pf.word</a>: The declaration of MPS_T_WORD defines the unsigned integral type
279which corresponds, on the detected target, to the machine word. It is used to
280defined the MPS Word type (design.mps.type.word). [Insert backwards ref
281there.] For example:
282
283 #define MPS_T_WORD unsigned long
284
285<a id="pf.word-width" name="pf.word-width">.pf.word-width</a>: The declaration of MPS_WORD_WIDTH defines the number of bits in
286the type defined by MPS_T_WORD (.pf.word) on the target. For example:
287
288 #define MPS_WORD_WIDTH 32
289
290<a id="pf.word-shift" name="pf.word-shift">.pf.word-shift</a>: The declaration of MPS_WORD_SHIFT defines the log to the base 2
291of MPS_WORD_WIDTH. For example:
292
293 #define MPS_WORD_SHIFT 5
294
295<a id="pf.pf-align" name="pf.pf-align">.pf.pf-align</a>: The declaration of MPS_PF_ALIGN defines the minimum alignment
296which must be used for a memory block to permit any normal processor memory
297access. In other words, it is the maximum alignment required by the processor
298for normal memory access. For example:
299
300 #define MPS_PF_ALIGN 4
301
302
303Target Varieties
304
305<a id="var" name="var">.var</a>: The target variety is handled by preprocessor directives in
306impl.h.config. <a id="var.form" name="var.form">.var.form</a>: The file contains sets of directives of the form:
307
308 #elif defined(CONFIG_VAR_DF)
309 #define MPS_VAR_DF
310 #define ASSERT_MPSI
311 #define ASSERT_MPM
312 etc.
313
314<a id="var.detect" name="var.detect">.var.detect</a>: The configured variety is one of the variety preprocessor
315definitions passed to the build function (.build.defs), e.g. CONFIG_VAR_DF.
316[These are decoupled so that it's possible to tell the difference between
317overridden settings etc. Explain.]
318
319<a id="var.symbols" name="var.symbols">.var.symbols</a>: The directives should define whatever symbols are necessary to
320control annotations. These symbols parameterize other parts of the code, such
321as the declaration of assertions, etc. The symbols should all begin with the
322prefix "MPS_VAR_".
323
324
325[Tidy this up:]
326Note, anything which can be configured, is configured, even if it's just
327configured to "NONE" meaning nothing. This makes sure that you can't choose
328something by omission. Where these symbols are used there will be a #error to
329catch the unused case.
330Exception: To allow simple building of the MPS with "cc -c mps.c" we choose
331CONFIG_VAR_HOT by default.
332[This is a general principle which applies to other configuration stuff too.]
333
334
335SOURCE CODE CONFIGURATION
336
337<a id="conf" name="conf">.conf</a>: This section describes how the configuration may affect the source code
338of the MPS.
339
340<a id="conf.limit" name="conf.limit">.conf.limit</a>: The form of dependency allowed is carefully limited to ensure that
341code remains maintainable and portable (.req.impact).
342
343<a id="conf.min" name="conf.min">.conf.min</a>: The dependency of code on configuration parameters should be kept to
344a minimum in order to keep the system maintainable (.req.impact).
345
346
347Configuration Parameters
348
349<a id="conf.params" name="conf.params">.conf.params</a>: The compilation of a module is parameterized by:
350
351 MPS_ARCH_&lt;arch-code&gt;
352 MPS_OS_&lt;os-code&gt;
353 MPS_BUILDER_&lt;builder-code&gt;
354 MPS_PF_&lt;platform-code&gt;
355
356
357Abstract and Concrete Module Interfaces
358
359Basic principle: the caller must not be affected by configuration of a module.
360This reduces complexity and dependency of configuration.
361
362All callers use the same abstract interface. Caller code does not change.
363
364Abstract interface includes:
365 - method definitions (logical function prototypes which may be macro methods)
366 - names of types
367 - names of constants
368 - names of structures and fields which form part of the interface, and
369possibly their types, depending on the protocol defined
370 - the protocols
371
372The abstract interface to a module may not be altered by a configuration
373parameter. However, the concrete interface may vary.
374
375
376Configuring Module Implementations
377
378For example, this isn't allowed, because there is a change in the interface.
379
380 #if defined(PROT_FOO)
381 void ProtSpong(Foo foo, Bar bar);
382 #else
383 int ProtSpong(Bar bar, Foo foo);
384 #endif
385
386This example shows how:
387
388 #ifdef PROTECTION
389 void ProtSync(Space space);
390 /* more decls. */
391 #else /* PROTECTION not */
392 #define ProtSync(space) NOOP
393 /* more decls. */
394 #endif /* PROTECTION */
395
396or
397
398 #if defined(PROT_FOO)
399 typedef struct ProtStruct {
400 int foo;
401 } ProtStruct;
402 #define ProtSpong(prot) X((prot)-&gt;foo)
403 #elif defined(PROT_BAR)
404 typedef struct ProtStruct {
405 float bar;
406 } ProtStruct;
407 #define ProtSpong(prot) Y((prot)-&gt;bar)
408 #else
409 #error "No PROT_* configured."
410 #endif
411
412Configuration parameters may not be used to vary implementations in .c files.
413For example, this sort of thing:
414
415 int map(void *base, size_t size)
416 {
417 #if defined(MPS_OS_W3)
418 VirtualAlloc(foo, bar, base, size);
419 #elif defined(MPS_OS_SU)
420 mmap(base, size, frob);
421 #else
422 #error "No implementation of map."
423 #endif
424 }
425
426This leads to extreme code spaghetti. In effect, it's a "candy machine
427interface" on source code. This kind of thing should be done by having several
428implementations of the same interface in separate source files. If this leads
429to duplication of code then that code should be placed in a separate, common
430module.
431
432
433PROCEDURES
434
435[Adding an architecture, etc.]
436
437
438NOTES
439
440What about constants?
441
442To do:
443- Renaming of some stuff.
444- Introduce product selection.
445- Change makefiles.
446- Eliminate mpmconf.h by moving stuff to config.h.
447- Update files to refer to this design document.
448
449
450</pre>
451
452
453<h2><a id="section-A" name="section-A">A. References</a></h2>
454
455<!-- Template Entry
456
457<table>
458
459<tr valign="top">
460
461 <td>[<a id="ref-#REF#" name="ref-#REF#" href="#REF_URL#">#REF_NAME#</a>]</td>
462
463 <td>
464 "#REF_TITLE#";
465 #REF_AUTHOR#;
466 &lt;URL: <a href="#REF_URL#">#REF_URL#</a>&gt;;
467 #REF_DATE#.
468 </td>
469
470</tr>
471
472</table>
473
474-->
475
476
477<h2><a id="section-B" name="section-B">B. Document History</a></h2>
478
479<table>
480
481<tr valign="top">
482
483 <td>2002-06-07</td>
484
485 <td><a href="mailto:rb@ravenbrook.com">RB</a></td>
486
487 <td>Converted from MMInfo database design document.</td>
488
489 <td>2012-09-03</td>
490
491 <td><a href="mailto:rb@ravenbrook.com">RB</a></td>
492
493 <td>Updated for variety-reform branch, to remove untrue things, though the document could do with a rewrite.</td>
494
495</tr>
496
497</table>
498
499
500<h2><a id="section-C" name="section-C">C. Copyright and License</a></h2>
501
502<p> This document is copyright &copy; 1995-2002 <a href="http://www.ravenbrook.com/">Ravenbrook Limited</a>. All rights reserved. This is an open source license. Contact Ravenbrook for commercial licensing options. </p>
503
504<p> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: </p>
505
506<ol>
507
508<li> Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. </li>
509
510<li> Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. </li>
511
512<li> Redistributions in any form must be accompanied by information on how to obtain complete source code for the this software and any accompanying software that uses this software. The source code must either be included in the distribution or be available for no more than the cost of distribution plus a nominal fee, and must be freely redistributable under reasonable conditions. For an executable file, complete source code means the source code for all modules it contains. It does not include source code for modules or files that typically accompany the major components of the operating system on which the executable file runs. </li>
513
514</ol>
515
516<p> <strong> This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement, are disclaimed. In no event shall the copyright holders and contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. </strong> </p>
517
518
519<hr />
520
521<div align="center">
522
523<p><code>$Id$</code></p>
524
525<p>
526<a href="/">Ravenbrook</a> /
527<a href="/project/">Projects</a> /
528<a href="/project/mps/">Memory Pool System</a> /
529<a href="/project/mps/master/">Master Product Sources</a> /
530<a href="/project/mps/master/design/">Design Documents</a>
531</p>
532
533</div>
534
535</body>
536
537</html>
diff --git a/mps/design/guide.hex.trans.txt b/mps/design/guide.hex.trans.txt
index a7040fbc405..4aa1909c0b4 100644
--- a/mps/design/guide.hex.trans.txt
+++ b/mps/design/guide.hex.trans.txt
@@ -111,22 +111,22 @@ modification, are permitted provided that the following conditions are
111met: 111met:
112 112
1131. Redistributions of source code must retain the above copyright 1131. Redistributions of source code must retain the above copyright
114notice, this list of conditions and the following disclaimer. 114 notice, this list of conditions and the following disclaimer.
115 115
1162. Redistributions in binary form must reproduce the above copyright 1162. Redistributions in binary form must reproduce the above copyright
117notice, this list of conditions and the following disclaimer in the 117 notice, this list of conditions and the following disclaimer in the
118documentation and/or other materials provided with the distribution. 118 documentation and/or other materials provided with the distribution.
119 119
1203. Redistributions in any form must be accompanied by information on how 1203. Redistributions in any form must be accompanied by information on how
121to obtain complete source code for this software and any 121 to obtain complete source code for this software and any
122accompanying software that uses this software. The source code must 122 accompanying software that uses this software. The source code must
123either be included in the distribution or be available for no more than 123 either be included in the distribution or be available for no more than
124the cost of distribution plus a nominal fee, and must be freely 124 the cost of distribution plus a nominal fee, and must be freely
125redistributable under reasonable conditions. For an executable file, 125 redistributable under reasonable conditions. For an executable file,
126complete source code means the source code for all modules it contains. 126 complete source code means the source code for all modules it contains.
127It does not include source code for modules or files that typically 127 It does not include source code for modules or files that typically
128accompany the major components of the operating system on which the 128 accompany the major components of the operating system on which the
129executable file runs. 129 executable file runs.
130 130
131THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 131THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
132IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 132IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
diff --git a/mps/design/index.html b/mps/design/index.html
index a7f449ffe13..6cd80156941 100644
--- a/mps/design/index.html
+++ b/mps/design/index.html
@@ -129,7 +129,7 @@
129 129
130<tr valign="top"> 130<tr valign="top">
131 131
132 <td> <code><a href="config/">config/</a></code> </td> 132 <td> <code><a href="config">config/</a></code> </td>
133 133
134 <td> The design of MPS configuration </td> 134 <td> The design of MPS configuration </td>
135 135
diff --git a/mps/readme.txt b/mps/readme.txt
index 9d2237cc106..78eefa68b31 100644
--- a/mps/readme.txt
+++ b/mps/readme.txt
@@ -124,7 +124,7 @@ Document History
124Copyright and Licence 124Copyright and Licence
125--------------------- 125---------------------
126 126
127Copyright (C) 2001-2012 Ravenbrook Limited. All rights reserved. 127Copyright (C) 2001-2013 Ravenbrook Limited. All rights reserved.
128<http://www.ravenbrook.com/>. This is an open source license. Contact 128<http://www.ravenbrook.com/>. This is an open source license. Contact
129Ravenbrook for commercial licensing options. 129Ravenbrook for commercial licensing options.
130 130
@@ -133,22 +133,22 @@ modification, are permitted provided that the following conditions are
133met: 133met:
134 134
1351. Redistributions of source code must retain the above copyright 1351. Redistributions of source code must retain the above copyright
136notice, this list of conditions and the following disclaimer. 136 notice, this list of conditions and the following disclaimer.
137 137
1382. Redistributions in binary form must reproduce the above copyright 1382. Redistributions in binary form must reproduce the above copyright
139notice, this list of conditions and the following disclaimer in the 139 notice, this list of conditions and the following disclaimer in the
140documentation and/or other materials provided with the distribution. 140 documentation and/or other materials provided with the distribution.
141 141
1423. Redistributions in any form must be accompanied by information on how 1423. Redistributions in any form must be accompanied by information on how
143to obtain complete source code for this software and any 143 to obtain complete source code for this software and any
144accompanying software that uses this software. The source code must 144 accompanying software that uses this software. The source code must
145either be included in the distribution or be available for no more than 145 either be included in the distribution or be available for no more than
146the cost of distribution plus a nominal fee, and must be freely 146 the cost of distribution plus a nominal fee, and must be freely
147redistributable under reasonable conditions. For an executable file, 147 redistributable under reasonable conditions. For an executable file,
148complete source code means the source code for all modules it contains. 148 complete source code means the source code for all modules it contains.
149It does not include source code for modules or files that typically 149 It does not include source code for modules or files that typically
150accompany the major components of the operating system on which the 150 accompany the major components of the operating system on which the
151executable file runs. 151 executable file runs.
152 152
153THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 153THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
154IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 154IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED