New feature: packaging the image with the executable

Brian Rice water at tunes.org
Thu Feb 2 20:50:44 PST 2006


Hi all,

I've just added a patch which allows for a VERY simple and seemingly  
portable way to package the VM and image together for the appearance  
of seamless single-binary delivery.

Basically, pull the patch, which modifies the image-saving and  
loading functions of boot.c in the platform/ area to use a slight  
tweak to the image format. The tweak is to add a trailer to the image  
which states its size and specifies the "magic number" that we use in  
the header to detect endianness swaps. Then, re-run "make" so that  
you get a new VM and especially a new image - old images without the  
trailing suffix won't work. Basically, you take the VM and any new  
image you save with this VM and concatenate them together, e.g. "cat  
vm slate.image > slate_interp" and then mark that output file  
executable and you should be able to run it from anywhere, without  
having installed a global slate.image or other setup. In fact, the  
use of the "internal image" when it is available, precedes all the  
defaults, so only a -i/--image command-line option will override it.

It's not very useful yet, but someone demonstrated the technique for  
Lisp, and it was a sufficiently simple mechanism that I wanted a  
reference port of it. I'd like a more general mechanism to allow for  
packaging up DLL's or other data files with it, but this is  
sufficient demonstration for now.

I would suggest that if you try to use this, to build an image  
without autoloader support and all the other extraneous stuff in the  
prelude. Also, there is a problem with embedding the kernel images  
with the VM for some reason, which may be a bug or may be just a  
characteristic of the way we make kernel images; in any case, it's  
not useful so I'm not going to get involved unless there are other  
bug reports.

Anyway, enjoy and let me know if you find something wrong when you  
try it. :)

--
-Brian
http://tunes.org/~water/brice.vcf

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : /archives/slate/attachments/20060202/735b830c/PGP.pgp


More information about the Slate mailing list