From: Nhut Nguyen
Subject: AKCL 1-6.24 and Linux 1.0: errors
Date: 
Message-ID: <nnhut.765988276@bcarh791>
Hello world:

I tried  to build the newest version of akcl, which has Linux
support, on Linux 1.0 (Slackware 1.2). The first pass went OK
(after  removing some redundant type defs.) until the loading
of the system. I got 

./raw_kcl ../unixport/
KCl (Kyoto Common Lisp)  June 1987  16384 pages
loading ../lsp/export.lsp
free(3) error.
Lisp initialization failed.

Has anyone built akcl succesfully on Linux 1.0? Any plug will
be appreciated.

Cheers,
--
Nhut Nguyen              InterNet:  ·····@bnr.ca | My 0.02$ + GST + PST
BNR Ltd., Ottawa, Canada                         | Opinions are mine.
From: Reginald S. Perry
Subject: Re: AKCL 1-6.24 and Linux 1.0: errors
Date: 
Message-ID: <REGGIE.94Apr10150301@miles.muon.phys.washington.edu>
In article <···············@bcarh791> ·····@bnr.ca (Nhut Nguyen) writes:
> 
> Has anyone built akcl succesfully on Linux 1.0? Any plug will
> be appreciated.
> 
	Hi there. I have successfuly built it. I will include the two
files you need which are h/386-linux.{defs,h}. I think the defs is the
same and the h file is greatly changed. My only problem is that I cant
properly define LISTEN_FOR_INPUT which is needed for CLX. I am sure
that I did not do it correctly, but I do not understand the POSIX
stuff well enough yet to know the proper replacement for the FIONREAD
ioctl. Any help would be greatly appreciated.

-Reggie

------------------------/usr/local/akcl/h/386-linux.h--------------
#define BSD386
#include "bsd.h"
/* #include "386.h" */
#undef HAVE_SIGVEC
#undef RUN_PROCESS

#define ADDITIONAL_FEATURES \
		     ADD_FEATURE("BSD386"); \
      	     ADD_FEATURE("MC68020")


#define	I386
#define	IEEEFLOAT
       

#undef HAVE_XDR

#ifdef IN_UNIXSAVE
#include <linux/user.h> 
#endif


#define USE_ATT_TIME

/* fix this later.   How to check for input */
#undef LISTEN_FOR_INPUT
#if 1				/* Required for CLX to work correctly  */
#if defined IN_FILE
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <stdio.h>
#endif
#define FIOREADN _IOR('f', 127, int)  /* This is really FIONREAD */
#define LISTEN_FOR_INPUT(fp) \
  if(((fp)->_IO_read_ptr >= (fp)->_IO_read_end) && (c=0,ioctl((fp)->_fileno, FIOREADN, &c),c<=0)) \
     return 0

#endif
/* end listen for input */

/* we dont need to worry about zeroing fp->_base , to prevent  */
#define FCLOSE_SETBUF_OK 

/* #define DATA_BEGIN((TXTRELOC+header.a_text+(SEGSIZ-1)) & ~(SEGSIZ-1)); */
#define DATA_BEGIN (char *)(char *)N_DATADDR(header);

/*
#undef   FILECPY_HEADER
#define FILECPY_HEADER \
	if (header.a_magic == ZMAGIC) \
		filecpy(save, original, PAGSIZ - sizeof(header)); \
	filecpy(save, original, header.a_text);
*/

#define RELOC_FILE "rel_sun3.c"



#define LITTLE_ENDIAN

#define	PAGSIZ		(NBPG)
#define	SEGSIZ		(NBPG * CLSIZE)
#define	TXTRELOC	0

#define USE_DIRENT
#define GETPATHNAME
#define PATHNAME_CACHE	30


/* try out the gnu malloc */
#if 1				/* (conflict with PAGEWIDTH != 11) */
#define GNU_MALLOC		/* works if PAGEWIDTH==11 */
#define GNUMALLOC
#endif

#define INSTALL_SEGMENTATION_CATCHER \
  	 (void) signal(SIGSEGV,segmentation_catcher)
#undef  SIGBUS
#define SIGBUS SIGSEGV
#define SIGSYS SIGSEGV
#define SIGEMT SIGSEGV

#define WANT_SGC

#ifdef WANT_SGC			/* begin defines for SGC */
/*
  SGC is a performance winner for large applications as it doesn't
  run the entire image through the pager during collection. SGC requires
  the 'mprotect' function.

  Need Jeffrey Hsu's kernel patch for signal handlers.  Should be in
FreeBSD versions later than 1.0.2.

  Also need to add
#include <sys/types.h> before
#include <sys/mman.h> in c/sgc.c

  Also - the above handler conflicts with use of '(un)catch-bad-signals'
  You may want to modify unixint.c to account for SGC use.

*/
#define SGC
#define SIGPROTV SIGBUS
#endif				/* end of SGC mods */

/* #define SIGPROTV SIGBUS */
/* In my implementation I have put the address in code
   Doubtless this will change in Xinu code.
   
 */
#define GET_FAULT_ADDR(sig,code,sv,a) ((char *) code)


/* get the fileno of a FILE* */
#define FILENO(x) fileno(x)

#define ULONG_DEFINED
#define NO_PROFILE

#define UNIXSAVE "unexlin.c"

#undef LD_COMMAND
#define LD_COMMAND(command,main,start,input,ldarg,output) \
  sprintf(command, "ld -d -S -N -x -A %s -T %x %s %s -o %s", \
            main,start,input,ldarg,output)

/* Begin for cmpinclude */
/* yes we have alloca */
#define HAVE_ALLOCA



/* _setjmp and _longjmp exist on bsd and are more efficient
   and handle the C stack which is all we need. [I think!]
   
 */


/* End for cmpinclude */



------------------------/usr/local/akcl/h/386-linux.defs--------------

# Machine dependent makefile definitions for intel 386,486 running 386bsd

LBINDIR=/usr/local/bin

OFLAG	=  -O2 
LIBS	= -lm 
ODIR_DEBUG= -g

# This CC string will be used for compilation of the system,
# and also in the compiler::*cc* variable for later compilation of
# lisp files.

CC = gcc -fwritable-strings  -DVOL=volatile -I$(AKCLDIR)/o 
MAINDIR = /usr/local/kcl

# Enable the fastloading mechanism which does not use ld -A
# requires c/rel_.. machine dependent code.

RSYM	= rsym
SFASL	= $(ODIR)/sfasl.o

#  Use the mp.s file on 68k machine 

# new gcc doesn't make a good .s file using optimisations.
# so either use $(MPDIR)/mpi.o   $(MPDIR)/libmport.a
#MPFILES= $(MPDIR)/mpi-386.o   $(MPDIR)/libmport.a

MPFILES= $(MPDIR)/mpi-386d.o   $(MPDIR)/libmport.a


# When using SFASL it is good to have (si::build-symbol-table)
INITFORM=(si::build-symbol-table)

# Use symbolic links
SYMB=-s

LIBFILES=bsearch.o

# the  make to use for saved_kcp the profiler.
KCP=kcp-bsd

# dont add the .data 
CAT=true


--
-------------------
Reginald S. Perry -- University of Washington, Department of Physics FM-15
                     Seattle, Washington 98195
······@miles.phys.washington.edu     (Personal-Mail) 
······@u.washington.edu             (General-Mail)