[ANN] SqueakOS

Marcus Denker marcus at ira.uka.de
Mon Oct 11 20:17:50 UTC 1999


On Mon, Oct 11, 1999 at 07:43:25AM -0800, Dan Ingalls wrote:

> What VM did you start with?
>
The VM is based on Embedded Squeak (by Paul Fernhout,
http://www.kurtz-fernhout.com/squeak/).

Embedded Squeak is a 2.2 VM with most drivers removed: no Sound,
network, IO, graphics. Only the Serial-Port-access is implemented. 
It uses a non-inlined interp.c. 
I have changed the Serial-Port Primitves to do STDIN/OUT on Unix. 

Paul implemented a simple way of embedding the image in the VM:
The image contains code to write it into a C-Array. 
sqImageFileRead() is changed to read the image from this array. 

The downside of this approach is that the memory used by this array
is not freed later.

> What image did you start with?
>
It's the image that comes with Embedded Squeak. It seems to be the
2.2 "mini.image" with some additions, like the command-line parsing.

>
> Is your file smaller because of compression?
>
Yes. Oskit builds Kernel-Images in a format called "MultiBoot". This
can be converted to many others, including the format of the Linux kernel.

My SqueakOS-kernel uses the LinuxKernel-image format: It is compressed with
gzip, and automatically decompresses itself on startup. The size of
this startup-code and decompressor:
-rwxr-xr-x   1 marcus   marcus      45528 Oct 10 10:32 linuxboot.bin*

The "MultiBoot" image without Linux-booter, uncompressed:

-rwxrwxr-x   1 marcus   marcus     832272 Oct 10 22:15 esqueak*

marcus at wombat:~/proj/squeakOS $ size esqueak 
   text    data     bss     dec     hex filename
 207276  608904   97748  913928   df208 esqueak

The .o-files of the VM:
marcus at wombat:~/proj/squeakOS $ size *.o
   text    data     bss     dec     hex filename
      0  602900       0  602900   93314 ImageFileInMemory.o
 112188       4       0  112192   1b640 interp.o
   5854      12     256    6122    17ea sqEmbedded.o
    401       4       0     405     195 sqFilePrims.o
   3854       0       0    3854     f0e sqMiscPrims.o

Explanation:
 text: the binary programm text
 data: initialized data (like global arrays)) 
 bss:  uninitialized data, this is not contained in the executable
       but allocated (and initialied with 0) when the programm is
       started. 
While running the programm can additionally allocate memory. This is 
normally done via "malloc()".
(a good explanation of this can be found in W. Richard Stevens:
"Programming in the Unix Environment")

>
> What is the final "footprint" -- meaning, when squeak is running,
> executing something from the command, how much space do flux, the
> vm and the image each take up, roughly, and how much free space do
> you typically allocate for free space in the object memory?
> 

The footprint seems to be somewhat like this:

Linux Startup-Code:  45528
text+data+bss VM:   122573          
data Image-Array:   602900

The rest has to be the memory of OSKit (and the c-library of OSKit):

data+text+bss:      188455      

Now the VM allocates some memory via "malloc", "availablememory"
is set to 1850000 in sqEmbedded.c, so:

ObjectMemory:      1850000
               ---------------
                 2,809,456 byte used memory

"Smalltalk bytesLeft" returns "1103476".

--
Marcus Denker marcus at ira.uka.de phone at home:(0721)614235 @work:(0721)608-2749

  





More information about the Squeak-dev mailing list