[ENH] Lazy display initialization (was: running headless on Unix)

David T. Lewis lewis at mail.msen.com
Mon Nov 15 22:08:37 UTC 1999


--9jxsPFA5p3P2qPhR
Content-Type: text/plain; charset=us-ascii


Well, I'm not the "VM team", but I couldn't think of any good reason not
to do this, so here it is.

On Sun, Nov 14, 1999 at 07:48:38PM -0800, Tim Rowledge wrote:
> On Fri 12 Nov, Bert Freudenberg wrote:
> > AFAIK there is no Unix VM yet that can be run both headless and with a
> > window connection. With Dave's VM process changes it should be fairly
> > straight forward to make one that provides a "-headless" option (as the
> > Windows VM does).
> 
> A long time ago I tried to persuade the VM team to adopt the technique
> I use on the Acorn VM - the window is not created and opened until the
> first use of the beDisplay primitive. Thus you can trivially have a
> headless system just by making sure your image doesn't do that until and
> unless it needs to. If you want a really headless system, you can quite
> simply make sure that debug stuff is done some other way than opening a
> notifier; maybe by sending a message down a socket to a remote debugger
> (oh no, I mentioned sockets....) or whatever. The VM stays the same with
> no need to have two versions. One of the problems is that many GUIs have
> a requirement that you have a window in order to have a window handle in
> order to get events. I suspect there are many ways around this problem.
>

This sounds like a good, simple approach. If I understand
your suggestion, the requirements are:

1) In Intepreter>>primitiveBeDisplay, add a single call to a
function which would cause the physical display to be opened.
This could be, for example:
	self openPhysicalDisplayFor: rcvr.

2) Elsewhere in the support code, for each supported
platform, implement a function:
	int openPhysicalDisplayFor(int displayOop).
For platforms which do not need or want to be able to run
headless, this is a no-op.

3) At the leisure of the various VM implementers, update the
support code (sqXWindow.c in the case of unix) to take
advantage of openPhysicalDisplayFor().

Steps 1 and 2 are trivial but require a bit of coordination,
and step 3 can be done whenever folks get around to it.

Attached is the change set for step 1. I tested steps 2
and 3 on a Linux system and it worked fine after a few
small rearrangements in the system startup methods (also
included in the change set).

- Dave


--9jxsPFA5p3P2qPhR
Content-Type: text/plain; name="LazyDisplayInit.15Nov515pm.cs"
 ; x-mac-type="54455854"
 ; x-mac-creator="522A6368"
Content-Disposition: attachment; filename="LazyDisplayInit.15Nov515pm.cs"
Content-Transfer-Encoding: imap_stub

0,1206,2,3479,86,

--9jxsPFA5p3P2qPhR--





More information about the Squeak-dev mailing list