FFI for Squeak 3.8 Open Cobalt

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

FFI for Squeak 3.8 Open Cobalt

Gary Dunn
 
(mutoh is the Squeak port maintainer. Please reply directly to me as the
vm-dev list requires subscription.)

I am trying to get Open Cobalt running on FreeBSD 7.1, Gnome 2.24. I
installed Squeak 3.9 from ports and have a 3.10 image running fine.

Open Cobalt is configured for Linux. The image is based on Squeak 3.8.
To get it to run at all I had to modify the startup script, basically to
use my squeak instead of the one that comes with the Linux version:

=-=-=-=-=

#!/bin/sh
IMAGE="cobalt.image"
DIR=`dirname $0`
EXE="$DIR/bin/i686-pc-linux-gnu"

# use command line arguments if present; else use default image
if [ $1 ]; then
    ARGS="$*"
else
    ARGS="$DIR/$IMAGE"
fi

# make source link if necessary
if [ ! -r $DIR/CroquetV1.sources ] ; then
        ln -s $DIR/bin/CroquetV1.sources $DIR/CroquetV1.sources
fi

# make libGL.so link if necessary
if [ ! -f /usr/lib/libGL.so -a -f /usr/lib/libGL.so.1 ] ; then
        if [ ! -f  "$EXE/libGL.so" ] ; then
                echo Creating libGL.so symlink in $EXE
                ln -sf /usr/lib/libGL.so.1 "$EXE/libGL.so"
        fi
fi

# Slight modification to cobalt.sh - line 26:
# make libopenal.so link if necessary - OpenAL is a good thing
if [ ! -f "$EXE/libopenal.so" -a -f /usr/lib/libopenal.so.1 ] ; then
    echo Creating libopenal.so symlink in $EXE
    ln -s /usr/lib/libopenal.so.1 "$EXE/libopenal.so"
elif [ ! -f "$EXE/libopenal.so" -a -f /usr/lib/libopenal.so.0 ] ; then
    echo Creating libopenal.so symlink in $EXE
    ln -s /usr/lib/libopenal.so.0 "$EXE/libopenal.so"
fi

#exec "$EXE/squeak" -plugins "$EXE" \  <--- my changes  --gd
#        -vm-display-X11 -swapbtn \
#        $ARGS
exec squeak -plugins "$EXE" $ARGS

=-=-=-=-=

This will run the FreeBSD version of squeak, the vm that comes with the
3.9 port:

$ squeak -version
3.9-7 #1 Thu Apr  9 01:24:21 HST 2009 cc
Squeak3.9alpha of 4 July 2005 [latest update: #7021]
FreeBSD slate01 7.1-RELEASE FreeBSD 7.1-RELEASE #0: Thu Jan  1 14:37:25
UTC 2009     [hidden email]:/usr/obj/usr/src/sys/GENERIC
i386
default plugin location: /usr/local/share/squeak/3.9-7/*.so

As cobalt loads I get this on the error output:

$ ./cobalt.sh
ioLoadModule(./bin/i686-pc-linux-gnu/SqueakFFIPrims):
  Shared object "libc.so.6" not found, required by "SqueakFFIPrims"
/usr/local/bin/firefox
/usr/local/bin/gnome-open
$

When I drag the cobalt ball I get:

setsockopt: No buffer space available
setsockopt: No buffer space available
fcntl: Device not configured

Here squeak hangs and must be killed (kill -9)

If I do not drag the ball I can work in the cobalt window, same as
squeak. I tried loading the FFI package but only 3.9 and 3.10 are
available, and will not load. FFI will load in my 3.10 image, but that
won't help me.

Is there a FreeBSD library I need to substitute for libc.so.6? I have
one at /usr/compat/linux/lib/libc.so.6 but I am not trying to run cobalt
in Linux mode.

Any thoughts?
--
Gary Dunn, Honolulu
[hidden email]
http://openslate.net/
http://e9erust.blogspot.com/
Sent from Slate001

Reply | Threaded
Open this post in threaded view
|

Re: FFI for Squeak 3.8 Open Cobalt

Andreas.Raab
 
Hi Gary -

A couple of notes. Croquet / Cobalt have some special requirements for
their VMs which relate to the bit-identical execution of the Croquet
environment. I suspect that may be the problem.

As the first thing you should run the CroquetVMTests in Cobalt to ensure
that your VM adheres to the required invariants.

If that passes, you should run "FFITester testAll" next to ensure that
the FFI is working properly in your environment.

When that works, it's time to try launching OpenGL via:

        (OpenGL newIn: (0@0 corner: 100@100))
                clearWindow: #(1 0 0 1);
                swapBuffers.

(this should result in a red square). If all of the above works you have
a good chance that Cobalt will work as well but more likely one or the
other will fail which will help you find out more about what you need to
fix.

Cheers,
   - Andreas

Gary Dunn wrote:

>  
> (mutoh is the Squeak port maintainer. Please reply directly to me as the
> vm-dev list requires subscription.)
>
> I am trying to get Open Cobalt running on FreeBSD 7.1, Gnome 2.24. I
> installed Squeak 3.9 from ports and have a 3.10 image running fine.
>
> Open Cobalt is configured for Linux. The image is based on Squeak 3.8.
> To get it to run at all I had to modify the startup script, basically to
> use my squeak instead of the one that comes with the Linux version:
>
> =-=-=-=-=
>
> #!/bin/sh
> IMAGE="cobalt.image"
> DIR=`dirname $0`
> EXE="$DIR/bin/i686-pc-linux-gnu"
>
> # use command line arguments if present; else use default image
> if [ $1 ]; then
>     ARGS="$*"
> else
>     ARGS="$DIR/$IMAGE"
> fi
>
> # make source link if necessary
> if [ ! -r $DIR/CroquetV1.sources ] ; then
>         ln -s $DIR/bin/CroquetV1.sources $DIR/CroquetV1.sources
> fi
>
> # make libGL.so link if necessary
> if [ ! -f /usr/lib/libGL.so -a -f /usr/lib/libGL.so.1 ] ; then
>         if [ ! -f  "$EXE/libGL.so" ] ; then
>                 echo Creating libGL.so symlink in $EXE
>                 ln -sf /usr/lib/libGL.so.1 "$EXE/libGL.so"
>         fi
> fi
>
> # Slight modification to cobalt.sh - line 26:
> # make libopenal.so link if necessary - OpenAL is a good thing
> if [ ! -f "$EXE/libopenal.so" -a -f /usr/lib/libopenal.so.1 ] ; then
>     echo Creating libopenal.so symlink in $EXE
>     ln -s /usr/lib/libopenal.so.1 "$EXE/libopenal.so"
> elif [ ! -f "$EXE/libopenal.so" -a -f /usr/lib/libopenal.so.0 ] ; then
>     echo Creating libopenal.so symlink in $EXE
>     ln -s /usr/lib/libopenal.so.0 "$EXE/libopenal.so"
> fi
>
> #exec "$EXE/squeak" -plugins "$EXE" \  <--- my changes  --gd
> #        -vm-display-X11 -swapbtn \
> #        $ARGS
> exec squeak -plugins "$EXE" $ARGS
>
> =-=-=-=-=
>
> This will run the FreeBSD version of squeak, the vm that comes with the
> 3.9 port:
>
> $ squeak -version
> 3.9-7 #1 Thu Apr  9 01:24:21 HST 2009 cc
> Squeak3.9alpha of 4 July 2005 [latest update: #7021]
> FreeBSD slate01 7.1-RELEASE FreeBSD 7.1-RELEASE #0: Thu Jan  1 14:37:25
> UTC 2009     [hidden email]:/usr/obj/usr/src/sys/GENERIC
> i386
> default plugin location: /usr/local/share/squeak/3.9-7/*.so
>
> As cobalt loads I get this on the error output:
>
> $ ./cobalt.sh
> ioLoadModule(./bin/i686-pc-linux-gnu/SqueakFFIPrims):
>   Shared object "libc.so.6" not found, required by "SqueakFFIPrims"
> /usr/local/bin/firefox
> /usr/local/bin/gnome-open
> $
>
> When I drag the cobalt ball I get:
>
> setsockopt: No buffer space available
> setsockopt: No buffer space available
> fcntl: Device not configured
>
> Here squeak hangs and must be killed (kill -9)
>
> If I do not drag the ball I can work in the cobalt window, same as
> squeak. I tried loading the FFI package but only 3.9 and 3.10 are
> available, and will not load. FFI will load in my 3.10 image, but that
> won't help me.
>
> Is there a FreeBSD library I need to substitute for libc.so.6? I have
> one at /usr/compat/linux/lib/libc.so.6 but I am not trying to run cobalt
> in Linux mode.
>
> Any thoughts?
Reply | Threaded
Open this post in threaded view
|

Re: FFI for Squeak 3.8 Open Cobalt

Gary Dunn
 
Thanks for taking the time to help me out. I know there are others
working on Open Cobalt who want to see it run on the Beasties.

I did some tests, results below:

On Wed, 2009-11-11 at 22:22 -0800, Andreas Raab wrote:
> Hi Gary -
>
> A couple of notes. Croquet / Cobalt have some special requirements for
> their VMs which relate to the bit-identical execution of the Croquet
> environment. I suspect that may be the problem.
>
> As the first thing you should run the CroquetVMTests in Cobalt to ensure
> that your VM adheres to the required invariants.

Error output running CroquetVMTests in SUnit Test Runner

ioLoadModule(./bin/i686-pc-linux-gnu/B3DAcceleratorPlugin):
  Shared object "libdl.so.2" not found, required by
"B3DAcceleratorPlugin"
ioFindExternalFunctionIn(, 0x283dc200):
  Undefined symbol ""
ioLoadModule(./bin/i686-pc-linux-gnu/UUIDPlugin):
  Shared object "libuuid.so.1" not found, required by "UUIDPlugin"

Results displayed in SUnit Test Runner window:

75 run, 71 passes, 2 expected failures, 2 failures, 0 errors, 0
unexpected passes

Is this bad? :-)

> If that passes, you should run "FFITester testAll" next to ensure that
> the FFI is working properly in your environment.

This generates an error "Unable to find function address" at the first
test in testAll. errCode is 13.

>
> When that works, it's time to try launching OpenGL via:
>
> (OpenGL newIn: (0@0 corner: 100@100))
> clearWindow: #(1 0 0 1);
> swapBuffers.
>
I did not attempt ... should I?

I am thinking I should compare the methods added when I load
SqueakFFIPrims to my squeak3.10 image to the methods in the cobalt
image, to see if SqueakFFIPrims is loaded. After I go out and enjoy the
beautiful day a bit.

Thanks again, Andreas!

--
Gary Dunn, Honolulu
[hidden email]
http://openslate.net/
http://e9erust.blogspot.com/
Sent from Slate001

Reply | Threaded
Open this post in threaded view
|

Re: FFI for Squeak 3.8 Open Cobalt

Bert Freudenberg

On 12.11.2009, at 20:49, Gary Dunn wrote:

> ioLoadModule(./bin/i686-pc-linux-gnu/B3DAcceleratorPlugin):
>
> Is this bad? :-)

On BSD trying to use the Linux plugins is bad, yes.

Remove the -plugins "$EXE" part from the command line, or replace it with the real location of the VM plugins.

- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: FFI for Squeak 3.8 Open Cobalt

Gary Dunn
In reply to this post by Gary Dunn
 
On Thu, 2009-11-12 at 09:49 -1000, Gary Dunn wrote:
> On Wed, 2009-11-11 at 22:22 -0800, Andreas Raab wrote:
[snip]

> > If that passes, you should run "FFITester testAll" next to ensure that
> > the FFI is working properly in your environment.
>
> This generates an error "Unable to find function address" at the first
> test in testAll. errCode is 13.
>
> >
> > When that works, it's time to try launching OpenGL via:
> >
> > (OpenGL newIn: (0@0 corner: 100@100))
> > clearWindow: #(1 0 0 1);
> > swapBuffers.
> >
> I did not attempt ... should I?
>
> I am thinking I should compare the methods added when I load
> SqueakFFIPrims to my squeak3.10 image to the methods in the cobalt
> image, to see if SqueakFFIPrims is loaded. After I go out and enjoy the
> beautiful day a bit.

I loaded FFI 3.9 into a squeak session using my 3.9 VM and image from
FreeBSD ports. There is no FFITester but I did find a unit test. All
twenty-one unit tests failed, apparently for the same reason, unable to
find function address.

Did same for my 3.10 image, same results. I must be missing something!

--
Gary Dunn, Honolulu
[hidden email]
http://openslate.net/
http://e9erust.blogspot.com/
Sent from Slate001