Pre-Spur -> Spur transition

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

Pre-Spur -> Spur transition

KenDickey
 
Greetings,

I though to take a look at transitioning a Cuis image into Spur format.

I presume there is a Smalltalk package which either runs in an old VM and writes the active image into the Spur format or code for a Spur image which reads the old format.

[1] Where would I locate this code?

[2] Is there a Non-Cog Spur VM available?  [Chromebook currently does page protect to disallow JIT]

Thanks much,
-KenD
-KenD
Reply | Threaded
Open this post in threaded view
|

Re: Pre-Spur -> Spur transition

Eliot Miranda-2
 
Hi Ken,



_,,,^..^,,,_ (phone)
On Nov 22, 2015, at 6:43 PM, KenD <[hidden email]> wrote:

Greetings,

welcome!


I though to take a look at transitioning a Cuis image into Spur format.

Great!

I presume there is a Smalltalk package which either runs in an old VM and writes the active image into the Spur format or code for a Spur image which reads the old format.

Yes, the Sour bootstrap is in the Cog package which is where I put support code for the VMMaker.oscog package, which is where the Cog VM lives.

[1] Where would I locate this code?

There are scripts to build a Cog VMMaker image and to run the Squeak 4.5 to Spur conversions in http://www.squeakvm.org/svn/squeak/branches/Cog/image.  See http://www.mirandabanda.org/cogblog/build-image/

You'll want to redefine the GetGoodVM.sh or GetGoodSpurVM.sh scripts to run the relevant VM (if I recall the names correctly).

[2] Is there a Non-Cog Spur VM available?  [Chromebook currently does page protect to disallow JIT]

Yes.  In http://www.squeakvm.org/svn/squeak/branches/Cog/spurstacksrc is a non-Cog Spur VM and there are pre-configured builds for it in eg http://www.squeakvm.org/svn/squeak/branches/Cog/build.linux32x86/squeak.stack.spur


Note that VMMaker.oscog /should/ load and run in non-Spur squeak but I've not tried this for over a year now.


Thanks much,
-KenD

Perhaps some time we can discuss what's necessary to get Cog VMs running on Chromebooks.  Is it a matter of doing the entry into machine code appropriately or is there a deal breaker or...?

_,,,^..^,,,_ (phone)
Reply | Threaded
Open this post in threaded view
|

Re: Pre-Spur -> Spur transition

KenDickey
 
On Mon, 23 Nov 2015 04:01:29 -0800
Eliot Miranda <[hidden email]> wrote:

> Perhaps some time we can discuss what's necessary to get Cog VMs running on Chromebooks.  Is it a matter of doing the entry into machine code appropriately or is there a deal breaker or...?

I was fortunate to got a chunk of time with Tim at the recent Nanaimo Camp Smalltalk to look at this.


The short answer is that we are blocked and no easy workaround is apparent.


The gist is that Chrome OS uses compsec to trap kernel calls, randomizes code placement, uses guard pages, and does 'NX' protection of writable pages.  Chrome OS is serious about security (JIT Spraying et al).

I had thought that Google's V8 JavaScript VM was JIT'ing here but the public source indicates that they disallow JIT on Chromebooks.

There is evidence in internal discussions of a test/prototype "safe JIT" V8 and some people seem to be working on rubrics/rules under which JIT would be allowed.  Basically what is required is the ability to run a checker over the JIT which can automatically check references to preclude code attacks.  Doing this cheaply enough computationally to keep the performance gains of JIT is a real challenge.

I am able to run small JIT samples and a "stackless JIT" (sljit) on a Chromebook, but have not had the time to discover the specific breakage-line/trip-point causing the Segfault.

My current take is that I need to get a RasPi to use Cog or build a custom Chrome OS kernel.   Not a general solution.  8^(

I think it best to wait until a public code solution appears for V8.  Other than that it is experimenting with threaded code and related.  Not worth your time right now.

Thanks for your interest, and thanks especially for your great work on the VM!!
-KenD
================================ Of Note:

"Exploiting and Protecting Dynamic Code Generation"

https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwjguP_RxJ3JAhXQT4gKHS2VAUYQFggeMAA&url=http%3A%2F%2Fwenke.gtisc.gatech.edu%2Fpapers%2Fsdcg.pdf&usg=AFQjCNF52_QFDuMcP05WvfeHNi2wUK-yHg&sig2=8SzTcWKA7VBubmzdzJmIiA


Google's "Safe Self-Modifying Code" patent: (Patent! Ack!! 8^{)

https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=4&cad=rja&uact=8&ved=0ahUKEwilmsKlxZ3JAhVRKYgKHfXgDOMQFgg5MAM&url=http%3A%2F%2Fwww.google.com%2Fpatents%2FUS8850574&usg=AFQjCNHTAbYqbvqy80Edcww1YDsgUvoKMQ&sig2=FK01uFZEn778RNmRm7iz4A

================================
-KenD
Reply | Threaded
Open this post in threaded view
|

Re: Pre-Spur -> Spur transition

EstebanLM
In reply to this post by Eliot Miranda-2
 

On 23 Nov 2015, at 09:01, Eliot Miranda <[hidden email]> wrote:

Hi Ken,



_,,,^..^,,,_ (phone)
On Nov 22, 2015, at 6:43 PM, KenD <[hidden email]> wrote:

Greetings,

welcome!


I though to take a look at transitioning a Cuis image into Spur format.

Great!

I presume there is a Smalltalk package which either runs in an old VM and writes the active image into the Spur format or code for a Spur image which reads the old format.

Yes, the Sour bootstrap is in the Cog package which is where I put support code for the VMMaker.oscog package, which is where the Cog VM lives.

[1] Where would I locate this code?

There are scripts to build a Cog VMMaker image and to run the Squeak 4.5 to Spur conversions in http://www.squeakvm.org/svn/squeak/branches/Cog/image.  See http://www.mirandabanda.org/cogblog/build-image/

You'll want to redefine the GetGoodVM.sh or GetGoodSpurVM.sh scripts to run the relevant VM (if I recall the names correctly).

[2] Is there a Non-Cog Spur VM available?  [Chromebook currently does page protect to disallow JIT]

Yes.  In http://www.squeakvm.org/svn/squeak/branches/Cog/spurstacksrc is a non-Cog Spur VM and there are pre-configured builds for it in eg http://www.squeakvm.org/svn/squeak/branches/Cog/build.linux32x86/squeak.stack.spur


Note that VMMaker.oscog /should/ load and run in non-Spur squeak but I've not tried this for over a year now.

I needed to do some minor changes (very minor) for doing it in Pharo… I’m quite sure you will need them also for Squeak, but I do not think is necessary if what you want is to bootstrap a cuis-spur… you can always do it from a squeak-spur.

Esteban



Thanks much,
-KenD

Perhaps some time we can discuss what's necessary to get Cog VMs running on Chromebooks.  Is it a matter of doing the entry into machine code appropriately or is there a deal breaker or...?

_,,,^..^,,,_ (phone)

Reply | Threaded
Open this post in threaded view
|

Re: Pre-Spur -> Spur transition

KenDickey
In reply to this post by Eliot Miranda-2
 
Eliot,

I have gotten a bit lost, but getting closer.

I am now able to run Squeak 5.0 on my ARM Chromebook via:

  stkspurlinuxhtARM-15.24.3386.tgz

In Cog/image I loaded a Squeak5.0.image with
  BuildSqueakSpurTrunkVMMakerImage.st
  LoadReader.st
  StartReader.st

I then save & restart the image with the equivalent of
  squeak reader.image <Cuis4.2.image >Cuis5.0.image

But get a zero length Cuis5.0.image result.

As the reader.image quits immediately, I did not get to see what the code should be doing.

A usage hint would be helpful here.

Thanks much,
-KenD



--
-KenD
-KenD
Reply | Threaded
Open this post in threaded view
|

Re: Pre-Spur -> Spur transition

Eliot Miranda-2
 
Hi Ken,

On Mon, Nov 23, 2015 at 9:16 PM, KenD <[hidden email]> wrote:

Eliot,

I have gotten a bit lost, but getting closer.

I am now able to run Squeak 5.0 on my ARM Chromebook via:

  stkspurlinuxhtARM-15.24.3386.tgz

In Cog/image I loaded a Squeak5.0.image with
  BuildSqueakSpurTrunkVMMakerImage.st
  LoadReader.st
  StartReader.st

Oops, the image building scripts are in image/old.  I forgot that now that Squeak 5.0 is released I'd cleaned up the scripts and left only ones to create 64-bit images.  Forgive me.  So....

0. cd to the image directory
1. build a VMMaker.oscog image via
$ buildsqueaktrunkvmmakerimage.sh

2. get that image to convert a Cuis image by adapting old/BuildSpurTrunkImage.st
| pwd |
Utilities authorInitialsPerSe isEmpty ifTrue:
        [Utilities setAuthorInitials: 'autoboot'].
pwd := FileDirectory default fullName.
SpurBootstrap bootstrapSqueakImage: pwd, '/', 'trunk46forspur'.
SpurBootstrapMonticelloPackagePatcher new
        from: 'temp-v3-repository' to: 'temp-spur-repository';
        patch.
Smalltalk snapshot: false andQuit: true

I suggest you start-up that image and explore the bootstrap.  There are two parts:

        SpurBootstrap bootstrapSqueakImage: pwd, '/', 'cuis'

will try to produce a cuis-spur.image and cuis-spur.changes from cuis.image & cuis.changes.  But the modified methods won't contain source; they'll be decompiled.

SpurBootstrapMonticelloPackagePatcher new
        from: 'temp-v3-repository' to: 'temp-spur-repository';
        patch.

will try and patch the Collections, Compiler, Kernel & System packages in the first repository into new versions with the modified source in the second repository.  One can then load these packages in the cuis-spur.image to get the correct source.

Over time I modified the bootstrap so that there was an automated patching process.  We can set something up for Cuis later on.  First concentrate on getting bootstrapSqueakImage: to produce an image that starts up.  Then concentrate on SpurBootstrapMonticelloPackagePatcher to get patched packages that can be loaded into cuis-spur.image, and then you can think about the release process and making the transition.

And if you have an urgent question I'm on Skype at eliotmiranda.


 

I then save & restart the image with the equivalent of
  squeak reader.image <Cuis4.2.image >Cuis5.0.image

But get a zero length Cuis5.0.image result.

As the reader.image quits immediately, I did not get to see what the code should be doing.

A usage hint would be helpful here.

Thanks much,
-KenD



--
-KenD


_,,,^..^,,,_
best, Eliot
Reply | Threaded
Open this post in threaded view
|

Re: Pre-Spur -> Spur transition

Phil B
 
Hi Eliot,

On Tue, 2015-11-24 at 10:50 -0800, Eliot Miranda wrote:

> Oops, the image building scripts are in image/old.  I forgot that now
> that Squeak 5.0 is released I'd cleaned up the scripts and left only
> ones to create 64-bit images.  Forgive me.  So....
>
> 0. cd to the image directory
> 1. build a VMMaker.oscog image via
> $ buildsqueaktrunkvmmakerimage.sh
>

I'm going through the process you documented to migrate a Cuis image
and finding some minor breakage along the way (needing to symlink a
couple of scripts between the image and image/old directories and
getting a 'Bits size mismatch' error running the above build script...
entirely possible there will be more to do as I get further) and was
wondering if anyone has archived known working images related to the
Cog and now the Spur migrations?  These seem like worthwhile artifacts
to keep around should anyone in the distant future need to migrate
images as the breakage will likely increase the further we get from the
initial migration event...

Thanks,
Phil