Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
ImageFormat
Last updated at 1:34 pm UTC on 26 March 2020

Note that all SqueakLand images use the 6502 format.

6502- a 32-bit V3 image with no closure support and no native platform float word order requirement (6502)
6504- a 32-bit V3 image with closure support and no native platform float word order requirement (6504)
6505- a 32-bit V3 image with closure support and float words stored in native platform order (6505)
6521- a 32-bit Spur image with closure support and float words stored in native platform order using Spur object format (6521)
68000- a 64-bit V3 image with no closure support and no native platform float word order requirement (68000)
68002- a 64-bit V3 image with closure support and no native platform float word order requirement (68002)
68003- a 64-bit V3 image with closure support and float words stored in native platform order (68003)
68004- not used in practice but is a valid base number for 68021
68019- a 64-bit Spur image with closure support and float words stored in native platform order using Spur object format (obsolete) (68019)
68021- a 64-bit Spur image with closure support and float words stored in native platform order using Spur object format (68021)

The Squeak image is an object memory space that is loaded by the virtual machine (VM), usually from a data file (squeak.image). When activated by the VM, the object memory becomes a live object environment running under the control of the VM.

With ongoing development of VM, and associated changes to the structure of objects in the live object memory, it becomes necessary to identify the format of the image when saved externally (e.g. to a file on disk).

The "image format" is a numeric identifier, stored in the first few bytes of an image file, that identifies the format of the saved image. The VM uses this image format number to determine whether it is able to execute the image file, and possibly it identify characteristics of the image that may require special handling in the VM.

The known image format numbers, along with explanations of the VM capabilities required by that image format, are described in a Smalltalk package ImageFormat that is maintained in the VMMaker repository.

The main class in the ImageFormat package is class ImageFormat:

ImageFormat represents the requirements of the image in terms of capabilities that must be supported by the virtual machine. The image format version is saved as an integer value in the header of an image file. When an image is loaded, the virtual machine checks the image format version to determine whether it is capable of supporting the requirements of that image.

The image format version value is treated as a bit map of size 32, derived from the 32-bit integer value saved in the image header. Bits in the bit map represent image format requirements. For example, if the image sets bit 15 to indicate that it requires some capability from the VM, then the VM can check bit 15 and decide whether it is able to satisfy that requirement.

The base image format numbers (6502, 6504, 68000, and 68002) utilize 10 of the 32 available bits. The high order bit is reserved as an extension bit for future use. The remaining 21 bits are used to represent additional image format requirements. For example, the low order bit is used to indication that the image uses (and requires support for) the platform byte ordering implemented in the StackInterpreter (Cog) VM.


"(ImageFormat fromFile: Smalltalk imageName) description"


The Smalltalk class ImageFormat is also used to generate the source code for the C language ckformat program.


"ImageFormat createCkFormatProgram"


David T. Lewis
Fri, Dec 11, 2015 at 3:20 PM
Reply-To: The general-purpose Squeak developers list
To: Squeak Virtual Machine Development Discussion
Cc: The general-purpose Squeak developers list

On Thu, Dec 10, 2015 at 11:19:20PM -0500, Robert Withers wrote:
>
> I do need to hit up 4.6. But also, the newest interpreter is for image
> version 6505 and the updated image is 6521. I am not sure howe to proceed..

For an explanation of the various image formats, load package ImageFormat
from SqueakMap. Read the class comment first, then look at the class
side utility methods. Examples:

  ImageFormat versionDescriptions do: [:e | Transcript cr; show: e]

  (ImageFormat fromFile: Smalltalk imageName) description

Loosely speaking, Squeak 4.6 is image format 6505, and works with Cog
and interpreter VMs. Squeak 5.0 and trunk are image format 6521, and
work with Spur (32-bit).

Dave