diff --git a/.distr b/.distr index a79c62e38..d3cbdbbd6 100644 --- a/.distr +++ b/.distr @@ -1,4 +1,5 @@ README +CHANGES Copyright pm pmfile @@ -29,7 +30,7 @@ util/cmisc util/ack lib/descr/fe util/arch -util/cpp +#util/cpp util/cgg util/ncgg util/misc @@ -41,33 +42,14 @@ util/led lang/cem lang/pc lang/m2 -lang/occam -lang/basic +#lang/occam +#lang/basic mach/proto mach/i86 +mach/i386 plat/pc86 +plat/linux386 examples - -#Action -#NEW -#README -#TODO -#TakeAction -#bin -#doc -#emtest -#etc -#fast -#fcc -#first -#h -#include -#modules -#lang -#lib -#mach -#man -#util diff --git a/CHANGES b/CHANGES new file mode 100644 index 000000000..648fc49ce --- /dev/null +++ b/CHANGES @@ -0,0 +1,21 @@ +# $Source$ +# $State$ +# $Revision$ + +6.0pre2 + + Much simplified the syscall interface by disabling libmon and instead + calling the syscalls directly. Disabled the K&R C compiler and libc because + it doesn't actually gain us anything and has a high maintenance load --- the + ANSI C compiler works fine with K&R C. Adapted the rest of the system to + build with the ANSI C compiler. Rewrote the pc86 syscall interface and added + linux386 support, using the i386 code generator. Lots and lots of bugfixes + and tweaks everywhere. + +6.0pre1 + + First working version of the 6.0 release stream. Working frontends: both C + compilers, Pascal, Modula-2, Basic and Occam. Working backends: i86. Working + platforms: pc86, the very noddy testbed setup that produces floppy disk + images. + \ No newline at end of file diff --git a/README b/README index 8781d39be..d07635fd8 100644 --- a/README +++ b/README @@ -2,11 +2,11 @@ # $State$ # $Revision$ - THE AMSTERDAM COMPILER KIT V6.0pre1 + THE AMSTERDAM COMPILER KIT V6.0pre2 =================================== © 1987-2005 Vrije Universiteit, Amsterdam - 2007-02-25 + 2007-04-24 INTRODUCTION @@ -28,11 +28,12 @@ SUPPORT Languages: -ANSI C, K&R C, Pascal, Modula 2, Occam 1, and a Basic variant. +ANSI C, Pascal, Modula 2. K&R is supported via the ANSI C compiler. Platforms: pc86 produces bootable floppy disk images for 8086 PCs +linux386 produces ELF executables for PC Linux systems INSTALLATION @@ -114,6 +115,9 @@ For further information, see the man page (which actually does get installed, but is rather out of date). There are some (known working) example programs in the 'examples' directory. +A sample command line is: + +ack -mlinux386 -O examples/paranoia.c GOTCHAS @@ -121,16 +125,11 @@ GOTCHAS There are some things you should be aware of. -- The only platform supported so far is pc86, which generates 8086 tiny mode - executables that will work as floppy disk boot images. So, to run, simply dd - the output file (pc86.img by default) onto a floppy disk and boot from it. - Be aware that very little functionality is supported and that the entire - program, heap and stack and code and all, must fit within 64kB. See - plat/pc86/README for more information. +- Look at plat/linux386/README and plat/pc86/README for information about the + two supported platforms. -- By default, the ack tool will compile K&R C. Practically all C source these - days is ANSI C --- use the -ansi switch to enable ANSI mode. No, the ACK is - not C99 compatible. +- The library support is fairly limited; for C, it's at roughly the ANSI C + level, and for the other languages it's similar. - When compiling languages other than C, the ACK will usually look at the first character of the file. If it's a #, then the file will be run through @@ -167,4 +166,4 @@ Please enjoy. David Given (dtrg on Sourceforge) dg@cowlark.com -2007-02-25 +2007-04-24 diff --git a/examples/.distr b/examples/.distr index 74f4a71b6..8aaa2deab 100644 --- a/examples/.distr +++ b/examples/.distr @@ -4,4 +4,6 @@ hilo.mod hilo.ocm hilo.p paranoia.c +startrek.c +startrek.doc README diff --git a/lang/cem/.distr b/lang/cem/.distr index abc892c53..b4ca36155 100644 --- a/lang/cem/.distr +++ b/lang/cem/.distr @@ -2,5 +2,5 @@ pmfile cemcom.ansi cpp.ansi libcc.ansi -cemcom -libcc +#cemcom +#libcc diff --git a/lang/cem/libcc.ansi/headers/.distr b/lang/cem/libcc.ansi/headers/.distr index ba343e2df..e06898894 100644 --- a/lang/cem/libcc.ansi/headers/.distr +++ b/lang/cem/libcc.ansi/headers/.distr @@ -1,13 +1,11 @@ +sys/time.h +sys/ioctl.h assert.h ctype.h -dirent.h errno.h float.h -grp.h limits.h -locale.h math.h -mathconst.h setjmp.h signal.h stdarg.h @@ -16,6 +14,9 @@ stdio.h stdlib.h string.h time.h -varargs.h -sys/dirent.h -sys/errno.h +iso646.h +stdbool.h +fcntl.h +tgmath.h +locale.h +stdint.h diff --git a/lang/cem/libcc.ansi/misc/.distr b/lang/cem/libcc.ansi/misc/.distr index ed0771ead..db3c72199 100644 --- a/lang/cem/libcc.ansi/misc/.distr +++ b/lang/cem/libcc.ansi/misc/.distr @@ -1,22 +1 @@ -closedir.c -fdopen.c -getdents.c -getgrent.c -getopt.c -getpass.c -getpw.c -getw.c -isatty.c -opendir.c -popen.c -putenv.c environ.c -putw.c -readdir.c -rewinddir.c -seekdir.c -sleep.c -telldir.c -termcap.c -mktemp.c -hypot.c diff --git a/lang/cem/libcc.ansi/pmfile b/lang/cem/libcc.ansi/pmfile index 672c6cd82..2431689e7 100644 --- a/lang/cem/libcc.ansi/pmfile +++ b/lang/cem/libcc.ansi/pmfile @@ -269,26 +269,26 @@ local libc = acklibrary { local headers = group { install = { - pm.install(d.."headers/sys/time.h", "%BINDIR%include/ansi/sys/time.h"), + pm.install(d.."headers/sys/time.h", "%BINDIR%include/ansi/sys/time.h"), pm.install(d.."headers/sys/ioctl.h", "%BINDIR%include/ansi/sys/ioctl.h"), - pm.install(d.."headers/assert.h", "%BINDIR%include/ansi/assert.h"), - pm.install(d.."headers/ctype.h", "%BINDIR%include/ansi/ctype.h"), --- pm.install(d.."headers/dirent.h", "%BINDIR%include/ansi/dirent.h"), - pm.install(d.."headers/errno.h", "%BINDIR%include/ansi/errno.h"), - pm.install(d.."headers/float.h", "%BINDIR%include/ansi/float.h"), --- pm.install(d.."headers/grp.h", "%BINDIR%include/ansi/grp.h"), - pm.install(d.."headers/limits.h", "%BINDIR%include/ansi/limits.h"), --- pm.install(d.."headers/locale.h", "%BINDIR%include/ansi/locale.h"), - pm.install(d.."headers/math.h", "%BINDIR%include/ansi/math.h"), --- pm.install(d.."headers/mathconst.h", "%BINDIR%include/ansi/mathconst.h"), - pm.install(d.."headers/setjmp.h", "%BINDIR%include/ansi/setjmp.h"), - pm.install(d.."headers/signal.h", "%BINDIR%include/ansi/signal.h"), - pm.install(d.."headers/stdarg.h", "%BINDIR%include/ansi/stdarg.h"), - pm.install(d.."headers/stddef.h", "%BINDIR%include/ansi/stddef.h"), - pm.install(d.."headers/stdio.h", "%BINDIR%include/ansi/stdio.h"), - pm.install(d.."headers/stdlib.h", "%BINDIR%include/ansi/stdlib.h"), - pm.install(d.."headers/string.h", "%BINDIR%include/ansi/string.h"), - pm.install(d.."headers/time.h", "%BINDIR%include/ansi/time.h"), + pm.install(d.."headers/assert.h", "%BINDIR%include/ansi/assert.h"), + pm.install(d.."headers/ctype.h", "%BINDIR%include/ansi/ctype.h"), + pm.install(d.."headers/errno.h", "%BINDIR%include/ansi/errno.h"), + pm.install(d.."headers/float.h", "%BINDIR%include/ansi/float.h"), + pm.install(d.."headers/limits.h", "%BINDIR%include/ansi/limits.h"), + pm.install(d.."headers/math.h", "%BINDIR%include/ansi/math.h"), + pm.install(d.."headers/setjmp.h", "%BINDIR%include/ansi/setjmp.h"), + pm.install(d.."headers/signal.h", "%BINDIR%include/ansi/signal.h"), + pm.install(d.."headers/stdarg.h", "%BINDIR%include/ansi/stdarg.h"), + pm.install(d.."headers/stddef.h", "%BINDIR%include/ansi/stddef.h"), + pm.install(d.."headers/stdio.h", "%BINDIR%include/ansi/stdio.h"), + pm.install(d.."headers/stdlib.h", "%BINDIR%include/ansi/stdlib.h"), + pm.install(d.."headers/string.h", "%BINDIR%include/ansi/string.h"), + pm.install(d.."headers/time.h", "%BINDIR%include/ansi/time.h"), + pm.install(d.."headers/iso646.h", "%BINDIR%include/ansi/iso646.h"), + pm.install(d.."headers/stdbool.h", "%BINDIR%include/ansi/stdbool.h"), + pm.install(d.."headers/locale.h", "%BINDIR%include/ansi/locale.h"), + pm.install(d.."headers/tgmath.h", "%BINDIR%include/ansi/tgmath.h"), } } diff --git a/lang/cem/libcc.ansi/setjmp/.distr b/lang/cem/libcc.ansi/setjmp/.distr index 63685a130..305ef0b22 100644 --- a/lang/cem/libcc.ansi/setjmp/.distr +++ b/lang/cem/libcc.ansi/setjmp/.distr @@ -1,2 +1 @@ setjmp.e -sigmisc.c diff --git a/lang/cem/libcc.ansi/stdio/.distr b/lang/cem/libcc.ansi/stdio/.distr index 927255d92..5ad14e146 100644 --- a/lang/cem/libcc.ansi/stdio/.distr +++ b/lang/cem/libcc.ansi/stdio/.distr @@ -29,15 +29,12 @@ getc.c getchar.c gets.c icompute.c -isatty.c loc_incl.h perror.c printf.c putc.c putchar.c puts.c -remove.c -rename.c rewind.c scanf.c setbuf.c diff --git a/lang/cem/pmfile b/lang/cem/pmfile index ff7212b82..ca8eacd21 100644 --- a/lang/cem/pmfile +++ b/lang/cem/pmfile @@ -3,7 +3,7 @@ local d = ROOTDIR.."lang/cem/" -include (d.."cemcom/pmfile") +-- include (d.."cemcom/pmfile") include (d.."cemcom.ansi/pmfile") -include (d.."libcc/pmfile") +-- include (d.."libcc/pmfile") include (d.."libcc.ansi/pmfile") diff --git a/mach/i386/.distr b/mach/i386/.distr index b2c838b24..86584ff3c 100644 --- a/mach/i386/.distr +++ b/mach/i386/.distr @@ -1,11 +1,5 @@ -Action +pmfile as -ce -cv -libend -libem -libfp -libsys -libdb ncg -mach_params +libem +libend diff --git a/mach/i386/libem/.distr b/mach/i386/libem/.distr index d2b4f2884..670d9e145 100644 --- a/mach/i386/libem/.distr +++ b/mach/i386/libem/.distr @@ -1,2 +1,45 @@ -LIST -libem_s.a +pmfile +adi.s +and.s +blm.s +cii.s +cms.s +com.s +csa4.s +csb4.s +cuu.s +dup.s +dvi.s +dvu.s +error.s +exg.s +fat.s +fp8087.s +gto.s +iaar.s +ilar.s +inn.s +ior.s +isar.s +lar4.s +loi.s +mli.s +mon.s +ngi.s +nop.s +print.s +rck.s +rmi.s +rmu.s +rol.s +ror.s +sar4.s +sbi.s +set.s +sli.s +sri.s +sti.s +strhp.s +trp.s +unknown.s +xor.s diff --git a/mach/i386/libend/.distr b/mach/i386/libend/.distr index b48ec8483..1508ebdc7 100644 --- a/mach/i386/libend/.distr +++ b/mach/i386/libend/.distr @@ -1,2 +1,5 @@ -LIST -end_s.a +pmfile +edata.s +em_end.s +end.s +etext.s diff --git a/plat/linux386/.distr b/plat/linux386/.distr index 98965493d..da4420e2f 100644 --- a/plat/linux386/.distr +++ b/plat/linux386/.distr @@ -2,13 +2,25 @@ descr boot.s pmfile README +include/ack/config.h +include/unistd.h libsys/pmfile -libsys/libsys.h -libsys/_sys_rawwrite.s -libsys/_mon.s -libsys/_sys_write.c -libsys/_sys_read.c -libsys/_sys_rawread.s -libsys/_brk.s +libsys/_exit.c +libsys/_hol0.s +libsys/_syscall.s +libsys/brk.c +libsys/close.c +libsys/creat.c libsys/errno.s -libsys/_sys_ioctl.c +libsys/getpid.c +libsys/gettimeofday.c +libsys/isatty.c +libsys/kill.c +libsys/libsys.h +libsys/lseek.c +libsys/open.c +libsys/read.c +libsys/sbrk.c +libsys/signal.c +libsys/syscalls.h +libsys/write.c diff --git a/plat/pc86/.distr b/plat/pc86/.distr index 98965493d..9bcdd612a 100644 --- a/plat/pc86/.distr +++ b/plat/pc86/.distr @@ -2,13 +2,23 @@ descr boot.s pmfile README +include/ack/config.h +include/unistd.h libsys/pmfile -libsys/libsys.h -libsys/_sys_rawwrite.s -libsys/_mon.s -libsys/_sys_write.c -libsys/_sys_read.c -libsys/_sys_rawread.s -libsys/_brk.s +libsys/_hol0.s +libsys/brk.c +libsys/close.c +libsys/creat.c libsys/errno.s -libsys/_sys_ioctl.c +libsys/getpid.c +libsys/isatty.c +libsys/kill.c +libsys/libsys.h +libsys/lseek.c +libsys/open.c +libsys/read.c +libsys/signal.c +libsys/time.c +libsys/write.c +libsys/_sys_rawread.s +libsys/_sys_rawwrite.s diff --git a/plat/pc86/libsys/_sys_ioctl.c b/plat/pc86/libsys/_sys_ioctl.c deleted file mode 100644 index 237ace7dc..000000000 --- a/plat/pc86/libsys/_sys_ioctl.c +++ /dev/null @@ -1,56 +0,0 @@ -/* $Source$ - * $State$ - */ - -#include -#include -#include -#include "libsys.h" - -int _sys_ttyflags = ECHO; - -extern struct -{ - int fd; - int request; - void* argp; -} _sys_params_in; - -extern struct -{ - int result; -} _sys_params_out; - -#define P _sys_params_in - -static int tiocgetp(void) -{ - struct sgttyb* s = P.argp; - s->sg_flags = _sys_ttyflags; - return 0; -} - -static int tiocsetp(void) -{ - struct sgttyb* s = P.argp; - _sys_ttyflags = s->sg_flags; - return 0; -} - -int _sys_ioctl(void) -{ - switch (P.request) - { - case TIOCGETP: - _sys_params_out.result = tiocgetp(); - return 0; - - case TIOCSETP: - _sys_params_out.result = tiocsetp(); - return 0; - } - - _sys_params_out.result = -1; - errno = EINVAL; - return 0; -} diff --git a/plat/pc86/libsys/pmfile b/plat/pc86/libsys/pmfile index b144d03f8..99a4ee85b 100644 --- a/plat/pc86/libsys/pmfile +++ b/plat/pc86/libsys/pmfile @@ -17,7 +17,6 @@ libsys_pc86 = acklibrary { ackfile (d.."close.c"), ackfile (d.."read.c"), ackfile (d.."write.c"), --- ackfile (d.."_sys_ioctl.c"), ackfile (d.."brk.c"), ackfile (d.."getpid.c"), ackfile (d.."kill.c"), diff --git a/pmfile b/pmfile index d2667c4ca..2a476674d 100644 --- a/pmfile +++ b/pmfile @@ -38,7 +38,7 @@ include "util/amisc/pmfile" include "util/cmisc/pmfile" include "util/ack/pmfile" include "util/arch/pmfile" -include "util/cpp/pmfile" +-- include "util/cpp/pmfile" include "lang/cem/cpp.ansi/pmfile" include "util/cgg/pmfile" include "util/ncgg/pmfile" @@ -52,8 +52,8 @@ include "util/led/pmfile" include "lang/cem/pmfile" include "lang/pc/pmfile" include "lang/m2/pmfile" -include "lang/occam/pmfile" -include "lang/basic/pmfile" +-- include "lang/occam/pmfile" +-- include "lang/basic/pmfile" include "mach/proto/pmfile" diff --git a/util/amisc/.distr b/util/amisc/.distr index 29a375aaa..3cbc22a7d 100644 --- a/util/amisc/.distr +++ b/util/amisc/.distr @@ -1,10 +1,13 @@ pmfile -anm.c -asize.c -astrip.c ashow.c +ashow.1 +anm.c anm.1 +asize.c asize.1 +astrip.c astrip.1 aslod.c aslod.1 +aelflod.c +aelflod.1 \ No newline at end of file