[comp.sys.next] How to run Common LISP on '040 machines?

mcdonald@fornax.UUCP (Ken Mcdonald) (03/19/91)

I have a need to make use of Common Lisp on the NeXT in the very near
future (i.e. I have a time frame of about three to four weeks in
which I want to hack together a prototype of a program on the NeXT.)
Sadly, the current version of Common LISP does not work with '040
processors, and even more sadly, every machine in sight at my
universitly seems to have done the '040 upgrade.  Question:  is there
any way to get Common Lisp functioning on these machines?

If someone can provide an appropriate patch, I'd very much appreciate it.
Alternatively, I've heard rumours that it is possible to put an '030
CPU board in with an '040, and get it working; if you can provide 
instructions, this is OK too.  Any and all other suggestions will be
most gratefully received.

Preferred method of response is via e-mail to "mcdonald@cs.sfu.ca".
Alternatively, post to this group, and I should get to it.  If
interest warrants, and I get enough e-mail replies, I will post
a summary.

Thanks in advance for all the help,
Ken McDonald
{mcdonald@cs.sfu.ca}
.

tenny@ootool.dec.com (Dave Tenny) (03/19/91)

In article <2311@fornax.UUCP>, mcdonald@fornax.UUCP (Ken Mcdonald) writes...
> 
> 
>I have a need to make use of Common Lisp on the NeXT in the very near
>future (i.e. I have a time frame of about three to four weeks in
>which I want to hack together a prototype of a program on the NeXT.)
>Sadly, the current version of Common LISP does not work with '040
>processors, and even more sadly, every machine in sight at my
>universitly seems to have done the '040 upgrade.  Question:  is there
>any way to get Common Lisp functioning on these machines?

There are no patches.  To run lisp on an 040, you need to get the ACL
upgrade from Franz, Inc.  I don't think they've shipped it yet, or plan
to until April.

Dave

garnett@cs.utexas.edu (John William Garnett) (03/20/91)

In article <1991Mar19.132422.27254@engage.enet.dec.com> tenny@ootool.dec.com (Dave Tenny) writes:
>
>In article <2311@fornax.UUCP>, mcdonald@fornax.UUCP (Ken Mcdonald) writes...
>> 
>> 
>>I have a need to make use of Common Lisp on the NeXT in the very near
>>future (i.e. I have a time frame of about three to four weeks in
>>which I want to hack together a prototype of a program on the NeXT.)
>>Sadly, the current version of Common LISP does not work with '040
>>processors, and even more sadly, every machine in sight at my
>>universitly seems to have done the '040 upgrade.  Question:  is there
>>any way to get Common Lisp functioning on these machines?
>
>There are no patches.  To run lisp on an 040, you need to get the ACL
>upgrade from Franz, Inc.  I don't think they've shipped it yet, or plan
>to until April.
>
>Dave


Perhaps it is time for a repost:


Article 13828 of comp.sys.next:
Path: cs.utexas.edu!sdd.hp.com!spool.mu.edu!snorkelwacker.mit.edu!shelby!agate!ziploc!eps
From: eps@toaster.SFSU.EDU (Eric P. Scott)
Newsgroups: comp.sys.next
Subject: Re: Lisp in 2.0
Message-ID: <1339@toaster.SFSU.EDU>
Date: 22 Feb 91 00:27:50 GMT
References: <1991Feb21.001055.5896@zip.eecs.umich.edu>
Reply-To: eps@cs.SFSU.EDU (Eric P. Scott)
Organization: San Francisco State University
Lines: 104

In article <1991Feb21.001055.5896@zip.eecs.umich.edu>
	telfeyan@zip.eecs.umich.edu (Roland Telfeyan) writes:
>    (2) [Important] What is the workaround for getting the 1.0
>version to work in 2.0?  In the upgrade manual it says that there
>is an alteration that can be done, but it says nothing more (p. 5).

Attached.
					-=EPS=-
-------
Franz Allegro Common Lisp 2.0 1.0

Q:  Why can't I use my 1.0 version of Franz Allegro Common Lisp
under 2.0?  Is there something I can do to make it work until an
update becomes available?

A:  The 1.0 release of Common Lisp does not work with Release 2.0
for several reasons:
	1. the Mach header of the .o files have some uninitialized
		fields
	2. the libNeXT and libdsp have some incompatibilities and
		cannot be used
	3. foreign loading doesn't quite work

(and perhaps other unknown things). The 1.0 version may be modified
to more or less work (i.e. no NeXTstep, no dsp, limited foreign
code interface) as follows.  THIS WILL ONLY WORK FOR 030 MACHINES!!!
There is no known fix for the 040 machines.

Make sure that the /usr/cl directory from 1.0 is backed up. Also
save the /usr/lib/emacs/lisp/fi directory if you like that sort of
thing.

After building a 2.0 system, re-install the /usr/cl directory.

Save the following program as fixlispheader.c:
=========================================================
#include <mach.h>
#include <sys/loader.h>
#include <sys/file.h>
#include <nlist.h>

/*
 * This fixes the mach header of /usr/cl/build/static.o for
 * release 2.0
 */

main(int argc, char *argv[])
{
	int fd;
	struct mach_header mh;
	struct nlist nl;

	fd = open("static.o", O_RDWR);
	read(fd, &mh, sizeof(mh));
	mh.cputype = CPU_TYPE_MC680x0;
	mh.cpusubtype = CPU_SUBTYPE_MC68030;
	lseek(fd, 0, L_SET);
	write(fd, &mh, sizeof(mh));

	lseek(fd, 1400832, L_SET);
	read(fd, &nl, sizeof(nl));
	nl.n_type = N_SECT | N_EXT;
	nl.n_sect = 1;
	lseek(fd, 1400832, L_SET);
	write(fd, &nl, sizeof(nl));
}
====================================================================

Compile this program: (i.e., "cc -o fixlispheader fixlispheader.c"),
then in a shell as root:

	# cd /usr/cl/build
	# fixlispheader

This will destructively modify the static.o file so that it works
with the 2.0 release.

Before doing a normal "config" operation to build the lisp image,
the config file must be modified to not link in libNeXT and libdsp.
Open /usr/cl/build/config and change line 679 from

	LDFLAGS = -lcrt0.o -u _NXEditorFilter -u _DSPAwaitData
to
	LDFLAGS = -lcrt0.o

Also change line 680 from

	LIBRARIES = -lNeXT_s -ldsp_s -lsys_s

to
	LIBRARIES = -lsys_s


After these modifications, run the configuration script as normal.

Dynamic foreign code loading is also broken: (load "foo.o") will
not work. The workaround is to build a custom image (using the
configuration script) with your code linked in. To do this, add
your .o files to the LIBRARIES macro mentioned above. For example:

	LIBRARIES = /me/foo.o -lsys_s


When running this image, use the lisp defforeign function as usual.


-- 
John Garnett
                              University of Texas at Austin
garnett@cs.utexas.edu         Department of Computer Science
                              Austin, Texas

layer@Franz.COM (Kevin Layer) (03/22/91)

I am happy to announce that Allegro Common Lisp for NeXT 2.0/2.1 with
either an 030 or 040 board is now released.  It is being distributed
on 8-1.44MB 3.5" micro floppy disks.

Contact Franz Inc. at (415) 548-3600 or info@franz.com for more
information.

--
Kevin Layer, Franz Inc.         1995 University Avenue, Suite 275
layer@Franz.COM (internet)      Berkeley, CA  94704
uunet!franz!layer (uucp)        Phone: (415) 548-3600; FAX: (415) 548-8253