Serial Port access from Squeak

Todd Coram tcoram at BLaCKSMITH.com
Tue Jan 13 19:02:58 UTC 1998



Andreas Raab wrote:

> > Does the DC20 come with any kind of device driver?  My feeling is that a
> > cleaner implementation would involve some kind of driver written in a
> > language like C or C++ which does the communication with the serial port
> > (including polling and interrupt handling) and provides an API for Squeak to
> > talk to at a higher level.
>
> Depends. Most of the serial devices have fairly simple interfaces and a
> well written serial device interface can cover much of it. Also, writing
> the driver in C requires hacking the VM and some people don't feel
> experienced enough for this or (like me) just prefer a Smalltalk
> implementation.

This is why I was hoping to find a simple serial device method available from
Squeak (something along the lines of unix's ioctl() but nicer). Besides, I want to
keep the code as Squeakish as possible (more platform independent smalltalk than
C)...

I haven't looked at Squeak's Socket classes yet...
Is there enough support in Squeak's Socket classes to "simulate" the Serial
primitives?

Originally I was going to develop some Serial classes in Squeak and use Sockets
(connecting to a very low level Serial Port server in C) to get the camera up and
running.  Then, one day (soon), some kind hacker (or myself) would add true native
primitive support for serial devices (ala ioctl() but nicer) into the VM.  (This
is still MUCH simpler than hacking interrupt driven I/O capabilities into the
VM).  The Serial classes developed over top of Sockets should survive the
migration to the new primitives. Plus, you get "remote Serial device" support to
boot ;-)

--
Todd Coram (Maroc Ddot)
tcoram at BLaCKSMITH.com | tcoram at pobox.com

Sardonic slaughterer of sacred cows.





More information about the Squeak-dev mailing list