As a learning experience I have tried porting Squeak to Linux/m68k (Debian 2.0beta). While the make process ran without a problem (thanks Ian!) I quickly faced a segmentation fault when running Squeak (in the incrementalGC when the lowSpaceWatcher is installed, to be precise). Inspecting the variables I found following:
(gdb) print memory $22 = (unsigned char *) 0xc0151008 "À\026\030I\r"" (gdb) print endOfMemory $11 = -1068549284
As I read it the memory has been malloced high up and all those ints that represent addresses have become negative, breaking the pointer arithmetic.
So...shouldn´t all variables that hold addresses (OOPs) be declared as unsigned instead of int (or am I barking up the wrong tree) ?
Yes, or (void *) perhaps. But I'd hate to have to put all those type declarations into the Smalltalk code that is used to generate the C code for the VM...
It might be easier to figure out how to force allocation in the lower half of the address space.
-- John