embedded Squeak for UNIX + bootable demo

Paul Fernhout pdfernhout at kurtz-fernhout.com
Sat Jan 16 02:58:01 UTC 1999


Peter William Lount wrote:
>> A new bootable (x86) Squeak Demo floppy (Linux+embedded Squeak)
>> ftp://ftp.ira.uka.de/pub/squeak/demo 
> VERY COOL!
> 
> Ok. I decompressed the zip file and ran the rawrite2.exe as follows:
>         rawrite2 -f sqdemo~1.ima

Thanks for the pointer. I wasn't sure how to do this.
 
> After following the instructions I had a bootable floppy disk which I
> proceeded to boot.
> 
> I got a squeak command line prompt and entered some commands. (3+4) will
> print 7. Cool.

I just tried it too -- it works for me to, on a Compaq Pentium Pro. 
And I echo your "VERY COOL" for Squeak(ette) on a floppy.
Thank you Marcus!

> Now what?

Good question. 

Embedded Squeak is intended mostly for:
* running hardware (like robots or animatronics or toasters) where a GUI
is not required
* getting Squeak on a platform fast
* providing a base for experimentation in slimming down Squeak to the
point where there is a tiny base module we can then build up from
(rather than work down from a big image).
* a simplified example for understanding the Squeak code
* any other useful things people do with it which can then be claimed as
reasons for its creation ;-)

However, Embedded Squeak still has many limitations and needs as
discussed in the readme file. 

Most of all, you can only do one line commands, like: 
"1 to: 10 do: [:i| EmbeddedSystem report: i printString. EmbeddedSystem
reportCR.]."

In theory, this is enough, because you could built up strings one line
at a time by concatenation which you then evaluate with the compiler.
However, Embedded Squeak should really be able to do a fileIn of code in
fileOut (!! chunks) format. I believe both Little Smalltalk and GNU
Smalltalk supported this.

Also, its output is limited to 1023 characters per "EmbeddedSystem
report: aString" (the rest is truncated by the VM).

These should be fairly easy to fix; I just haven't had the time to make
the enhancements. It seems to me though, that with the power of
Smalltalk behind it, EmbeddedSqueak should someday be able to put
(almost) any other command line processing system to shame...

And whatever else one can say about command lines, many people use them
all the time, and they can be very useful and powerful (even without GUI
support). I spent years working with command line systems with BASIC,
FORTH, and LISP, just doing text processing and AI/Adventure stuff, and
those were happy days. Line numbers got the job done for me for years. 
However I must admit, luxuries like being able to save and load files,
as well as edit files with the likes of teco/edlin/emacs/vi/kedit/pine,
are nice. :-) Still, those should be easy to add to Embedded Squeak --
TECO in Smalltalk anyone? 

Or maybe just line numbers in methods to start with, such as: 
Squeak>> edit EmbeddedSystem>myMethod
Squeak>> list
EmbeddedSystem>myMethod
100:myMethod
110:  self report: 'hello world.'.
Squeak>> 110  self report: 'Squeak world.'.
Squeak>> 120  self report: 'Retro computing is the future!'.
Squeak>> list
EmbeddedSystem>myMethod
100:myMethod
110:  self report: 'Squeak world.'.
120:  self report: 'Retro computing is the future!'.
Squeak>> EmbeddedSystem myMethod
Squeak world.
Retro computing is the future!

On the more serious side, Perl and Python are considered very useful
systems, depended on in mission critical applications every day, and
neither of them require a GUI to do CGI/HTML stuff.

> I entered (Smalltalk keys) and got a list of classes in the Smalltalk
> system dictionary. I noticed many gui style classes.

Yes, there are still in there (mostly because I don't have an easy way
to strip them out). Also, it is useful that the same image used to build
Embedded Squeak can also be used for development (although a modular
Squeak would be better).

> Questions:
> 
> How do I activate a gui with this embedded squeak?

Unless Marcus has made enhancements to Embedded Squeak (which I didn't
see in his changes), the short answer is, you can't. The GUI is actually
running under the VM, but the primitives to display bitmaps (or do most
other I/O things) are not included. 

Of course, if you want the GUI primitives, mouse support, etc. you would
need that code from the VM for a UNIX/Linux port. However, the LINUX
distribution he uses may not include a display driver (like VGA
support). Also, I wonder if it would still fit on a disk if it needed
display drivers, the GUI code, mouse drivers, etc. ? Probably? 
Is there a full GUI Squeak on a LINUX floppy already? 
I think the MSDOS Squeak may fit on a floppy. (But MSDOS is not open.)

> How do I put my own image on the diskette?

I haven't tried it, but in general, you would need to take the base
Embedded Squeak image and modify it to your purposes. All I/O is done
through the serial port primitives, which Marcus has mapped to the LINUX
console. The class "EmbeddedSystem" in that image is the place to work
from.

Once you have the image the way you want it (developing with a regular
Squeak EXE to provide a GUI), you then save the image, and run a piece
of code in EmbeddedSystem to create a file which defines the embedded
image as C code. That file is then linked to the rest of the code to
build the EmbeddedSqueak executeable.
 
> Where is more information about your demo?
> How can I construct my own bootable disk with my own image and mini
> application on it?

You can get some more info about embedded Squeak from 
http://www.kurtz-fernhout.com/squeak
Mainly you'll need to consult the readme file and look at the
EmbeddedSystem class.

However, I don't know anything about the process Marcus used to prepare
the bootable disk with Linux. I looked at the package he provides with
source, but it does not include that information.

There is a readme.txt file on the disk which says:
) You can place any compressed Linux kernel on this disk, and it should
boot.
) To do so:
) 	Configure the kernel with the following facilities linked in: initrd,
) 	 ramdisk, msdos, fat, minix, elf, ext2fs, procfs.
)     Make your kernel with "make bZimage".
)     Copy it to "linux" on the floppy.
)     Change directory to the floppy and run ./rdev.sh to configure the
kernel.
)     Optionally edit syslinux.cfg to add arguments to the "DEFAULT"
)     line, or add an "APPEND" line with arguments to be appended to any
)     user-typed command line as well as the default.
) 
) Documentation to read:
)     /usr/lib/syslinux/readme*
)     "man rdev"
)     /usr/src/linux/documentation/ramdisk.txt
) 
) Source code:
)     The scripts that create this disk and the other Debian bootstrap
disks
)     are installed in /usr/src/boot-floppies/ by the boot-floppies
package.
) 
) - Bruce Perens, 12-March-1996

I assume Marcus must have linked the Embedded Squeak output file with
the Linux kernel directly, and then compressed the entire thing, and
put  it on a standard release floppy. I'm not sure what it would take to
do this, presumably some base Debian Linux sources and GCC and GZIP? 
Marcus -- am I close? 

-Paul Fernhout
Kurtz-Fernhout Software 
=========================================================
Developers of custom software and educational simulations
Creators of the GPL Garden with Insight(TM) garden simulator
http://www.kurtz-fernhout.com/squeak





More information about the Squeak-dev mailing list