FFI Question on Linux

Lex Spoon lex at cc.gatech.edu
Mon Oct 23 22:57:40 UTC 2000


Tim Rowledge <tim at sumeru.stanford.edu> wrote:
> yampa at mindspring.com is widely believed to have written:
> 
> 
> > One semi-related question:  I think I'm a little bit familiar with the plugin c files.  But since I've been digging around in the C and make files, I haven't seen a c program with a main function.  I was thinking it would be in interp.c.  Can someone tell me what the main c files of Squeak are?  Somehow I think it would help me get a better picture of how this all fits together behind the curtain.
> 
> Look in sq{plat}Window.c, usually at the bottom.
> 

Yes, sqXWindow.c.  However, it probably won't help that much;
sqXWindow.c just loads the image, initializes some stuff, and then calls
interpret().

The natural center of Squeak, if you are looking at the C code, is
interpret().  interpret() loops forever, interpreting bytecodes out of
the image.  Occasionaly, a bytecode will end up invoking a primitive, in
which case interpret() calls primitiveResponse() (I think).  In turn,
primitiveResponse() has a humongous switch statement that calls
functions specific to each group of primitives.  Finally, the functions
that primitiveResponse() calls are the ones that (eventually) call
platform-specific functions.



By the way, the upcoming Squeak anthology from Prentice-Hall, editted by
Kim Rose and Mark Guzdial, will have three chapters you'd probably be
interested in:

	1. one by Tim Rowledge explaining the above, except in detail and more
likely to be correct :)

	2. one by Ian Piumarta on porting Squeak to new platforms

	3. one by Andrew Greenberg on writing plugins



-Lex





More information about the Squeak-dev mailing list