home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
s
/
s48.zip
/
INSTALL
< prev
next >
Wrap
Text File
|
1992-06-18
|
5KB
|
161 lines
-*- Mode: Indented-text; -*-
To install the system, it is sufficient to
1. Edit definitions of BIN, LIB, and MAN at top of Makefile as
appropriate for your system (see comments in Makefile).
If you like descriptive names you might also want to set
RUNNABLE = scheme48 instead of s48.
2. Run make. This creates scheme48vm (the virtual machine) from
the .c files.
At this point you may want to test the system; do
./scheme48vm -i scheme48.image
and type a few Scheme forms.
3. Do "make install" to copy scheme48vm to LIB and heap image file
to BIN/s48.
A more thorough test of the system is to have it build a fresh heap
image from sources. If scheme48 is already installed, you can do
make scheme48.image
If not, try this:
./scheme48vm -i scheme48.image
:load files.scm
(load-linker)
(link-system)
:exit
./scheme48vm -i boot/system.image
:load misc/command.scm
(command-processor #f)
:disable
:dump test.image
:exit
:exit
Now you can do ./scheme48vm -i test.image, etc.
See below for information on customizing the default heap image.
-----
The scheme48 directory should contain the following subdirectories:
rts run-time system sources
vm virtual machine sources
boot code to produce image files (perhaps using a Scheme
other than Scheme48)
misc useful hacks not included in the image by default
(inspector, pretty printer, disassembler,
bignums, etc.)
The scheme48 directory should contain the following files:
README
INSTALL this file
NEWS recent changes
TODO list of things to do
user-guide.txt user's guide
Makefile Makefile for Unix
Makefile.filenames included by Makefile, generated from files.scm
files.scm lists of file names
scheme48.image an image file containing the development environment
scheme48vm.c most of the VM (generated by PreScheme compiler)
main.c part of the VM
unix.c part of the VM
error.c part of the VM
scheme48.man a Unix-style man page
The PreScheme compiler isn't included in this distribution because
it's too rickety. The vm directory should therefore be considered to
be documentation, not source.
-----
If you edit files.scm, you'll want to do a "make Makefile.filenames"
before you do any further "make"s.
-----
Performance
If you don't have a C compiler that optimizes as well or better than
gcc does, then performance may suffer greatly. Take a look at the
automatically generated code in scheme48vm.c to find out why. With a
good register allocator, all those variables (including the virtual
machine's register) get allocated to hardware registers, and it really
flies. Without one, performance could be pretty bad.
To improve overall performance even more, maybe about 6-10%, it is
worthwhile to remove the range check from the interpreter's
instruction dispatch. To do this, use -S to get assembly code for
scheme48vm.c, then find the instructions in scheme48.s corresponding
to the big dispatch in perform_application():
L34459: {
long b_113X;
b_113X = (*((unsigned char *) RScode_pointerS));
RScode_pointerS = (RScode_pointerS + 1L);
switch (b_113X) {
... }
There will be one or two comparison instructions to see whether b_113X
is in range; just remove them. For the 68000 I use a "sed" script
/cmpl #158,d0/ N
/cmpl #158,d0\n jhi L/ d
but of course the constant may have to change when a new release comes
along.
-----
Customization:
Configuring your scheme48.image: by default, the image consists of a
core Scheme system (Revised^4 Scheme plus a very minimal
read-eval-print loop) together with a standard set of "options"
(command processor, debugging commands, inspector, disassembler,
generic arithmetic). The set of options is controlled by the
definition of MOREFILES in the Makefile. If you set this variable to
the empty string, then "make scheme48.image" will create an Scheme
system without any extras (like error recovery), and the image will be
smaller. The usual set is the EXTRAFILES defined in
Makefile.filenames, which is generated from the extra-files list in
files.scm. The files are listed in approximate order of decreasing
desirability; you'll probably want at least through
misc/debuginfo.scm.
You can choose subsets of the standard features either by putting a
modified version of EXTRAFILES from Makefile.filenames as the
definition of MOREFILES in Makefile, or by editing the definition of
extra-files in files.scm and doing "make Makefile.filenames".
After this, do
make scheme48.image
to rebuild the image.
-----
New versions of the run-time systems can be tested within existing
systems:
:load boot/primitives-for-debugging.scm
:load files.scm
(for-each load-file rts-files)
(?start bare #f)
The advantage of this is that one can use a working system's debugger
to track down errors that crop up during initialization. Otherwise,
if you simply write an image and try to start it directly from the VM,
you're liable to get an uninformative message like "exception handler
is not a closure".