[self-interest] Snapshot binary compatibility ?

Harald Gliebe harald at gliebe.de
Fri Jun 28 23:47:17 UTC 2002


> > One
> > reason why the sparc-Snapshots don't work on Linux/Intel is of course
> > the different endianess of the architectures, but this could easily
> > be converted. If the snapshots work on Sparc and Mac, I'll try to add
> > this feature for the Linux version.
>
> It would be a good idea to see how Squeak handles this. Having each
> platform save in its native endianess and read in either endianess
> would be the ideal. A simple header word is enough to detect a
> snapshot's format.
>
Thanks, with a quick hack I was able to convert the Demo.snap from the Sparc
version for the Linux version(available at
http://gliebe.de/self/Demo.snap.gz), I just had to convert everything except
one char (which indicates if the maps are canonical in the snapshot) and the
bytes of byteVectorOops and stringOops (which are stored in the upper part
of the spaces). Adding a header field to determine the endianess would be
ideal, but might break backward compatibility with existing snapshots and
would also require changes in the Sparc and Mac-versions.
Another possibilty would be to store everything in bigendian format, swaping
some bytes while loading and saving doesn't cost to much (the disk is
probably slower anyway).
I'll have a look at Squeak images before I decide wether to add an
command-line option to import Sparc/Mac-snapshots or use the big-endian
format as default.

> BTW, thanks for Linux Self 0.2.2! Just yesterday I had generated a quick
> and dirty Empty.snap from the 4.1.5 sources using the Linux 0.2.1 VM.
> The idea was to let those working in Linux use the latest GUI code for
> their efforts. The Linux specific Self level stuff was missing, of
> course, so I was working on adding that (though with some work arounds
> I actually got the 4.1.5 GUI running in Linux). To avoid having to
> repeat all this work for each release, I was thinking of putting all
> the changes in separate modules (like "linux-hosts.self",
> "linux-foreign.self" and "linux-unix.self").

That's a very good idea, I'll do it for the next version. Using diff with
*.self files isn't much fun.

Harald





More information about the Self-interest mailing list