Back: Invocation
Up: Using GNU Smalltalk
Forward: Syntax
 
Top: GNU Smalltalk User's Guide
Contents: Table of Contents
Index: Class index
About: About this document

2.2 Startup sequence

When GNU Smalltalk is invoked, the first thing it does is choosing two paths, respectively the "image path" and the "kernel path". the image path is set to the value of the SMALLTALK_IMAGE environment variable (if it is defined); if SMALLTALK_IMAGE is not defined, Smalltalk will try the path compiled in the binary (usually, under Unix systems, `/usr/local/share/gnu-smalltalk' or a similar data file path) and then the current directory.

The "kernel path" directory in which to look for each of the kernel method definition files. There are only two possibilities in this case: the directory pointed to by SMALLTALK_KERNEL if it is defined, and a subdirectory named `kernel' in the current directory. However, kernel files are not required to be in this directory: Smalltalk also knows about a system default location for kernel files, which is compiled in the binary (usually, under Unix systems, `/usr/local/share/gnu-smalltalk/kernel' or a similar data file path), and which is used for kernel files not found in the directory chosen as above.

Then, if the -i flag is not used, Smalltalk tries to find a saved binary image file in the image path. If this is found, it is checked to be compatible with the current version of Smalltalk and with the current system; Smalltalk is able to load an image created on a system with the same sizeof(long) but different endianness (for example, a 68k image on an x86), but not an image created on a system with different sizeof(long) like an Alpha image on an x86. Finally, if the images are compatible, it compares the write dates of all of the kernel method definition files against the write date of the binary image file.

If the image is not found, is incompatible, or older than any of the kernel files, a new image has to be created. The set of files that make up the kernel is loaded, one at a time. The list can be found in `lib/lib.c', in the standardFiles variable. If the image lies in the current directory, or if at least a kernel file was found outside of the system default path, a user-dependant `.stpre'(1)

At this point, independent of whether the binary image file was loaded or created, the initialize event is sent to the dependants of the special class ObjectMemory (see section 3.1 Memory accessing methods). After the initialization blocks have been executed, the user initialization file `.stinit' is loaded if found in the user's home directory(2).

Finally, if there were any files specified on the command line, they are loaded, otherwise standard input is read and executed until an EOF is detected. You are then able to operate GNU Smalltalk by typing in expressions to the `st>' prompt, and/or reading in files that contain Smalltalk code.

At some time, you may wish to abort what GNU Smalltalk is doing and return to the command prompt: you can use C-c to do this.




This document was generated on May, 12 2002 using texi2html