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. |
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. |
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. |
Free forum by Nabble | Edit this page |