VM Maker: ImageFormat-dtl.7.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

VM Maker: ImageFormat-dtl.7.mcz

squeak-dev-noreply
 
Dave Lewis uploaded a new version of ImageFormat to project VM Maker:
http://www.squeaksource.com/VMMaker/ImageFormat-dtl.7.mcz

==================== Summary ====================

Name: ImageFormat-dtl.7
Author: dtl
Time: 31 December 2010, 6:40:20 am
UUID: a8499caf-2b80-4c5c-82e7-e2b10455f42a
Ancestors: ImageFormat-dtl.6

Generate ckformat.c, a utility program for reading the image file format number from an image file. The ckformat program is intended for testing image file format from a unix shell script such that the shell script can select a VM based on image requirements. A non-zero return status code from ckformat indicates failure, otherwise the format number is written to standard output with no line terminator. The utility handles big-endian and little-endian versions of all known 32 and 64 bit image formats.

The ckformat C code is generated from ImageFormat to ensure that it is updated as new format numbers are assigned and documented in class ImageFormat.

Reply | Threaded
Open this post in threaded view
|

Determining which VM to run from a shell script (was: VM Maker: ImageFormat-dtl.7.mcz)

David T. Lewis
 
Attached are a shell script to illustrated use of ckformat as well as
a copy of the C source generated from ImageFormat.

Happy New Year!

Dave

On Sat, Jan 01, 2011 at 12:40:21AM +0000, [hidden email] wrote:

> Dave Lewis uploaded a new version of ImageFormat to project VM Maker:
> http://www.squeaksource.com/VMMaker/ImageFormat-dtl.7.mcz
>
> ==================== Summary ====================
>
> Name: ImageFormat-dtl.7
> Author: dtl
> Time: 31 December 2010, 6:40:20 am
> UUID: a8499caf-2b80-4c5c-82e7-e2b10455f42a
> Ancestors: ImageFormat-dtl.6
>
> Generate ckformat.c, a utility program for reading the image file format number from an image file. The ckformat program is intended for testing image file format from a unix shell script such that the shell script can select a VM based on image requirements. A non-zero return status code from ckformat indicates failure, otherwise the format number is written to standard output with no line terminator. The utility handles big-endian and little-endian versions of all known 32 and 64 bit image formats.
>
> The ckformat C code is generated from ImageFormat to ensure that it is updated as new format numbers are assigned and documented in class ImageFormat.

ckformat.sh (1K) Download Attachment
ckformat.c (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Determining which VM to run from a shell script (was: VM Maker: ImageFormat-dtl.7.mcz)

David T. Lewis
 
Attached is a shell script "vmrun" that I am now using on my
Linux box. It runs Cog where possible, and either the 32 or 64
bit standard interpreter for other images. This is something of
a hack to be sure, but it seems to work.

Bert, I think this is more or less what you were suggesting earlier
for automating the VM selection.

BTW, another reasonable way to attack this problem is to use the
VM itself. A standard interpreter already knows how to parse all
the command arguments, find the image file, read the image, and
determine the image format. A 32 bit VM can read all of the image
formats including Cog. All that is needed is to export an additional
function from the interpreter and wire it into a command line option
in the Unix support code. In this scenario, the VM itself serves
as the "ckformat" utility, and the vmrun script would not need to
parse arguments or search for the image file. If anyone thinks this
approach would be better I can post the changes (I tried it on my
system and it worked fine).

Dave


On Fri, Dec 31, 2010 at 06:44:34PM -0500, David T. Lewis wrote:

>  
> Attached are a shell script to illustrated use of ckformat as well as
> a copy of the C source generated from ImageFormat.
>
> Happy New Year!
>
> Dave
>
> On Sat, Jan 01, 2011 at 12:40:21AM +0000, [hidden email] wrote:
> > Dave Lewis uploaded a new version of ImageFormat to project VM Maker:
> > http://www.squeaksource.com/VMMaker/ImageFormat-dtl.7.mcz
> >
> > ==================== Summary ====================
> >
> > Name: ImageFormat-dtl.7
> > Author: dtl
> > Time: 31 December 2010, 6:40:20 am
> > UUID: a8499caf-2b80-4c5c-82e7-e2b10455f42a
> > Ancestors: ImageFormat-dtl.6
> >
> > Generate ckformat.c, a utility program for reading the image file format number from an image file. The ckformat program is intended for testing image file format from a unix shell script such that the shell script can select a VM based on image requirements. A non-zero return status code from ckformat indicates failure, otherwise the format number is written to standard output with no line terminator. The utility handles big-endian and little-endian versions of all known 32 and 64 bit image formats.
> >
> > The ckformat C code is generated from ImageFormat to ensure that it is updated as new format numbers are assigned and documented in class ImageFormat.



vmrun (1K) Download Attachment
vmrun.zip (1K) Download Attachment