Hi Guillermo,<br><br><div class="gmail_quote">On Wed, Mar 14, 2012 at 12:48 PM, Guillermo Polito <span dir="ltr">&lt;<a href="mailto:guillermopolito@gmail.com">guillermopolito@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Eliot,<br><br>do you have a pointer of where can I see the differences between the old Squeak format and the cog image format, so I can make SystemTracer work on Cog vms?<br></blockquote><div><br></div><div>So the image format differences are</div>
<div>- floats are in platform order, not necessarily in big-endian order</div><div>- the layout of the specialObjectsArray is slightly different (documented in recreateSpecialObjectsArray)</div><div>- there are more words in the header, see StackInterpreter&gt;writeImageFileIO:, i.e.</div>
<div><br></div><div>in Cog:</div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>self putLong: self imageFormatVersion toFile: f.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>self putLong: headerSize toFile: f.</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>self putLong: imageBytes toFile: f.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>self putLong: objectMemory startOfMemory toFile: f.</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>self putLong: objectMemory specialObjectsOop toFile: f.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>self putLong: objectMemory newObjectHash toFile: f.</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>self putLong: self ioScreenSize toFile: f.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>self putLong: self getImageHeaderFlags toFile: f.</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>self putLong: extraVMMemory toFile: f.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>self putShort: desiredNumStackPages toFile: f.</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>self putShort: self unknownShortOrCodeSizeInKs toFile: f.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>self putLong: desiredEdenBytes toFile: f.</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>self putShort: (maxExtSemTabSizeSet ifTrue: [self ioGetMaxExtSemTableSize] ifFalse: [0]) toFile: f.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>self putShort: 0 toFile: f.</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>1 to: 4 do: [:i | self putLong: 0 toFile: f].  &quot;fill remaining header words with zeros&quot;</div></div><div><br></div><div>in Interpreter:</div><div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>self putLong: (self imageFormatVersion) toFile: f.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>self putLong: headerSize toFile: f.</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>self putLong: imageBytes toFile: f.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>self putLong: (self startOfMemory) toFile: f.</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>self putLong: specialObjectsOop toFile: f.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>self putLong: lastHash toFile: f.</div><div>
<span class="Apple-tab-span" style="white-space:pre">        </span>self putLong: (self ioScreenSize) toFile: f.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>self putLong: fullScreenFlag toFile: f.</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>self putLong: extraVMMemory toFile: f.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>1 to: 7 do: [:i | self putLong: 0 toFile: f].  &quot;fill remaining header words with zeros&quot;</div>
</div><div><br></div><div>Then </div><div><br></div><div><div>getImageHeaderFlags</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&quot;Answer the flags that are contained in the 7th long of the image header.&quot;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>^fullScreenFlag &quot;0 or 1&quot;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>+ (VMBIGENDIAN ifTrue: [0] ifFalse: [2]) &quot;this is the imageFloatsLittleEndian flag&quot;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>+ (processHasThreadId ifTrue: [4] ifFalse: [0])</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>+ (flagInterpretedMethods ifTrue: [8] ifFalse: [0])</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>+ (preemptionYields ifTrue: [0] ifFalse: [16])</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>+ (noThreadingOfGUIThread ifTrue: [32] ifFalse: [0])</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>+ (imageHeaderFlags bitAnd: 63 bitInvert32) &quot;these are any flags we do not recognize&quot;</div></div><div><br></div><div>Now most of the information in the flags is accessible from vmParameterAt: (or some convenience methods).  e.g. vm parameter 49 is the max external semaphore table size, and vm parameter 48 is the following flags:</div>
<div><br></div><div><div>getCogVMFlags</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&quot;Answer an array of flags indicating various properties of the Cog VM.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> Bit 0: implies the image&#39;s Process class has threadId as its 3rd inst var (zero relative)</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span> Bit 1: if set, methods that are interpreted will have the flag bit set in their header</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> Bit 2: if set, implies preempting a process does not put it to the back of its run queue&quot;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>^objectMemory integerObjectOf: (processHasThreadId ifTrue: [1] ifFalse: [0])</div><div><span class="Apple-tab-span" style="white-space:pre">                                                </span>+ (flagInterpretedMethods ifTrue: [2] ifFalse: [0])</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                                </span>+ (preemptionYields ifTrue: [0] ifFalse: [4])</div><div><span class="Apple-tab-span" style="white-space:pre">                                                </span>+ (noThreadingOfGUIThread ifTrue: [8] ifFalse: [0])</div>
</div><div><br></div><div>Read the comment for vmParameterAt: to get things like num stack pages and cog code size.</div><div><br></div><div>Is this OK?  I know it&#39;s a bit of a mess. If you or I (we?) write it up where should we put the info?</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>Thanks,<br>Guille<br><br><div class="gmail_quote">
On Thu, Jan 27, 2011 at 6:36 PM, Levente Uzonyi <span dir="ltr">&lt;<a href="mailto:leves@elte.hu" target="_blank">leves@elte.hu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div>On Thu, 27 Jan 2011, Benjamin wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It works for  PharoCore-1.1-11196-UNSTABLE.1 but it seems to be the only version where it works :S<br>
<br>
Does someone know why ?<br>
</blockquote>
<br></div>
It doesn&#39;t support Cog&#39;s image format. Try an image with the original Squeak format. You can convert your image with the latest SqueakVM. Only the unix VM was released with this feature yet, so you can use that<br>


<a href="http://squeakvm.org/unix/" target="_blank">http://squeakvm.org/unix/</a> or build a VM for your favorite platform.<span><font color="#888888"><br>
<br>
<br>
Levente</font></span><div><div><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Thanks,<br>
<br>
Ben<br>
<br>
On Jan 27, 2011, at 3:36 PM, Benjamin wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello guys,<br>
<br>
for one of my projects, I&#39;m trying to use SystemTracer to create  anew image, but it appears that it doesn&#39;t work on Pharo ...<br>
I can create a new image, but I can&#39;t open it. I&#39;ve tried with an older VM (Squeak 3.8.18beta1U), but it&#39;s the same ...<br>
<br>
<br>
Did someone already have this problem ? Does someone have a solution ?<br>
<br>
<br>
<br>
Thanks in advance,<br>
<br>
Ben<br>
</blockquote>
<br>
<br>
</blockquote>
<br>
</div></div></blockquote></div><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div><br>