I've checked in all the os-x and iphone revisions to the isqueak.org svn tree.
At this point you can build via SqueakPureObjc.xcodeproj an iPhone VM and a 64-bit OS-X
for reading a 32bit image.
At this point the 64bit OS-X VM will read the 32bit image, read the unix args & environment settings,
execute millions of instructions and render the graphics to the window.
I have not added any interaction (mouse events, window events, keyboard events) yet. That
will happen this week.
Things to fix:
Resolving the HostWindow plugin api
The file name lookup logic has to properly deal with Finder Alias and unix symbolic links plus the flag we
have to decide if the last component in the path should be resolved. The flag in question is used by
the delete file logic so that you can delete a symbolic or Finder Alias, versus the target of the link.
Cursor logic is there but broken
I'm considering if I can make the app a NSDoc aware app where the image is document. However
the key point is how do we make the image execute the smalltalk save logic as a result of interacting
with the standard document save logic.
Sound api fixes have to enter the main tree since it's evident they don't work for 64bit apps.
Considering what to do for the plugin loading code.
--
===========================================================================
John M. McIntosh <johnmci(a)smalltalkconsulting.com> Twitter: squeaker68882
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
===========================================================================
This week I hope to check in the OS-X cocoa port which is built on top of the original iPhone source tree.
I'm afraid I might break a few things as I refractor things a bit for the OS-X version, versus the iPhone.
The original goal was to provide a common abstract class structure for the VM support api, then subclass or
extend that for the iPhone VM, or the OS-X VM. Based on this last year I built the IPhone VM.
Now that I'm building the OS-X VM I find there are some invalid assumptions made in the abstract classes
centring around proper Areithfa Ffenestri support for OS-X. The iPhone supports only a single window, (UIWindow)
technically it exists but you don't do much with it, other than instantiate it and add a UIView to it.
On OS-X you can have multiple NSWindow's and the Areithfa Ffenestri (HostWindow plugin) lets you
deal with them, although there are multiple VM support api for example ioScreenSize which implicitly
suggest you are dealing with the default window created at startup time, versus a window that is created later.
In both cases we automatically instantiate the window from NIB files since Squeak by default doesn't
invoke the Areithfa Ffenestri call to make the window.
Anyway sorting that all out might break the iPhone build, so I would suggest you work only upto
isqueak.org source tree Revision: 108
unless you with to experiment with a alpha/beta experience.
I note once I reach a beta stage I will add the new source tree to squeakvm.org
--
===========================================================================
John M. McIntosh <johnmci(a)smalltalkconsulting.com> Twitter: squeaker68882
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
===========================================================================
Folks -
I just finished a prototype of the Win32 event VM to illustrate some of
the practical impact. It makes a really nice demo:
1) Download the VM from
http://squeakvm.org/win32/experimental/Squeak-3.11-EventVM.zip
2) Fire up an image with this VM (I used a trunk image) and execute
AbstractSound stereoBachFugue play.
3) Observe the sound behavior you get when you:
* drag the window around
* go to the system menu
* click the window close button
In all of the above situations the sound play will be interrupted,
replaying the current buffer over and over.
4) Execute the following:
(ProcessorScheduler classPool at: #BackgroundProcess) terminate.
You should see a printf that tells you "entering windows main loop"
which indicates that you're now running under the new regime.
5) Observe the sound behavior you get when you:
* drag the window around
* go to the system menu
* click the window close button
In all of these situations the sound will now keep playing. There can be
a temporary hickup due to lack of buffering but other than that
everything continues smoothly.
For those interested I'm attaching the relevant changes (only for
playing around; these changes are NOT ready to be integrated). The
Windows main loop has been changed to read like here:
/* prepare active process and do first time interpret() for old images */
prepareActiveProcess();
/* do not allow recursive interpret() */
allowInterpret = 0;
/* interpret() will be left after nuking background process */
interpret();
/* now do a classic Windows main loop */
printf("Entering Windows Main Loop\n");
SetTimer(stWindow, 1, 50, NULL); /* make sure we interpret() every
50ms */
allowInterpret = 1; /* okay to interpret() now */
while (GetMessage(&msg, NULL, 0, 0) > 0) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
and then you call interpret() whenever you feel like it. I'm doing that
from MainWndProc in response to Windows messages:
/* A bit of extra paranoia: I'm not sure if calling interpret()
through checkForInterrupt() recursion into ioProcessEvents()
is safe (probably not). */
if(!inProcessEvents && allowInterpret) interpret();
Of course, this isn't finished yet by any means. There are some odd
effects when a recursion does happen, and somewhere I'm loosing events.
But I think it does illustrate the point that I'm trying to make.
BTW, does anyone know if wxSqueak is still active? I think the behavior
of this VM would be a perfect fit for their needs.
Cheers,
- Andreas
(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 root@logan.cse.buffalo.edu:/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
osp(a)aloha.com
http://openslate.net/http://e9erust.blogspot.com/
Sent from Slate001
Hi Andreas,
thanks for sharing this.
A few questions:
1. Is nuking the Win32VMMaker and loading the one from
"platforms\win32\build\Win32VMMaker.st" still required
as described on http://squeakvm.org/win32/compiling.html?
Looks like the code is already integrated in VMMaker, so
is this obsolete?
2. Do you still use the ToolChain with the "old" GCC 2.95-2 as provided
on Squeakvm.org or is there something newer than
http://squeakvm.org/win32/release/Squeak-Win32-Tools-1.2.zip
3. Is the quicktime plugin running on Win32? Last posting I've found:
http://aspn.activestate.com/ASPN/Mail/Message/squeak-list/3325977
and there is also
http://www.fit.vutbr.cz/study/courses/OMP/public/software/sqcdrom2/Packages… but the changeset is gone
4. When I make the freetype plugin an internal plugin (to distribute
VM with all plugins + image only) I get:
./obj/vm/FT2Plugin.lib(FT2Plugin.o.b): In function `initialiseModule':
//C/squeak/vmmaker/vm/3115/testbuild/obj/FT2Plugin/../.././src/FT2Plug in/FT2Plugin.c:419: undefined reference to `FT_Init_FreeType'
5. Are there any plans for having Alien Plugin for Win32 in the Win32
SqueakVM distribution? What is the state here?
6. Any plans regarding fixing the "service" stuff (see my posting
in "Win32 VM Service facility broken?")
Thanks
Torsten
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
Since we are talking about events, this is an error thrown by a iphone
squeak vm setup as a single pthread.
What happens is ioGetNextEvent is called which calls ioProcessEvents
which on a special version of the iphone vm
calls [NSRunLoop currentRunLoop] to run for N milliseconds.
When the run loop runs it ends up sending a message to an Objective-C
SqueakProxy instance which then signals
a squeak semaphore to wake up the VM. In this specialized VM it does
interpreterProxy->signalSemaphoreWithIndex(sem);
interpreterProxy->callbackEnter(&callbackid);
However I *think* the problem here is that although we signal the
semaphore then issue the forceInterruptCheck
in callbackEnter: this does not actually alter the runnable processes
list since that work is only done when
checkForInterrrupts() is run. Thus in this case the only process
running is the idleProcess, and it's sleeping
but we are attempting to wake a squeakProxy process waiting on the
semaphore we did signal, but
as you see oops nada runnable, so die.
2009-11-10 12:59:36.214 x[13886:207] forwardInvocation: <NSInvocation:
0x1368370>
2009-11-10 12:59:36.215 x[13886:207] currentThread: <NSThread:
0x1105e90>{name = (null), num = 1}
2009-11-10 12:59:36.219 x[13886:207] inside lock 0
2009-11-10 12:59:36.220 x[13886:207] signalling squeak
scheduler could not find a runnable process
548435824 >idleProcess
548435732 >startUp
548291060 BlockClosure>newProcess
callbackEnter: callbackID
"Re-enter the interpreter for executing a callback"
| result activeProc |
self export: true.
self var: #callbackID declareC: 'sqInt *callbackID'.
"For now, do not allow a callback unless we're in a primitiveResponse"
primitiveIndex = 0 ifTrue:[^false].
"Check if we've exceeded the callback depth"
jmpDepth >= jmpMax ifTrue:[^false].
jmpDepth := jmpDepth + 1.
"Suspend the currently active process"
activeProc := self fetchPointer: ActiveProcessIndex
ofObject: self schedulerPointer.
suspendedCallbacks at: jmpDepth put: activeProc.
"We need to preserve newMethod explicitly since it is not activated yet
and therefore no context has been created for it. If the caller
primitive
for any reason decides to fail we need to make sure we execute the
correct
method and not the one 'last used' in the call back"
suspendedMethods at: jmpDepth put: newMethod.
self transferTo: self wakeHighestPriority.
"Typically, invoking the callback means that some semaphore has been
signaled to indicate the callback. Force an interrupt check right
away."
self forceInterruptCheck.
result := self setjmp: (jmpBuf at: jmpDepth).
result == 0 ifTrue:["Fill in callbackID"
callbackID at: 0 put: jmpDepth.
"This is ugly but the inliner treats interpret() in very special and
strange ways and calling any kind of 'self interpret' either directly
or even via cCode:inSmalltalk: will cause this entire method to vanish."
self cCode: 'interpret()'.
].
"Transfer back to the previous process so that caller can push result"
activeProc := self fetchPointer: ActiveProcessIndex
ofObject: self schedulerPointer.
self putToSleep: activeProc.
activeProc := suspendedCallbacks at: jmpDepth.
newMethod := suspendedMethods at: jmpDepth. "see comment above"
self transferTo: activeProc.
jmpDepth := jmpDepth-1.
^true
--
=
=
=
========================================================================
John M. McIntosh <johnmci(a)smalltalkconsulting.com> Twitter:
squeaker68882
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
=
=
=
========================================================================
I'm trying to get squeak running on opensolaris 2009.06 (in the cloud on
Amazon EC2, so I don't have a desktop).
I've tried both the squeakvm.org prebuilt binaries and the binaries
I've built from the src tarball.
I'm getting roughly the same behavior in both a Seaside image and an image to
which I've added RFB. They work fine locally (OSX 10.5 with a closure VM),
but they seem to be hung up waiting for I/O when I start them on the cloud.
As in, I can connect to the RFB image, and it takes about 20 seconds to
refresh. If I click on anything, no response. But if I break the RFB
connection, and connect again, I get the *result* of that action.
It might be related to the fact that 2009.06 solaris kernel added some extra
error return from the poll() call that nobody was expecting (which broke
apache), and I presume Squeak is using poll at the lowest level.
Here's the stack where squeak seems to be frozen:
cf6b1687 pollsys (8047850, 1, 8047908, 0)
cf65ce01 pselect (8, 8047a50, 80479d0, 8047950, 8047908, 0) + 199
cf65d1d6 select (8, 8047a50, 80479d0, 8047950, 8047948, 80f94e0) + 78
0807d45a aioPoll (0, 0, 0, 0, 0, 0) + 10a
00000000 ???????? ()
Is anyone using Squeak on solaris/opensolaris and can help me?
I'd hate to have to keep renting my openbsd box just for this app. :(
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn(a)stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
A understanding question:
In Bitmap
#decompress:fromByteArray:at:
primitiveFailed shouldn't be : primitiveFail ?
if no, where is define primitiveFailed ( in VM code source ), and what
the use of it ( personal understanding )
JB
the MiscPrimitivesPlugin loop when generating.
the cause is :
the primitives: #findSubstring:in:startingAt:matchTable:
was change to the primitive that name is now:
#findSubstringViaPrimitive:in:startingAt: matchTable:
i can simply change the name in #translatedPrimitives
(MiscPrimitivePlugin ) method but i am looking for long term solution.