jueves, 6 de mayo de 2010

Building new releases of SqueakNOS

We roll new versions of SqueakNOS periodically by using a really simple automated process, and this article explains how it works. So, after reading this, you'll know how to rebuild SqueakNOS Object Engine, create a new bootable hard disk or ISO image, and roll your own version. This process should be as easy and fast as possible.

Quickly rebuilding and trying

We work on Linux, so it will be a lot easier to do everything from Linux. However, the same should work on other Unixes, and quite probably in Windows too, after finding the right versions of the tools.

The distribution package of SqueakNOS has changed a bit since May 2010. If you look at packages from before that date, directories may be a bit different. Now we include three things in the package: the compiled bootable system in a hard disk or ISO images, a .vmx configuration file to boot the image from vmware and lastly the native source code of the Object Engine.

To build everything you have to unpack the source files into your filesystem, which lie in "platforms" directory. This contains a subset of the subversion tree of the standard Squeak build tree (the cross platform part), and an added SqueakNOS target platform. Everything is done from within platforms/squeaknos, where the main Makefile is located.

$ tar -xzf SqueakNOS.tar.gz .
$ cd platforms/squeaknos

Then copy, from the hard disk or ISO image the two files SqueakNOS.image and SqueakNOS.changes:

$ # To mount the ISO image
$ mount -o loop SqueakNOS.iso /nos

$ # Or to mount the hard disk image
$ vmware-mount SqueakNOS.vmdk /nos

$ cp /nos/SqueakNOS.image .
$ cp /nos/SqueakNOS.changes .

Now you are ready to roll your own SqueakNOS.iso:

$ # To simply build the kernel, obviously:
$ make

$ # To build release/SqueakNOS.iso and release/SqueakNOS.vmx:
$ make iso

$ # To build and try it with vmplayer:
$ make try

$ # To try with qemu
$ make iso && qemu -std-vga -cdrom release/SqueakNOS.iso

$ # To build a new distro (release/SqueakNOS-`date`.zip and tar.bz2):
$ make distro    # The date in the filename is automatic

Of course, you can always open the .image in a standard squeak, modify it, save it, and try it. The .image and .changes are copied to release/iso during the building of the .iso image, so you can continue working inside squeak while building and trying. This is great to make changes while you are debugging in a live SqueakNOS. It's currently also possible to have access to .changes and .sources from within SqueakNOS itself using while using the hard disk image or using a RemoteObjectChannel over a virtual serial line with the HD/ISO images, if you are interested in doing this, take a look at this article.