How to use Croquet VMMaker

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

How to use Croquet VMMaker

Tapple Gao
 
Hi. In anticipation of working on HydraVM, I am trying to test
as close a configuration as possible to HydraVM without being
hydra. That is, load the nearest ancestor VMMaker and C sources
to hydra, and try to make a working VM. This should help ensure
that there are no "normal" bugs once I switch to Hydra, only
hydra bugs. So, I did that: Here is my setup:

- Fedora core 7 on x86 processor
- Release 3.9 image/VM from squeak.org
  - Load FFI from SqueakMap
  - Load VMMaker-ar.70 from
    http://jabberwocky.croquetproject.org:8889/Homebase/
- Checkout http://squeakvm.org/svn/squeak/trunk revision 1796
  (The nearest ancestor of HydraVM)

I pointed VMMaker at the platforms directory in the checkout,
and told it to build source in platforms/unix/src. I selected
all plugins to be external, but moved FilePlugin and
SocketPlugin to be internal. Then I did

mkdir unixbuild
cd unixbuild
../platforms/unix/config/configure
make

make fails linking gnu-interp.o:

/bin/sh /home/matthewf/squeak/vm/hydravm-trunk-base/unixbuild/libtool --mode=link gcc -g -O2 -fomit-frame-pointer -DLSB_FIRST=1    -export-dynamic -R/usr/local/lib -o squeak vm/vm.a FilePlugin/FilePlugin.a SocketPlugin/SocketPlugin.a disabledPlugins.o version.o -lutil -ldl -lm -lnsl   vm/vm.a
gcc -g -O2 -fomit-frame-pointer -DLSB_FIRST=1 -o squeak disabledPlugins.o version.o -Wl,--export-dynamic  vm/vm.a FilePlugin/FilePlugin.a SocketPlugin/SocketPlugin.a -lutil -ldl -lm -lnsl vm/vm.a -Wl,--rpath -Wl,/usr/local/lib
vm/vm.a(gnu-interp.o): In function `primitiveGetWindowLabel':
/home/matthewf/squeak/vm/hydravm-trunk-base/unixbuild/vm/gnu-interp.c:15141: undefined reference to `ioGetWindowLabel'
vm/vm.a(gnu-interp.o): In function `primitiveSetWindowLabel':
/home/matthewf/squeak/vm/hydravm-trunk-base/unixbuild/vm/gnu-interp.c:18770: undefined reference to `ioSetWindowLabelOfSize'
collect2: ld returned 1 exit status

Building this VM worked when using the latest VMMaker from
SqueakMap (VMMaker-tpr.58), everything else the same. Is there
something else I need to do in order to build using the Croquet
VMMaker? I want to use it specifically, since the Hydra VMMaker
is derived from it.

The dev notes on Hydra are at
http://squeakvm.org/~sig/hydravm/devnotes.html

--
Matthew Fulmer -- http://mtfulmer.wordpress.com/
Help improve Squeak Documentation: http://wiki.squeak.org/squeak/808
Reply | Threaded
Open this post in threaded view
|

Re: How to use Croquet VMMaker

Andreas.Raab
 
ioGetWindowLabel/ioSetWindowLabel

Matthew Fulmer wrote:
> /bin/sh /home/matthewf/squeak/vm/hydravm-trunk-base/unixbuild/libtool --mode=link gcc -g -O2 -fomit-frame-pointer -DLSB_FIRST=1    -export-dynamic -R/usr/local/lib -o squeak vm/vm.a FilePlugin/FilePlugin.a SocketPlugin/SocketPlugin.a disabledPlugins.o version.o -lutil -ldl -lm -lnsl   vm/vm.a
> gcc -g -O2 -fomit-frame-pointer -DLSB_FIRST=1 -o squeak disabledPlugins.o version.o -Wl,--export-dynamic  vm/vm.a FilePlugin/FilePlugin.a SocketPlugin/SocketPlugin.a -lutil -ldl -lm -lnsl vm/vm.a -Wl,--rpath -Wl,/usr/local/lib
> vm/vm.a(gnu-interp.o): In function `primitiveGetWindowLabel':
> /home/matthewf/squeak/vm/hydravm-trunk-base/unixbuild/vm/gnu-interp.c:15141: undefined reference to `ioGetWindowLabel'
> vm/vm.a(gnu-interp.o): In function `primitiveSetWindowLabel':
> /home/matthewf/squeak/vm/hydravm-trunk-base/unixbuild/vm/gnu-interp.c:18770: undefined reference to `ioSetWindowLabelOfSize'
> collect2: ld returned 1 exit status

These are support functions that are currently not implemented in the
Unix/Mac VMs (we use them to get/set the main window title directly).
Here is how to stub them (best done in sqUnixMain.c):

char* ioGetWindowLabel(void) {return "";}
sqInt ioSetWindowLabelOfSize(void* lbl, sqInt size) {return 0;}

This should do the trick.

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

ioGetWindowLabel/ioSetWindowLabel (was Re: How to use Croquet VMMaker)

Bert Freudenberg
 
On Feb 5, 2008, at 8:15 , Andreas Raab wrote:

> ioGetWindowLabel/ioSetWindowLabel
>
> These are support functions that are currently not implemented in  
> the Unix/Mac VMs (we use them to get/set the main window title  
> directly). Here is how to stub them (best done in sqUnixMain.c):
>
> char* ioGetWindowLabel(void) {return "";}
> sqInt ioSetWindowLabelOfSize(void* lbl, sqInt size) {return 0;}
>
> This should do the trick.

Actually, I need to implement these for X11 anyway. Expect this to  
soon be supported in the OLPC branch. Unless someone beats me to it  
of course :)

- Bert -

Reply | Threaded
Open this post in threaded view
|

Re: How to use Croquet VMMaker

Tapple Gao
In reply to this post by Andreas.Raab
 
On Mon, Feb 04, 2008 at 11:15:03PM -0800, Andreas Raab wrote:

> ioGetWindowLabel/ioSetWindowLabel
>
> These are support functions that are currently not implemented in the
> Unix/Mac VMs (we use them to get/set the main window title directly). Here
> is how to stub them (best done in sqUnixMain.c):
>
> char* ioGetWindowLabel(void) {return "";}
> sqInt ioSetWindowLabelOfSize(void* lbl, sqInt size) {return 0;}
>
> This should do the trick.

Indeed it does. It made the VM compile successfully, although I
havn't tested it yet. Thank you.

--
Matthew Fulmer -- http://mtfulmer.wordpress.com/
Help improve Squeak Documentation: http://wiki.squeak.org/squeak/808
Reply | Threaded
Open this post in threaded view
|

Re: ioGetWindowLabel/ioSetWindowLabel (was Re: How to use Croquet VMMaker)

Bert Freudenberg
In reply to this post by Bert Freudenberg
 
Am 05.02.2008 um 02:11 schrieb Bert Freudenberg:

> On Feb 5, 2008, at 8:15 , Andreas Raab wrote:
>
>> ioGetWindowLabel/ioSetWindowLabel
>>
>> These are support functions that are currently not implemented in  
>> the Unix/Mac VMs (we use them to get/set the main window title  
>> directly). Here is how to stub them (best done in sqUnixMain.c):
>>
>> char* ioGetWindowLabel(void) {return "";}
>> sqInt ioSetWindowLabelOfSize(void* lbl, sqInt size) {return 0;}
>>
>> This should do the trick.
>
> Actually, I need to implement these for X11 anyway. Expect this to  
> soon be supported in the OLPC branch. Unless someone beats me to it  
> of course :)


Hmm, where could I find the code calling this? I'd need both the slang  
and image-side code.

- Bert -


Reply | Threaded
Open this post in threaded view
|

X11 HostWindowPlugin (was: Re: ioGetWindowLabel/ioSetWindowLabel (was Re: How to use Croquet VMMaker)

David T. Lewis
 
Bert,

Here is a snapshot of a partially implemented HostWindowPlugin
for X11. I have not looked at this in quite a while, but when
I last worked on it a number of things were functional (including
ioSetTitleOfWindow(), for whatever that may be worth).

Some of the support code is crudely hacked out of Ian's original
work, and I would anticipate some effort to make this right. In
particular, it was not clear to me how the X event dispatching
should ultimately work, and whether the host windows should behave
analogously to Squeak projects or if they were intended to be
more like passive display surfaces.

I could probably be motivated to pick this up again and/or to
help you with it, but in any case feel free to use this in any
way you like. MIT license of course, and the plagiarized parts
should be MIT because I stole them all from Ian ;)

Dave

On Fri, Jul 18, 2008 at 06:53:29PM -0700, Bert Freudenberg wrote:

>
> Am 05.02.2008 um 02:11 schrieb Bert Freudenberg:
>
> >On Feb 5, 2008, at 8:15 , Andreas Raab wrote:
> >
> >>ioGetWindowLabel/ioSetWindowLabel
> >>
> >>These are support functions that are currently not implemented in  
> >>the Unix/Mac VMs (we use them to get/set the main window title  
> >>directly). Here is how to stub them (best done in sqUnixMain.c):
> >>
> >>char* ioGetWindowLabel(void) {return "";}
> >>sqInt ioSetWindowLabelOfSize(void* lbl, sqInt size) {return 0;}
> >>
> >>This should do the trick.
> >
> >Actually, I need to implement these for X11 anyway. Expect this to  
> >soon be supported in the OLPC branch. Unless someone beats me to it  
> >of course :)
>
>
> Hmm, where could I find the code calling this? I'd need both the slang  
> and image-side code.
>
> - Bert -
>

X11HostWindowPlugin-dtl.1.cs.gz (1K) Download Attachment
X11HostWindow.tgz (94K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: X11 HostWindowPlugin (was: Re: ioGetWindowLabel/ioSetWindowLabel (was Re: How to use Croquet VMMaker)

timrowledge
 

On 19-Jul-08, at 7:28 AM, David T. Lewis wrote:
>  MIT license of course, and the plagiarized parts
> should be MIT because I stole them all from Ian ;)
Ah, so it's 'My Ideas Taken'. I always wondered about that :-)


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Strange OpCodes: CSD: Charge Surreptitiously to DOE


Reply | Threaded
Open this post in threaded view
|

Re: X11 HostWindowPlugin (was: Re: ioGetWindowLabel/ioSetWindowLabel (was Re: How to use Croquet VMMaker)

David T. Lewis
 
On Sat, Jul 19, 2008 at 08:33:17AM -0700, tim Rowledge wrote:
>
> On 19-Jul-08, at 7:28 AM, David T. Lewis wrote:
> > MIT license of course, and the plagiarized parts
> >should be MIT because I stole them all from Ian ;)
> Ah, so it's 'My Ideas Taken'. I always wondered about that :-)

Oh dear, I thought it was "My Implementation Taken" which is why I felt
at liberty to engage in outright plagiarism. If the license permits only
the plunder of ideas, I may have inadvertently exceeded its boundaries.
Next time I'll consult a lawyer before taking unnecessary risks ;)

Dave

Reply | Threaded
Open this post in threaded view
|

Unix HostWindowPlugin

Bert Freudenberg
In reply to this post by David T. Lewis
 
Hi Ian, folks -

I implemented the scaffolding for the HostWindowPlugin in the Unix VM.  
It's a bit more complicated than other platforms because we support  
multiple UI frameworks on Unix. I added the functions to the SqDisplay  
dispatch structure, increasing its minor version to 2. The functions  
are stubbed out in all display modules. In the X11 display module I  
only implemented the one function we need right now, namely setting  
the main window's title.

Since this is primarily for Etoys I attached my patches to this ticket:

        http://tracker.squeakland.org/browse/SQ-71

There is a tiny changeset allowing for

        DisplayScreen hostWindowTitle: 'Hello World!'

which I tested on a Mac working fine, and now on X11 too, using  
windowIndex 1 for the main window.

The patches are attached as a diff, as well as a tarball of all the  
changed files. Ian: Please integrate as soon as you find time (there  
is a tiny other patch in there, making -xshm not abort if xshm support  
is missing).

David - sorry for not using your HostWindowPlugin code, but it was X11  
only which is not the Right Way to do it. It should be reasonably  
simple for someone to adapt your code to the infrastructure I provided  
now (including generating events for secondary windows). I myself will  
not implement multi-window support any time soon.

Andreas - reading the message below again I still don't know where  
ioGetWindowLabel/ioSetWindowLabel comes from. Which platforms support  
this, where is the primitive code, and how is it exposed in the image?

Thinking about it it might have been simpler to use these functions.  
Is it okay to abuse the HostWindowPlugin for this? One reason I did it  
was that we'll soon need the window-size setting feature, too. And at  
least on the Mac prim #92 is buggy, whereas the HostWindow equivalent  
works fine. In any case having full HostWindow support would be  
useful, me thinks ;)

- Bert -

On 19.07.2008, at 16:28, David T. Lewis wrote:

> Bert,
>
> Here is a snapshot of a partially implemented HostWindowPlugin
> for X11. I have not looked at this in quite a while, but when
> I last worked on it a number of things were functional (including
> ioSetTitleOfWindow(), for whatever that may be worth).
>
> Some of the support code is crudely hacked out of Ian's original
> work, and I would anticipate some effort to make this right. In
> particular, it was not clear to me how the X event dispatching
> should ultimately work, and whether the host windows should behave
> analogously to Squeak projects or if they were intended to be
> more like passive display surfaces.
>
> I could probably be motivated to pick this up again and/or to
> help you with it, but in any case feel free to use this in any
> way you like. MIT license of course, and the plagiarized parts
> should be MIT because I stole them all from Ian ;)
>
> Dave
>
> On Fri, Jul 18, 2008 at 06:53:29PM -0700, Bert Freudenberg wrote:
>>
>> Am 05.02.2008 um 02:11 schrieb Bert Freudenberg:
>>
>>> On Feb 5, 2008, at 8:15 , Andreas Raab wrote:
>>>
>>>> ioGetWindowLabel/ioSetWindowLabel
>>>>
>>>> These are support functions that are currently not implemented in
>>>> the Unix/Mac VMs (we use them to get/set the main window title
>>>> directly). Here is how to stub them (best done in sqUnixMain.c):
>>>>
>>>> char* ioGetWindowLabel(void) {return "";}
>>>> sqInt ioSetWindowLabelOfSize(void* lbl, sqInt size) {return 0;}
>>>>
>>>> This should do the trick.
>>>
>>> Actually, I need to implement these for X11 anyway. Expect this to
>>> soon be supported in the OLPC branch. Unless someone beats me to it
>>> of course :)
>>
>>
>> Hmm, where could I find the code calling this? I'd need both the  
>> slang
>> and image-side code.
>>
>> - Bert -
>>
> <X11HostWindowPlugin-dtl.1.cs.gz><X11HostWindow.tgz>



Reply | Threaded
Open this post in threaded view
|

Re: Unix HostWindowPlugin

David T. Lewis
 
On Wed, Apr 29, 2009 at 11:36:44PM +0200, Bert Freudenberg wrote:
>
> Hi Ian, folks -
>
> I implemented the scaffolding for the HostWindowPlugin in the Unix VM.  

Great!

> David - sorry for not using your HostWindowPlugin code, but it was X11  
> only which is not the Right Way to do it. It should be reasonably  
> simple for someone to adapt your code to the infrastructure I provided  
> now (including generating events for secondary windows).

Good, I was pretty well stalled in my attempt to do HostWindowPlugin anyway.

> I myself will  not implement multi-window support any time soon.

I know what you mean ;)

Dave