Just want to add, that in Pharo we refactored things a bit,
so if you want to look for vm parameters, they are accessed via:

Smalltalk vm parameterAt: xyz

not
Smalltalk vmParameterAt:

look in VirtualMachine class for implementation.

On 15 March 2012 17:58, Eliot Miranda <[email protected]> wrote:
>
> Hi Guillermo,
>
> On Wed, Mar 14, 2012 at 12:48 PM, Guillermo Polito 
> <[email protected]> wrote:
>>
>> Hi Eliot,
>>
>> 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?
>
>
> So the image format differences are
> - floats are in platform order, not necessarily in big-endian order
> - the layout of the specialObjectsArray is slightly different (documented in 
> recreateSpecialObjectsArray)
> - there are more words in the header, see StackInterpreter>writeImageFileIO:, 
> i.e.
>
> in Cog:
> self putLong: self imageFormatVersion toFile: f.
> self putLong: headerSize toFile: f.
> self putLong: imageBytes toFile: f.
> self putLong: objectMemory startOfMemory toFile: f.
> self putLong: objectMemory specialObjectsOop toFile: f.
> self putLong: objectMemory newObjectHash toFile: f.
> self putLong: self ioScreenSize toFile: f.
> self putLong: self getImageHeaderFlags toFile: f.
> self putLong: extraVMMemory toFile: f.
> self putShort: desiredNumStackPages toFile: f.
> self putShort: self unknownShortOrCodeSizeInKs toFile: f.
> self putLong: desiredEdenBytes toFile: f.
> self putShort: (maxExtSemTabSizeSet ifTrue: [self ioGetMaxExtSemTableSize] 
> ifFalse: [0]) toFile: f.
> self putShort: 0 toFile: f.
> 1 to: 4 do: [:i | self putLong: 0 toFile: f].  "fill remaining header words 
> with zeros"
>
> in Interpreter:
> self putLong: (self imageFormatVersion) toFile: f.
> self putLong: headerSize toFile: f.
> self putLong: imageBytes toFile: f.
> self putLong: (self startOfMemory) toFile: f.
> self putLong: specialObjectsOop toFile: f.
> self putLong: lastHash toFile: f.
> self putLong: (self ioScreenSize) toFile: f.
> self putLong: fullScreenFlag toFile: f.
> self putLong: extraVMMemory toFile: f.
> 1 to: 7 do: [:i | self putLong: 0 toFile: f].  "fill remaining header words 
> with zeros"
>
> Then
>
> getImageHeaderFlags
> "Answer the flags that are contained in the 7th long of the image header."
> ^fullScreenFlag "0 or 1"
> + (VMBIGENDIAN ifTrue: [0] ifFalse: [2]) "this is the imageFloatsLittleEndian 
> flag"
> + (processHasThreadId ifTrue: [4] ifFalse: [0])
> + (flagInterpretedMethods ifTrue: [8] ifFalse: [0])
> + (preemptionYields ifTrue: [0] ifFalse: [16])
> + (noThreadingOfGUIThread ifTrue: [32] ifFalse: [0])
> + (imageHeaderFlags bitAnd: 63 bitInvert32) "these are any flags we do not 
> recognize"
>
> 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:
>
> getCogVMFlags
> "Answer an array of flags indicating various properties of the Cog VM.
> Bit 0: implies the image's Process class has threadId as its 3rd inst var 
> (zero relative)
> Bit 1: if set, methods that are interpreted will have the flag bit set in 
> their header
> Bit 2: if set, implies preempting a process does not put it to the back of 
> its run queue"
> ^objectMemory integerObjectOf: (processHasThreadId ifTrue: [1] ifFalse: [0])
> + (flagInterpretedMethods ifTrue: [2] ifFalse: [0])
> + (preemptionYields ifTrue: [0] ifFalse: [4])
> + (noThreadingOfGUIThread ifTrue: [8] ifFalse: [0])
>
> Read the comment for vmParameterAt: to get things like num stack pages and 
> cog code size.
>
> Is this OK?  I know it's a bit of a mess. If you or I (we?) write it up where 
> should we put the info?
>>
>>
>> Thanks,
>> Guille
>>
>> On Thu, Jan 27, 2011 at 6:36 PM, Levente Uzonyi <[email protected]> wrote:
>>>
>>> On Thu, 27 Jan 2011, Benjamin wrote:
>>>
>>>> It works for  PharoCore-1.1-11196-UNSTABLE.1 but it seems to be the only 
>>>> version where it works :S
>>>>
>>>> Does someone know why ?
>>>
>>>
>>> It doesn't support Cog'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
>>> http://squeakvm.org/unix/ or build a VM for your favorite platform.
>>>
>>>
>>> Levente
>>>
>>>
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> Ben
>>>>
>>>> On Jan 27, 2011, at 3:36 PM, Benjamin wrote:
>>>>
>>>>> Hello guys,
>>>>>
>>>>> for one of my projects, I'm trying to use SystemTracer to create  anew 
>>>>> image, but it appears that it doesn't work on Pharo ...
>>>>> I can create a new image, but I can't open it. I've tried with an older 
>>>>> VM (Squeak 3.8.18beta1U), but it's the same ...
>>>>>
>>>>>
>>>>> Did someone already have this problem ? Does someone have a solution ?
>>>>>
>>>>>
>>>>>
>>>>> Thanks in advance,
>>>>>
>>>>> Ben
>>>>
>>>>
>>>>
>>>
>>
>
>
>
> --
> best,
> Eliot
>
>



-- 
Best regards,
Igor Stasenko.

Reply via email to