[ANN] [ENH] OS Process support for Squeak (Unix/Linux)

David T. Lewis lewis at mail.msen.com
Sat Jun 19 18:46:19 UTC 1999


OSProcess for Unix Squeak - Version 0.2 (first public release)

OSProcess provides access to operating system functions, including
pipes and child process creation. It is implemented for Linux and
will probably work on most Unix systems. The Smalltalk code, including
the classes which implement pluggable primitives for Unix operating
system functions, may be loaded into any Squeak image, but the
primitives are of course only useful on Unix systems. Placeholder
classes are provided for Mac and Windows, but are not implemented here.

If you are using a non-Unix platform, you can just file in the Smalltalk
files and have a look around. All of the code except for some minor patches
to one of the existing Unix support files (sqXWindow.c) is written in
Smalltalk.  If you are likely to translate a new interp.c file in the
future (that is, if you compile your own VM rather than just using the
one you downloaded from the net), please do "OSProcess systemType: nil"
and save your image; this will prevent generation of Unix specific code
the next time you make a new interp.c file.  Unix users can follow the
additional steps below to build VM support for the new classes.

The following files are attached to this mail message:
     OSProcessV0_2.zip
     OSProcessV0_2.tar.gz
     OS-Support.st
     StandardFileStream-fileID.st
     Interpreter class-translatedoInlining.st

The zip and tar.gz files are complete distributions, containing all
necessary files for a Linux/Unix build, in your choice of ZIP archive
or gzipped tar format. The three Smalltalk files are provided separately
in case you do not have zip or gzip/tar available on your system, and
still would like to load the Smalltalk files.

This version does not yet provide a semaphore to allow waiting for
process completion, so it is the responsibility of the user to
close open file streams and otherwise clean up after any child
processes. There are probably bugs in this release (hence
"version 0.2"), but it is quite functional and provides an easy
way to run and communicate with non-Squeak programs, or to start
additional Squeaks running on the same computer (UnixProcess>>squeak).

On Unix systems, some patches to sqXWindow.c (the C main program) are
required in order to permit access to the command line, environment,
stdio, stdout, and stderr. A patch file for this and for the makefile
changes is included here.

To add OS Process support to Squeak on Linux (and probably other Unix systems),
follow these steps:

1) Starting with your existing Squeak 2.4, make sure that you can build a new
virtual machine from sources. Back up your source code and image.

2) Now make sure you can build a VM with an interp.c that you generate from
Squeak. First generate a new interp.c from your Squeak image
(Interpreter translate: 'interp.c' doInlining: true), then copy it into
your source tree and repeat step 1.

3) If step 2 fails to link due to unresolved symbols ioSetDisplayMode and
ioHasDisplayDepth, then add dummy functions for them. This is most easily
done by concatenating the file fix.c in this directory to the end of your
new interp.c, then repeating step 2. This resolves a bug in the Squeak 2.4
release, which was missing code for a couple of new primitives.

4) Patch your sqXWindow.c file using the supplied sqXWindow.diff (or
simply replace it with the sqXWindow.c in this directory). Then patch
GNUmakefile with the supplied GNUmakefile.diff, and patch GNUmakefile.conf
with the supplied GNUmakefile.conf.diff.

5) File in the three source files:
	"OS-Support.st"
	"StandardFileStream-fileID.st"
	"Interpreter class-translatedoInlining.st"
The first file, "OS-Support.st", contains the new classes.
"StandardFileStream-fileID.st" is an accessor method for StandardFileStream,
required to implement stdin/stdout/stderr access.
"Interpreter class-translatedoInlining.st" adds the new classes to the
tranlated VM code if and only if OSProcess>>systemType = #unix.

6) Save your image, then repeat steps 2 and 3. You now have a new VM which
includes the pluggable primitives for Unix process access.

7) Restart your image. Try the examples in OSProcess class and UnixProcess
class.

	Sat Jun 19 14:09:57 EDT 1999 Dave Lewis
	lewis at mail.msen.com
	Linux dtlewis 2.0.35 #3 Fri Jan 1 17:22:57 EST 1999 i586 unknown


Attachment converted: Anon:OSProcessV0_2.zip (pZIP/pZIP) (0000ACF9)
Content-Type: application/x-tar-gz
Content-Disposition: attachment; filename="OSProcessV0_2.tar.gz"

Attachment converted: Anon:OSProcessV0_2.tar.gz (????/----) (0000ACFA)
Attachment converted: Anon:OS-Support.st (TEXT/MSIE) (0000ACFB)
Attachment converted: Anon:StandardFileStream-fileID.st (TEXT/MSIE) (0000ACFC)
Attachment converted: Anon:Interpreter class-translatedoIn 
(TEXT/MSIE) (0000ACFD) 





More information about the Squeak-dev mailing list