trying to build VM for Win32

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

trying to build VM for Win32

Andrew Tween
Hi Bryce and all,
I am trying to build an Exupery VM for Win32.

Question 1. - has anyone successfully done this?

Question 2. - I get this error when compiling -

gnu-interp.c: In function `exuperySetupMessageSend':
gnu-interp.c:4567: `foo' undeclared (first use in this function)

Looking at the corresponding method in Interpreter, I see...

   [(receiverClass < youngStart and: [picPosition ~= 0]) ifTrue:
    [self cCode: '*(int *) (picPosition + 12) = foo->receiverClass'

What is 'foo' ? Does this give any hints to what I am doing wrong?
I am using
    3.8-6665full.image,
    VMMaker-wbk.35, (I installed this first)
    Exupery-wbk.195 (it also fails with .197),
    I got the vm source from http://squeakvm.org/svn/squeak/tags/unix-3.7-7
    and I installed the files from
http://www.kampjes.demon.co.uk/vms/exuperyVMFiles.tz

Cheers,
Andy




_______________________________________________
Exupery mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery
Reply | Threaded
Open this post in threaded view
|

trying to build VM for Win32

Bryce Kampjes
Andrew Tween writes:
 > Hi Bryce and all,
 > I am trying to build an Exupery VM for Win32.
 >
 > Question 1. - has anyone successfully done this?

So far no-one has successfully built Exupery on Win 32.

You'll also need to replace the call to mmap in the .c files
with a call to VirtualAlloc.

That's all the changes that I know you will have to make. There
may be more.

 > Question 2. - I get this error when compiling -
 >
 > gnu-interp.c: In function `exuperySetupMessageSend':
 > gnu-interp.c:4567: `foo' undeclared (first use in this function)
 >
 > Looking at the corresponding method in Interpreter, I see...
 >
 >    [(receiverClass < youngStart and: [picPosition ~= 0]) ifTrue:
 >     [self cCode: '*(int *) (picPosition + 12) = foo->receiverClass'

The short answer was I was careless when I wrote that.

The longer answer is foo is a structure used to hold the interpreters
variables to speed up accessing them. This is an optimisation done by
VMMaker that provides quicker variable access on RISCs but not on x86.
Linux is a Unix so it chooses to compile to suit a RISC.

The simple solution is to just delete the references to foo in my
cCode:. Send me the mcz and I'll try to clean it up so it works on
both platforms.

Sorry
Bryce
_______________________________________________
Exupery mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery
Reply | Threaded
Open this post in threaded view
|

Re: trying to build VM for Win32

Andrew Tween
Hi Bryce,
> So far no-one has successfully built Exupery on Win 32.

Excellent, that means I am not wasting time by attempting it ;)

>
> You'll also need to replace the call to mmap in the .c files
> with a call to VirtualAlloc.
>
> That's all the changes that I know you will have to make. There
> may be more.

ok, thanks.

>
>  > Question 2. - I get this error when compiling -
>  >
>  > gnu-interp.c: In function `exuperySetupMessageSend':
>  > gnu-interp.c:4567: `foo' undeclared (first use in this function)
>  >
>  > Looking at the corresponding method in Interpreter, I see...
>  >
>  >    [(receiverClass < youngStart and: [picPosition ~= 0]) ifTrue:
>  >     [self cCode: '*(int *) (picPosition + 12) = foo->receiverClass'
>
> The short answer was I was careless when I wrote that.
>
> The longer answer is foo is a structure used to hold the interpreters
> variables to speed up accessing them. This is an optimisation done by
> VMMaker that provides quicker variable access on RISCs but not on x86.
> Linux is a Unix so it chooses to compile to suit a RISC.
>
> The simple solution is to just delete the references to foo in my
> cCode:. Send me the mcz and I'll try to clean it up so it works on
> both platforms.

Yep. Knocking out the 'foo->' solves the problem.
(I have already sent a message to the list exupery@ ..  re: this; but it didn't
make it. I think it needs moderator authorisation ?. For now, I will post to
gmane)

Building a Win32 VM from a 3.8 image is problematic. I tried this in the past
when builiding the subpixel/freetype image/plugins, and after many failures,
gave up, and moved to a 3.9 image + VMMaker-tpr.58.mcz + revision 1513 from the
svn sources.  I also built successfully from a 3.7 image. I (optimistically)
hoped that that your VMMaker-wbk.35 package might solve the build problems with
3.8, but unfortunately they are still present.

So, I propose to port the changes from VMMaker-wbk.35 to VMMaker-tpr.58.mcz. And
then to attempt to build the vm using revision 1513, from a 3.9 image. Does that
sound sensible?

Cheers,
Andy



_______________________________________________
Exupery mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery
Reply | Threaded
Open this post in threaded view
|

Re: trying to build VM for Win32

Bryce Kampjes
Andrew Tween writes:

 > Building a Win32 VM from a 3.8 image is problematic. I tried this in the past
 > when builiding the subpixel/freetype image/plugins, and after many failures,
 > gave up, and moved to a 3.9 image + VMMaker-tpr.58.mcz + revision 1513 from the
 > svn sources.  I also built successfully from a 3.7 image. I (optimistically)
 > hoped that that your VMMaker-wbk.35 package might solve the build problems with
 > 3.8, but unfortunately they are still present.

Is the problem the image or the version of VMMaker?

 > So, I propose to port the changes from VMMaker-wbk.35 to VMMaker-tpr.58.mcz. And
 > then to attempt to build the vm using revision 1513, from a 3.9 image. Does that
 > sound sensible?

It's possible, be very careful of merges particularly those involving
commonSend and commonReturn. It used to take me about half a day to
upgrade my VM to the latest versions. That was before VMMaker moved to
Monticello and included assembling a working build environment with
the right C sources.

It's possible. Let me know how you get on. If it looks like the main
show stopper for your Win 32 work then I'll upgrade to 3.9 and the
latest VMMakers after finishing the size primitive. I've been meaning
to do that at some point anyway. The new squeak-dev images look nice.

Bryce
_______________________________________________
Exupery mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery
Reply | Threaded
Open this post in threaded view
|

Re: trying to build VM for Win32

Klaus D. Witzel
On Sun, 17 Sep 2006 22:26:04 +0200, Bryce Kampjes wrote:
> Andrew Tween writes:
>
>  > Building a Win32 VM from a 3.8 image is problematic.
...
> It's possible. Let me know how you get on. If it looks like the main
> show stopper for your Win 32 work then I'll upgrade to 3.9 and the
> latest VMMakers after finishing the size primitive.

The latest VMMaker 3.8b6 and build for win32 are not in harmony, see

http://lists.squeakfoundation.org/pipermail/squeak-dev/2006-September/108553.html

What works is building with VMMaker 3.8b4 for win32 (see same thread) but  
Tim said that 3.8b4 is already a year old.

/Klaus

>
> Bryce


_______________________________________________
Exupery mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery
Reply | Threaded
Open this post in threaded view
|

Re: trying to build VM for Win32

Andrew Tween
In reply to this post by Bryce Kampjes
Hi Bryce,
> Is the problem the image or the version of VMMaker?

Siimple answer: I don't know.
I was tryng to find a combination of vmmaker+svn release+image which produced a
working vm. Once I had found one, I didn't investigate further.

But, I think that the vmmaker+svn release combination is the key.
If the VM builds with both 3.8 and 3.9 images, then nothing is gained, since I
would still build from 3.9. If it fails to build with 3.8, then nothing is lost,
since I can still build with 3.9.
At least, that was my thought process.

>
>  > So, I propose to port the changes from VMMaker-wbk.35 to
VMMaker-tpr.58.mcz. And
>  > then to attempt to build the vm using revision 1513, from a 3.9 image. Does
that
>  > sound sensible?
>
> It's possible, be very careful of merges particularly those involving
> commonSend and commonReturn. It used to take me about half a day to
> upgrade my VM to the latest versions. That was before VMMaker moved to
> Monticello and included assembling a working build environment with
> the right C sources.

ok. I have a linux pc (Fedora core 5), so probably the best approach is to do
the porting / vm building on the linux box, check that the vm still builds, run
the tests, and then move the changes back to Windows. Easier to deal with one
unknown, rather than two.

>
> It's possible. Let me know how you get on. If it looks like the main
> show stopper for your Win 32 work then I'll upgrade to 3.9 and the
> latest VMMakers after finishing the size primitive. I've been meaning
> to do that at some point anyway. The new squeak-dev images look nice.

ok, good. I'll do the porting work on linux, and call on your help when I get
problems. And then move back to the Win32 build.

Cheers,
Andy

>
> Bryce



_______________________________________________
Exupery mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery
Reply | Threaded
Open this post in threaded view
|

Re: trying to build VM for Win32

Bryce Kampjes
Andrew Tween writes:
 > > It's possible. Let me know how you get on. If it looks like the main
 > > show stopper for your Win 32 work then I'll upgrade to 3.9 and the
 > > latest VMMakers after finishing the size primitive. I've been meaning
 > > to do that at some point anyway. The new squeak-dev images look nice.
 >
 > ok, good. I'll do the porting work on linux, and call on your help when I get
 > problems. And then move back to the Win32 build.

If you run into problems, we could organise a day long sprint
somewhere around London. I've got a car so could drive up your
way or we could try to find space that's central.

Bryce
_______________________________________________
Exupery mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery
Reply | Threaded
Open this post in threaded view
|

Re: trying to build VM for Win32

Andrew Tween
Hi Bryce,
Thanks for the offer. I've made some good progress, so maybe a sprint won't be
needed...

I've made further attempts at building with 3.8, and I think I now have a VM
that works.

Running ExuperyStoryTests, gives...
    288 run, 284 passes, 0 expected failures, 0 failures, 4 errors, 0 unexpected
passes
    all errors are due to missing classes

Evaluating - ExuperyBenchmarks new run - gives these numbers...
    arithmaticLoopBenchmark 2459 compiled 270 ratio: 9.107
    bytecodeBenchmark 4317 compiled 1237 ratio: 3.490
    sendBenchmark 3576 compiled 1782 ratio: 2.007
    doLoopsBenchmark 2231 compiled 1711 ratio: 1.304
    largeExplorers 2299 compiled 2358 ratio: 0.975
    compilerBenchmark 1956 compiled 2103 ratio: 0.930
    Cumulative Time 13066.194 compiled 5503.701 ratio 2.374

Is it safe to assume that everything is working o.k.?
Are there any other tests that need running? (I ran ExuperyTests, in the
TestRunner but it didn't do anything)

Cheers,
Andy

"Bryce Kampjes" <[hidden email]> wrote in message
news:[hidden email]...
> Andrew Tween writes:
>  > > It's possible. Let me know how you get on. If it looks like the main
>  > > show stopper for your Win 32 work then I'll upgrade to 3.9 and the
>  > > latest VMMakers after finishing the size primitive. I've been meaning
>  > > to do that at some point anyway. The new squeak-dev images look nice.
>  >
>  > ok, good. I'll do the porting work on linux, and call on your help when I
get
>  > problems. And then move back to the Win32 build.
>
> If you run into problems, we could organise a day long sprint
> somewhere around London. I've got a car so could drive up your
> way or we could try to find space that's central.
>
> Bryce



_______________________________________________
Exupery mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery
Reply | Threaded
Open this post in threaded view
|

Re: trying to build VM for Win32

Bryce Kampjes

That is definately working. Thanks. After a Windows port that
just leaves the Mac people.

Did you need any other changes besides that single reference to foo?

May I have a copy of the VM to add to the FTP site? I'll be out
tomorrow at XtC so the earliest I'll be able to do anything with a VM
is Wednewsday. This is on Win 32, right?

Andrew Tween writes:
 > Hi Bryce,
 > Thanks for the offer. I've made some good progress, so maybe a sprint won't be
 > needed...
 >
 > I've made further attempts at building with 3.8, and I think I now have a VM
 > that works.
 >
 > Running ExuperyStoryTests, gives...
 >     288 run, 284 passes, 0 expected failures, 0 failures, 4 errors, 0 unexpected
 > passes
 >     all errors are due to missing classes
 >
 > Evaluating - ExuperyBenchmarks new run - gives these numbers...
 >     arithmaticLoopBenchmark 2459 compiled 270 ratio: 9.107
 >     bytecodeBenchmark 4317 compiled 1237 ratio: 3.490
 >     sendBenchmark 3576 compiled 1782 ratio: 2.007
 >     doLoopsBenchmark 2231 compiled 1711 ratio: 1.304
 >     largeExplorers 2299 compiled 2358 ratio: 0.975
 >     compilerBenchmark 1956 compiled 2103 ratio: 0.930
 >     Cumulative Time 13066.194 compiled 5503.701 ratio 2.374

It looks like you're running a Pentium-M.

 > Is it safe to assume that everything is working o.k.?
 > Are there any other tests that need running? (I ran ExuperyTests, in the
 > TestRunner but it didn't do anything)

I organise my tests into catagories. But ExuperyStoryTests covers
everything. There is another suite in the class category
Exupery Programmer-Tests.

Bryce
_______________________________________________
Exupery mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery
Reply | Threaded
Open this post in threaded view
|

Re: trying to build VM for Win32

Andrew Tween

"Bryce Kampjes" <[hidden email]> wrote in message
news:[hidden email]...
>
> That is definately working. Thanks. After a Windows port that
> just leaves the Mac people.

Excellent. Maybe RiscOS and SqueakNOS too?

>
> Did you need any other changes besides that single reference to foo?

Yes. I'll send you my modified packages.
In addition to foo removal (which was in more than one place), I made these
changes to VMaker...

    uncommented "self initializeCompilerHooks" in Interpreter class>>initialize.

    replaced references to String with ByteString in MiscPrimitivePlugin
class>>translatedPrimitives

I also had to add the getImageName() function to one of the Win32 specific
files. That was all that was stopping the compilation, but in the past I just
moved to a later VMMaker/image/svn release, rather than chasing the problem.


>
> May I have a copy of the VM to add to the FTP site? I'll be out
> tomorrow at XtC so the earliest I'll be able to do anything with a VM
> is Wednewsday. This is on Win 32, right?

Sure, I'll send you the .exe , and the modified mcz files.
Yes. Windows2000. When I get time I'll test it on Windows 98 too. I don't have
Windows XP, but it would be a good if someone could test it on that.

>
> Andrew Tween writes:
>  > Hi Bryce,
>  > Thanks for the offer. I've made some good progress, so maybe a sprint won't
be
>  > needed...
>  >
>  > I've made further attempts at building with 3.8, and I think I now have a
VM
>  > that works.
>  >
>  > Running ExuperyStoryTests, gives...
>  >     288 run, 284 passes, 0 expected failures, 0 failures, 4 errors, 0
unexpected

>  > passes
>  >     all errors are due to missing classes
>  >
>  > Evaluating - ExuperyBenchmarks new run - gives these numbers...
>  >     arithmaticLoopBenchmark 2459 compiled 270 ratio: 9.107
>  >     bytecodeBenchmark 4317 compiled 1237 ratio: 3.490
>  >     sendBenchmark 3576 compiled 1782 ratio: 2.007
>  >     doLoopsBenchmark 2231 compiled 1711 ratio: 1.304
>  >     largeExplorers 2299 compiled 2358 ratio: 0.975
>  >     compilerBenchmark 1956 compiled 2103 ratio: 0.930
>  >     Cumulative Time 13066.194 compiled 5503.701 ratio 2.374
>
> It looks like you're running a Pentium-M.

I get confused by which code name relates to which chip, but My Computer
reports...
    Intel(R) Pentium(R) III Mobile
    CPU 1133MHz
which I guess is a Pentium-M?

>
>  > Is it safe to assume that everything is working o.k.?
>  > Are there any other tests that need running? (I ran ExuperyTests, in the
>  > TestRunner but it didn't do anything)
>
> I organise my tests into catagories. But ExuperyStoryTests covers
> everything. There is another suite in the class category
> Exupery Programmer-Tests.

It looks like it's a done-deal then.
Give me a little time to check it works on Win 98, and I'll send it to you.
Thanks for your help,
Cheers,
Andy



_______________________________________________
Exupery mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery
Reply | Threaded
Open this post in threaded view
|

Re: trying to build VM for Win32

Andrew Tween
In reply to this post by Bryce Kampjes
> May I have a copy of the VM to add to the FTP site?

I've emailed you the VM + modified packages.
I hope you got it ok?
Cheers,
Andy



_______________________________________________
Exupery mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery
Reply | Threaded
Open this post in threaded view
|

Re: trying to build VM for Win32

Bryce Kampjes
Andrew Tween writes:
 > > May I have a copy of the VM to add to the FTP site?
 >
 > I've emailed you the VM + modified packages.
 > I hope you got it ok?
 > Cheers,
 > Andy

I have, I just need to find a few hours to deal with it...

The delay is my fault.

Bryce
_______________________________________________
Exupery mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery