VM porting problems

Tim Rowledge tim at sumeru.stanford.edu
Tue Dec 7 21:29:35 UTC 2004


Neil Rhodes <neil-list at calliopeinc.com> wrote:

> I'm working on porting the 3.7 VM to Palm OS 6.0 (the 6.0 OS removes 
> lots of restrictions in previous versions of the OS that make it 
> difficult to support Squeak).
Well good for you - this is nice to hear. I've been wanting to see this
since I spent some time consulting for palm to help push them towards
ARMs.
> 
> Here's the problem I'm having.  I've got a VM built which implements 
> all the necessary io routines, including ioScreenSize, ioShowDisplay.  
> The problem is that ioShowDisplay is never called.  Others are, like 
> ioScreenSize.
First, check that ioShowDisplay is referred to in the interp.c file - it
should be called by displayBitsOfLeftTopRightBottom(). That in turn is
called in a number of places. Remember when grepping (or your local
equivalent) to serach in both the platforms tree and the generated src
tree or you'll get confused. I never made that mistake. Not once, no
never at all. Honest.

> 
> One thing I tried to track down the problem was to build a VM for my 
> Mac OS X machine.  My plan was to load the identical image and look at 
> the bytecodes that were executed, figuring out where it started to 
> differ from the Palm OS version.
> 
> I used the unix sources and successfully built a VM that contains only 
> the MiscPrimitives internal plugin. Otherwise, there are no other 
> plugins selected in VMMaker (internal or external). When I run the VM, 
> it exhibits similar behavior. The image loads and starts executing. 
> Some functions are called, like display_ioScreenSize, but 
> display_ioShowDisplay is never called.
Without any other plugins you'll get into trouble. You need the
BitBltPlugin and I think you'll find you want at least a null
FilePlugin pretty quick. The fact that you don't see ioShowDisplay being
called implies to me that you've probably had something earlier fail and
your VM is trying to handle it. If you had FilePlugin working it might
have written a log file for you.

Search the interp.c file for BitBltPlugin and you'll see it is loaded
from the VM as well as from the image for some purposes.

There's also the issue of how you are doing display updating for
PalmOS. If you look at the various other platform's files (typically
named something like sq{platofrm}Window.c)  you'll see several
different strategies. You can move pixels from the Display bitmap to the
glass (remembering any pixel transformations for pixel order within
words, RGB coding etc) during the ioShowDisplay or ioForceDisplayUpdate
or even during the event loop where you get some sort of screenupdate
event from the OS.

Since you're using an ARM I guess there is a good chance the machine is
running littleendian so you will have munge the pixels in some manner.



tim
--
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Fractured Idiom:- PORTE-KOCHERE - Sacramental wine



More information about the Squeak-dev mailing list