diff -Nurd linux86.old/Changes linux86/Changes --- linux86.old/Changes Wed Dec 4 21:19:01 2002 +++ linux86/Changes Wed Jan 29 20:07:36 2003 @@ -1,5 +1,9 @@ For version 0.16.*. +> Hitting bcc.c again, bcc-cpp now the default. + +> Some bugfixes for DEC Alpha -- 64 bit longs! + > The fopen function (and friends) is now a real function not a macro. > Ctype.h updated to ansi. diff -Nurd linux86.old/Makefile linux86/Makefile --- linux86.old/Makefile Fri Aug 30 19:26:47 2002 +++ linux86/Makefile Wed Jan 29 19:44:34 2003 @@ -2,7 +2,7 @@ # This file is part of the Linux-8086 Development environment and is # distributed under the GNU General Public License. -VERSION=0.16.10 +VERSION=0.16.11 TARGETS= \ clean bcc unproto copt as86 ld86 elksemu \ diff -Nurd linux86.old/as/genobj.c linux86/as/genobj.c --- linux86.old/as/genobj.c Sat Jun 23 20:04:08 2001 +++ linux86/as/genobj.c Tue Jan 28 21:45:27 2003 @@ -634,7 +634,7 @@ char buf[sizeof offset]; u4c4(buf, offset); - writeobj(buf, sizeof buf); + writeobj(buf, 4); } /* write sized offset to object code buffer assuming ... */ diff -Nurd linux86.old/as/keywords.c linux86/as/keywords.c --- linux86.old/as/keywords.c Wed Jun 27 17:08:22 2001 +++ linux86/as/keywords.c Tue Jan 7 08:31:23 2003 @@ -621,6 +621,7 @@ 3, 'L', 'T', 'R', GROUP6, 0x18, 5, 'M', 'O', 'V', 'S', 'X', MOVX, 0xBE, 5, 'M', 'O', 'V', 'Z', 'X', MOVX, 0xB6, + 5, 'R', 'D', 'M', 'S', 'R', INHER, 0x32, 4, 'S', 'E', 'T', 'A', SETCC, 0x97, 5, 'S', 'E', 'T', 'A', 'E', SETCC, 0x93, 4, 'S', 'E', 'T', 'B', SETCC, 0x92, @@ -661,6 +662,7 @@ 4, 'V', 'E', 'R', 'R', GROUP6, 0x20, 4, 'V', 'E', 'R', 'W', GROUP6, 0x28, 6, 'W', 'B', 'I', 'N', 'V', 'D', INHER, 0x09, + 5, 'W', 'R', 'M', 'S', 'R', INHER, 0x30, 4, 'X', 'A', 'D', 'D', ExGx, 0xC0, #endif /* I80386 */ diff -Nurd linux86.old/as/table.c linux86/as/table.c --- linux86.old/as/table.c Wed Jun 27 16:31:42 2001 +++ linux86/as/table.c Tue Jan 28 23:48:15 2003 @@ -129,7 +129,7 @@ hashval ^= hconv(nameptr[-1]); } else - hashval = hconv(nameptr[-(length / 2)]) * MULTIPLIER, + hashval = hconv(symname[length-(length / 2)]) * MULTIPLIER, hashval ^= hconv(nameptr[-2]) << 2, hashval ^= hconv(nameptr[-1]); nameptr = symname; diff -Nurd linux86.old/as/typeconv.c linux86/as/typeconv.c --- linux86.old/as/typeconv.c Sat Jun 23 19:55:32 2001 +++ linux86/as/typeconv.c Tue Jan 28 21:39:40 2003 @@ -13,7 +13,9 @@ void xxerr P((char *)); void xxerr(x) char * x; { write(2, x, strlen(x)); } +#ifdef __AS386_16__ static int no_swap = 1; +#endif static int long_off[4] = {0,1,2,3}; static int int_off[2] = {0,1}; @@ -23,7 +25,9 @@ bool_pt long_big_endian; { int i; +#ifdef __AS386_16__ no_swap = (!big_endian && !long_big_endian); +#endif for(i=0; i<4; i++) long_off[i] = i; for(i=0; i<2; i++) int_off[i] = i; diff -Nurd linux86.old/bcc/bcc.c linux86/bcc/bcc.c --- linux86.old/bcc/bcc.c Mon Aug 19 10:20:59 2002 +++ linux86/bcc/bcc.c Thu Dec 5 08:34:34 2002 @@ -42,7 +42,7 @@ #define F_OK 0 /* Test for existence. */ #define L_TREE 1 /* Use different tree style */ #define DEFARCH 0 /* Default to 8086 code */ -#define VERSION "MSDOS Compile" +#include "version.h" #else #define EXESUF #endif @@ -226,7 +226,8 @@ /* C source */ if (do_preproc && next_file->filetype == 'c') run_preproc(next_file); - if (do_unproto && next_file->filetype == 'i') run_unproto(next_file); + if (do_unproto && do_compile && next_file->filetype == 'i') + run_unproto(next_file); if (do_compile && next_file->filetype == 'i') run_compile(next_file); if (do_optim && next_file->filetype == 's') run_optim(next_file); if (do_as && next_file->filetype == 's') run_as(next_file); @@ -257,18 +258,26 @@ run_aspreproc(file) struct file_list * file; { - if (opt_arch<5) command.cmd = CPPBCC; - else command.cmd = CPP; + static char * cc1bcc = CC1BCC; + + if (opt_arch<5) { + if (opt_e) + command.cmd = cc1bcc; + else { + command.cmd = CPPBCC; + command.altcmd = cc1bcc; + } + } else + command.cmd = CPP; command_reset(); - newfilename(file, !do_as, 's', (opt_arch<5)); - if (opt_arch<5) + newfilename(file, (!do_as && !do_optim), (do_compile?'s':'i'), (opt_arch<5)); + if (opt_arch<5 && command.cmd == cc1bcc) command_opt("-E"); + else if (opt_arch<5 && do_unproto) + command_opt("-A"); command_opts('p'); command_opt("-D__ASSEMBLER__"); -#if 0 - if (!opt_I) - command_opt(default_include); -#endif + command_arch(); run_command(file); } @@ -277,30 +286,42 @@ run_preproc(file) struct file_list * file; { - int last_stage = 0;; + int last_stage = 0; + int combined_cpp; + static char * cc1bcc = CC1BCC; - if (opt_arch<5 && !opt_e) - command.cmd = CC1BCC; - else if (opt_arch<5) { - command.cmd = CPPBCC; - command.altcmd = CC1BCC; - } - else + if (opt_arch<5) { + if (opt_e) + command.cmd = cc1bcc; + else { + command.cmd = CPPBCC; + command.altcmd = cc1bcc; + } + } else command.cmd = CPP; command_reset(); - if (!opt_e && !do_optim && !do_as ) last_stage =1; - if (opt_e && !do_unproto && !do_compile ) last_stage =1; + combined_cpp = (command.cmd == cc1bcc && + opt_arch != 3 && + opt_e < 2 && + !do_unproto && + do_compile); - newfilename(file, last_stage, (opt_e?'i':'s'), (opt_arch<5)); + if (combined_cpp && !do_optim && !do_as ) last_stage =1; + if (!combined_cpp && !do_unproto && !do_compile ) last_stage =1; - if (opt_e && opt_arch<5) { - command_opt("-E"); - if (do_unproto) command_opt("-A"); + newfilename(file, last_stage, (combined_cpp?'s':'i'), (opt_arch<5)); + + if (!combined_cpp && opt_arch<5) { + if (command.cmd == cc1bcc) + command_opt("-E"); + else if (do_unproto) + command_opt("-A"); } command_opts('p'); - if (!opt_e) + command_opts('C'); + if (combined_cpp) { if (opt_arch<5 && !do_as) command_opt("-t"); @@ -341,6 +362,7 @@ command_opt("-t"); command_opts('c'); + command_opts('C'); command_arch(); @@ -501,9 +523,13 @@ case 'o': /* output file name */ break; } - if (err) - fprintf(stderr, "warning: linker option %s not recognised.\n", option); - else if (!do_link) + if (err) { + if (do_link) + fprintf(stderr, "warning: unknown option %s passed to linker.\n", + option); + else + fprintf(stderr, "warning: option %s not recognised.\n", option); + } else if (!do_link) fprintf(stderr, "warning: linker option %s unused.\n", option); } @@ -539,6 +565,7 @@ #endif char buf[MAXPATHLEN]; char ** prefix; + char * saved_cmd; if (command.arglist) { @@ -561,6 +588,7 @@ /* Search for the exe, nb as this will probably be called from 'make' * there's not much point saving this. */ + saved_cmd = command.cmd; for(;;) { for(prefix=exec_prefixs; *prefix; prefix++) @@ -590,10 +618,13 @@ } if (command.fullpath || !command.altcmd) break; command.cmd = command.altcmd; + command.altcmd = 0; } - if (!command.fullpath) + if (!command.fullpath) { + command.cmd = saved_cmd; command.fullpath = copystr(command.cmd); + } command.altcmd = 0; } @@ -895,9 +926,6 @@ if (exe_count && file_count != 1 && !do_link) fatal("only one input file for each non-linked output"); - opt_e = !opt_e; - if (do_unproto || !do_compile) opt_e = 1; - add_prefix(getenv("BCC_EXEC_PREFIX")); #ifdef MC6809 @@ -920,20 +948,14 @@ case 'f': /* Fast Call Elks */ prepend_option("-D__unix__", 'p'); prepend_option("-D__ELKS__", 'p'); - append_option("-c", 'p'); - append_option("-f", 'p'); - if (opt_e) { - append_option("-c", 'c'); - append_option("-f", 'c'); - } + append_option("-c", 'C'); + append_option("-f", 'C'); libc="-lc_f"; break; case 'c': /* Caller saves Elks */ prepend_option("-D__unix__", 'p'); prepend_option("-D__ELKS__", 'p'); - append_option("-c", 'p'); - if (opt_e) - append_option("-c", 'c'); + append_option("-c", 'C'); libc="-lc"; break; case 's': /* Standalone 8086 */ @@ -966,17 +988,21 @@ break; case '8': /* Use 'c386' program as compiler */ opt_arch = 3; - opt_e = 1; break; case '9': /* 6809 compiler */ opt_arch = 4; +#ifndef L_TREE default_libdir0 = "-L~/lib/bcc/m09/"; optim_rules = "-d~/lib/bcc/m09"; add_prefix("~/lib/bcc/m09/"); +#else + default_libdir0 = "-L~/lib/m09/"; + optim_rules = "-d~/lib/m09"; + add_prefix("~/lib/m09/"); +#endif break; case '0': /* Plain old Unix V7 style */ opt_arch = 5; - opt_e = 1; opt_I = 1; opt_L = 1; opt_x = 1; @@ -988,9 +1014,7 @@ if (do_optim) { - if (opt_e) - append_option("-O", 'c'); - append_option("-O", 'p'); + append_option("-O", 'C'); append_option("-O", 'a'); } } diff -Nurd linux86.old/bcc/input.c linux86/bcc/input.c --- linux86.old/bcc/input.c Sun Aug 4 07:44:42 2002 +++ linux86/bcc/input.c Thu Dec 5 08:04:58 2002 @@ -511,7 +511,6 @@ case 't': /* print source code in asm output */ case 'w': /* watch location counter */ case 'O': /* Optimisation. */ - case 'A': /* Ansi mode. */ if (arg[2] == 0) flag[(int)arg[1]] = TRUE; else if (arg[2] == '-' && arg[3] == 0) diff -Nurd linux86.old/copt/rules.86 linux86/copt/rules.86 --- linux86.old/copt/rules.86 Tue Aug 6 19:58:52 2002 +++ linux86/copt/rules.86 Mon Jan 27 00:46:32 2003 @@ -91,19 +91,23 @@ inc %[si|di]* mov al,-1[si] mov -1[di],al +!BCC_EOS = lodsb stosb +!BCC_EOS inc %[si|di]* inc %[si|di]* mov al,-1[di] mov -1[si],al +!BCC_EOS = xchg si,di lodsb stosb xchg si,di +!BCC_EOS inc si mov al,-1[si] @@ -285,23 +289,24 @@ push %1 mov %[ax|bx|cx|dx]3,%2 -%[add|sub|and|xor|or]4 %[ax|bx|cx|dx]3,%*[bp] +%[add|and|xor|or]4 %[ax|bx|cx|dx]3,%*[bp] inc sp inc sp = -mov %3,%2 -%4 %3,%1 +mov %3,%1 +%4 %3,%2 -push %1 -mov %[ax|bx|cx|dx]3,%2 -%[add|sub|and|xor|or]5 %[ax|bx|cx|dx]3,%6 -%[add|sub|and|xor|or]4 %[ax|dx|cx|dx]3,%*[bp] -inc sp -inc sp -= -mov %3,%2 -%5 %3,%6 -%4 %3,%1 +# If %1 is ax this fails badly. +# push %1 +# mov %[ax|bx|cx|dx]3,%2 +# %[add|sub|and|xor|or]5 %[ax|bx|cx|dx]3,%6 +# %[add|sub|and|xor|or]4 %[ax|dx|cx|dx]3,%*[bp] +# inc sp +# inc sp +# = +# mov %3,%2 +# %5 %3,%6 +# %4 %3,%1 push %1 mov %[ax|bx|cx|dx]3,%*[bp] diff -Nurd linux86.old/cpp/main.c linux86/cpp/main.c --- linux86.old/cpp/main.c Tue Aug 13 20:51:16 2002 +++ linux86/cpp/main.c Thu Dec 5 08:05:19 2002 @@ -59,7 +59,6 @@ case 'K': dialect = DI_KNR; break; /* Some options for describing the code generator. */ - case 'E': break; case '0': define_macro("__BCC__"); define_macro("__AS386_16__"); define_macro("__8086__"); diff -Nurd linux86.old/elksemu/README linux86/elksemu/README --- linux86.old/elksemu/README Fri Jan 15 23:25:58 1999 +++ linux86/elksemu/README Sun Jan 5 12:15:40 2003 @@ -3,12 +3,20 @@ real ELKS machine. The emulator only runs on linux-i386 or similar. If you're using a 2.0.36, 2.1.43, 2.2.0 or later kernel then the -binfmt_misc driver is in the stock kernel add the following line to a -/etc/rc*/* file and you don't need to install a patch or module! +binfmt_misc driver is in the stock kernel and all you need to do is +add the following line into the relevent /etc/rc* file. echo ':i86-elks:M::\x01\x03\x20\x00:\xff\xff\xff\x83:/lib/elksemu:' \ > /proc/sys/fs/binfmt_misc/register +Note, however, if binfmt_misc is compiled as a module it will not auto +load so you will have to do this manually. + +Further by default the elksemu executable is compiled as an OMAGIC +executable and needs binfmt_aout. If binfmt_aout is a module and your +/etc/modules.conf is not correctly configured you may have to load this +module manually too. Alternativily you can compile elksemu using GCC +to produce an ELF executable. If your kernel version is 1.2.13 then apply the patch in the Kernel_patch file. diff -Nurd linux86.old/ld/objdump86.c linux86/ld/objdump86.c --- linux86.old/ld/objdump86.c Sat Jun 8 07:50:28 2002 +++ linux86/ld/objdump86.c Tue Jan 28 21:32:02 2003 @@ -371,9 +371,16 @@ nameoff = get_word(); symtype = get_word(); + if (nameoff == -1 || symtype == -1) { + printf("!!! EOF in symbol table\n"); + break; + } offset = get_sized((symtype>>14)&3); symtype &= 0x3FFF; - symnames[i] = symtab+nameoff; + if (nameoff > str_len || nameoff < 0) + symnames[i] = symtab + str_len; + else + symnames[i] = symtab+nameoff; if( !display_mode ) { diff -Nurd linux86.old/ld/writebin.c linux86/ld/writebin.c --- linux86.old/ld/writebin.c Sat Mar 16 16:17:56 2002 +++ linux86/ld/writebin.c Tue Jan 28 22:34:04 2003 @@ -1060,6 +1060,8 @@ bool_pt argstripflag; bool_pt arguzp; { - fatalerror("Native a.out generation not included, sorry"); + char * s = "WARNING: Native a.out generation not included, sorry\n"; + write(2, s, strlen(s)); + write_elks(outfilename, argsepid, argbits32, argstripflag, arguzp, 0); } #endif diff -Nurd linux86.old/ld/writex86.c linux86/ld/writex86.c --- linux86.old/ld/writex86.c Wed Dec 4 21:05:06 2002 +++ linux86/ld/writex86.c Tue Jan 28 22:17:01 2003 @@ -415,7 +415,8 @@ { int i; extsym.n_sclass = 0; - extsym.n_value = 0; + memset((void*)&extsym.n_value,0, + sizeof(extsym.n_value)); for(i=sizeof extsym.n_name; iname); i+=sizeof extsym.n_name) diff -Nurd linux86.old/ld/x86_aout.h linux86/ld/x86_aout.h --- linux86.old/ld/x86_aout.h Tue Jul 22 21:56:45 1997 +++ linux86/ld/x86_aout.h Tue Jan 28 22:17:14 2003 @@ -101,7 +101,7 @@ struct nlist { /* symbol table entry */ char n_name[8]; /* symbol name */ - long n_value; /* value */ + Long n_value; /* value */ unsigned char n_sclass; /* storage class */ unsigned char n_numaux; /* number of auxiliary entries (not used) */ unsigned short n_type; /* language base and derived type (not used) */ diff -Nurd linux86.old/libc/Makefile linux86/libc/Makefile --- linux86.old/libc/Makefile Wed Mar 20 21:20:43 2002 +++ linux86/libc/Makefile Wed Jan 29 19:56:20 2003 @@ -52,11 +52,10 @@ @for i in `cat .config.dir`; do \ grep -s '^transfer' $$i/Makefile && $(MAKE) -s -C $$i $@ ; \ done ; echo -n - @[ -f kinclude/Used ] || \ - { rm -f include/linuxmt include/arch ; \ - ln -s $(ELKSSRC)/include/linuxmt include ; \ - ln -s $(ELKSSRC)/include/arch include ; \ - } + @[ -d include/linuxmt/. ] || \ + ln -s $(ELKSSRC)/include/linuxmt include + @[ -d include/arch/. ] || \ + ln -s $(ELKSSRC)/include/arch include ############################################################################ @@ -70,16 +69,11 @@ ############################################################################ -install_incl: +install_incl: transfer install -d $(BCCHOME)/include rm -f $(BCCHOME)/include/linuxmt $(BCCHOME)/include/arch ||: - cp -pr include/* $(BCCHOME)/include - if [ ! -f kinclude/Used ] ; \ - then rm -rf $(BCCHOME)/include/linuxmt $(BCCHOME)/include/arch ; \ - ln -s $(ELKSSRC)/include/linuxmt $(BCCHOME)/include ; \ - ln -s $(ELKSSRC)/include/arch $(BCCHOME)/include ; \ - fi - -chown -R root:root $(BCCHOME)/include 2>/dev/null + cp -Lpr include/* $(BCCHOME)/include + -chown -R root:root $(BCCHOME)/include -chmod -R u=rwX,og=rX $(BCCHOME)/include ############################################################################ diff -Nurd linux86.old/libc/include/malloc.h linux86/libc/include/malloc.h --- linux86.old/libc/include/malloc.h Tue Jul 23 22:03:28 1996 +++ linux86/libc/include/malloc.h Thu Jan 1 01:00:00 1970 @@ -1,30 +0,0 @@ - -#ifndef __MALLOC_H -#define __MALLOC_H -#include -#include - -/* - * Mini malloc allows you to use a less efficient but smaller malloc the - * cost is about 100 bytes of code in free but malloc (700bytes) doesn't - * have to be linked. Unfortunatly memory can only be reused if everything - * above it has been freed - * - */ - -extern void free __P((void *)); -extern void *malloc __P((size_t)); -extern void *realloc __P((void *, size_t)); -extern void *alloca __P((size_t)); - -extern void *(*__alloca_alloc) __P((size_t)); - -#ifdef __LIBC__ -#define __MINI_MALLOC__ -#endif - -#ifdef __MINI_MALLOC__ -#define malloc(x) ((*__alloca_alloc)(x)) -#endif - -#endif diff -Nurd linux86.old/libc/include/regexp.h linux86/libc/include/regexp.h --- linux86.old/libc/include/regexp.h Fri Mar 3 21:54:51 1989 +++ linux86/libc/include/regexp.h Thu Jan 1 01:00:00 1970 @@ -1,21 +0,0 @@ -/* - * Definitions etc. for regexp(3) routines. - * - * Caveat: this is V8 regexp(3) [actually, a reimplementation thereof], - * not the System V one. - */ -#define NSUBEXP 10 -typedef struct regexp { - char *startp[NSUBEXP]; - char *endp[NSUBEXP]; - char regstart; /* Internal use only. */ - char reganch; /* Internal use only. */ - char *regmust; /* Internal use only. */ - int regmlen; /* Internal use only. */ - char program[1]; /* Unwarranted chumminess with compiler. */ -} regexp; - -extern regexp *regcomp(); -extern int regexec(); -extern void regsub(); -extern void regerror(); diff -Nurd linux86.old/libc/include/regmagic.h linux86/libc/include/regmagic.h --- linux86.old/libc/include/regmagic.h Fri Mar 3 21:55:06 1989 +++ linux86/libc/include/regmagic.h Thu Jan 1 01:00:00 1970 @@ -1,5 +0,0 @@ -/* - * The first byte of the regexp internal "program" is actually this magic - * number; the start node begins in the second byte. - */ -#define MAGIC 0234 diff -Nurd linux86.old/libc/include/string.h linux86/libc/include/string.h --- linux86.old/libc/include/string.h Tue Mar 19 20:16:38 1996 +++ linux86/libc/include/string.h Thu Jan 1 01:00:00 1970 @@ -1,53 +0,0 @@ - -#ifndef __STRING_H -#define __STRING_H -#include -#include -#include - -/* Basic string functions */ -extern size_t strlen __P ((__const char* __str)); - -extern char * strcat __P ((char*, __const char*)); -extern char * strcpy __P ((char*, __const char*)); -extern int strcmp __P ((__const char*, __const char*)); - -extern char * strncat __P ((char*, char*, size_t)); -extern char * strncpy __P ((char*, char*, size_t)); -extern int strncmp __P ((__const char*, __const char*, size_t)); - -extern char * strchr __P ((char*, int)); -extern char * strrchr __P ((char*, int)); -extern char * strdup __P ((char*)); - -/* Basic mem functions */ -extern void * memcpy __P ((void*, __const void*, size_t)); -extern void * memccpy __P ((void*, void*, int, size_t)); -extern void * memchr __P ((__const void*, __const int, size_t)); -extern void * memset __P ((void*, int, size_t)); -extern int memcmp __P ((__const void*, __const void*, size_t)); - -extern void * memmove __P ((void*, void*, size_t)); - -/* Minimal (very!) locale support */ -#define strcoll strcmp -#define strxfrm strncpy - -/* BSDisms */ -#define index strchr -#define rindex strrchr - -/* Other common BSD functions */ -extern int strcasecmp __P ((char*, char*)); -extern int strncasecmp __P ((char*, char*, size_t)); -char *strpbrk __P ((char *, char *)); -char *strsep __P ((char **, char *)); -char *strstr __P ((char *, char *)); -char *strtok __P ((char *, char *)); -size_t strcspn __P ((char *, char *)); -size_t strspn __P ((char *, char *)); - -/* Linux silly hour */ -char *strfry __P ((char *)); - -#endif diff -Nurd linux86.old/libc/kinclude/Makefile linux86/libc/kinclude/Makefile --- linux86.old/libc/kinclude/Makefile Sat Aug 16 09:26:04 1997 +++ linux86/libc/kinclude/Makefile Wed Jan 29 19:40:25 2003 @@ -9,8 +9,6 @@ -@rm -f ../include/linuxmt ../include/arch ln -s ../kinclude/linuxmt ../include ln -s ../kinclude/arch ../include - @touch Used clean: - -@rm -f ../include/linuxmt ../include/arch - -@rm -f Used + -rm -f ../include/linuxmt ../include/arch diff -Nurd linux86.old/libc/malloc/Makefile linux86/libc/malloc/Makefile --- linux86.old/libc/malloc/Makefile Sat Mar 8 20:14:11 1997 +++ linux86/libc/malloc/Makefile Wed Jan 29 19:40:41 2003 @@ -15,7 +15,7 @@ $(AR) $(ARFLAGS) $@ $*.o clean: - rm -f *.o libc.a + rm -f *.o libc.a ../include/malloc.h transfer: -@rm ../include/malloc.h diff -Nurd linux86.old/libc/regexp/Makefile linux86/libc/regexp/Makefile --- linux86.old/libc/regexp/Makefile Sat Mar 8 20:15:45 1997 +++ linux86/libc/regexp/Makefile Wed Jan 29 19:41:07 2003 @@ -23,3 +23,4 @@ clean: rm -f libc.a *.o core mon.out timer.t.h dMakefile dtr try timer + rm -f ../include/regexp.h ../include/regmagic.h diff -Nurd linux86.old/libc/string/Makefile linux86/libc/string/Makefile --- linux86.old/libc/string/Makefile Sat Mar 8 20:16:28 1997 +++ linux86/libc/string/Makefile Wed Jan 29 19:41:21 2003 @@ -26,4 +26,4 @@ cp -p string.h ../include/. clean: - rm -f *.o + rm -f *.o ../include/string.h diff -Nurd linux86.old/man/as86.1 linux86/man/as86.1 --- linux86.old/man/as86.1 Tue Sep 26 21:18:31 2000 +++ linux86/man/as86.1 Tue Jan 7 08:31:23 2003 @@ -395,13 +395,13 @@ LFS LGDT LGS LIDT LLDT LMSW LOCK LODB LODS LODSB LODSD LODSW LODW LOOP LOOPE LOOPNE LOOPNZ LOOPZ LSL LSS LTR MOV MOVS MOVSB MOVSD MOVSW MOVSX MOVW MOVZX MUL NEG NOP NOT OR OUT OUTS OUTSB OUTSD OUTSW OUTW POP POPA -POPAD POPF POPFD PUSH PUSHA PUSHAD PUSHF PUSHFD RCL RCR REP REPE REPNE +POPAD POPF POPFD PUSH PUSHA PUSHAD PUSHF PUSHFD RCL RCR RDMSR REP REPE REPNE REPNZ REPZ RET RETF RETI ROL ROR SAHF SAL SAR SBB SCAB SCAS SCASB SCASD SCASW SCAW SEG SETA SETAE SETB SETBE SETC SETE SETG SETGE SETL SETLE SETNA SETNAE SETNB SETNBE SETNC SETNE SETNG SETNGE SETNL SETNLE SETNO SETNP SETNS SETNZ SETO SETP SETPE SETPO SETS SETZ SGDT SHL SHLD SHR SHRD SIDT SLDT SMSW STC STD STI STOB STOS STOSB STOSD STOSW STOW STR SUB TEST -VERR VERW WAIT WBINVD XADD XCHG XLAT XLATB XOR +VERR VERW WAIT WBINVD WRMSR XADD XCHG XLAT XLATB XOR .TP Floating point F2XM1 FABS FADD FADDP FBLD FBSTP FCHS FCLEX FCOM FCOMP FCOMPP FCOS diff -Nurd linux86.old/mkcompile linux86/mkcompile --- linux86.old/mkcompile Tue Jan 29 07:55:58 2002 +++ linux86/mkcompile Thu Dec 5 00:54:49 2002 @@ -1,6 +1,9 @@ #!/bin/sh SRC_BCC='bcc.c' +SRC_CPP='main.c cpp.c hash.c token1.c token2.c' +SRC_UPR='unproto.c error.c hash.c strsave.c symbol.c tok_clas.c tok_io.c + tok_pool.c unproto.c vstring.c' SRC_CC1='bcc-cc1.c assign.c codefrag.c debug.c declare.c express.c exptree.c floatop.c function.c gencode.c genloads.c glogcode.c hardop.c input.c label.c loadexp.c longop.c output.c preproc.c preserve.c scan.c @@ -26,10 +29,12 @@ LDFLAGS= ARCH=-Ml + build cpp bcc-cpp lib $SRC_CPP build bcc bcc-cc1 lib $SRC_CC1 build as as86 bin $SRC_AS build ld ld86 bin $SRC_LD - # build unproto unproto bin $SRC_UP + + build unproto unproto lib $SRC_UPR echo "echo Compile complete." echo ":exit_now" Binary files linux86.old/tests/a.out and linux86/tests/a.out differ diff -Nurd linux86.old/unproto/unproto.c linux86/unproto/unproto.c --- linux86.old/unproto/unproto.c Sat Jun 8 09:06:36 2002 +++ linux86/unproto/unproto.c Thu Dec 5 00:45:55 2002 @@ -219,7 +219,7 @@ cpp_pid = pipe_stdin_through_cpp(argv); #endif -#ifdef REOPEN +#if defined(REOPEN) || defined(MSDOS) #ifdef PIPE_THROUGH_CPP #error Defines REOPEN and PIPE_THROUGH_CPP are incompatible. #endif diff -Nurd linux86.old/bootblocks/Makefile linux86/bootblocks/Makefile --- linux86.old/bootblocks/Makefile Fri Sep 13 14:28:11 2002 +++ linux86/bootblocks/Makefile Mon Jan 27 00:36:14 2003 @@ -7,7 +7,7 @@ DEFS= CC=$(BCC) CFLAGS=-ansi -Ms -Oi -O -s $(DEFS) -# CFLAGS=-ansi -Ms +# CFLAGS=-ansi -Ms -s $(DEFS) ASFLAGS=-0 -w MINIXDEFS=-DDOTS # LST=-l $*.lst @@ -49,25 +49,25 @@ bootfile.sys: $(MSRC) $(MINC) @rm -f $(MOBJ) - make 'CFLAGS=$(CFLAGS) -DDOSFLOPPY -i -d' monitor.out + make 'CFLAGS=$(CFLAGS) -i -DDOSFLOPPY -d' monitor.out mv monitor.out bootfile.sys @rm -f $(MOBJ) boottar.sys: $(MSRC) $(MINC) tarboot.bin @rm -f $(MOBJ) - make 'CFLAGS=$(CFLAGS) -DTARFLOPPY -i' monitor.out + make 'CFLAGS=$(CFLAGS) -i -DTARFLOPPY' monitor.out mv monitor.out boottar.sys @rm -f $(MOBJ) bootminix.sys: $(MSRC) $(MINC) minix.bin @rm -f $(MOBJ) - make 'CFLAGS=$(CFLAGS) -DMINFLOPPY -i' monitor.out + make 'CFLAGS=$(CFLAGS) -i -DMINFLOPPY' monitor.out mv monitor.out bootminix.sys @rm -f $(MOBJ) monitor.sys: $(MSRC) $(MINC) @rm -f $(MOBJ) - make 'CFLAGS=$(CFLAGS) -DNOMONITOR -i' monitor.out + make 'CFLAGS=$(CFLAGS) -DNOMONITOR' monitor.out mv monitor.out monitor.sys @rm -f $(MOBJ) diff -Nurd linux86.old/bootblocks/bzimage.c linux86/bootblocks/bzimage.c --- linux86.old/bootblocks/bzimage.c Sun May 26 14:34:10 2002 +++ linux86/bootblocks/bzimage.c Mon Jan 27 00:36:46 2003 @@ -487,8 +487,6 @@ char * free_cmd = 0, * cmd = 0; char * free_inp = 0; - image_name = strdup(image); - if( linux_command_line ) free(linux_command_line); linux_command_line = 0; @@ -650,19 +648,15 @@ if( main_mem_top >= 15360 ) address = 0xFFFF; else address = 0x1000 + main_mem_top*4; - if( *initrd_name == '+' ) + if( *fname == '+' ) fname++; + + while( open_file(fname) < 0 ) { char buf[2]; - fname++; close_file(); - printf("Insert root disk and press return:"); fflush(stdout); + printf("Cannot open %s, insert next disk and press return:", fname); + fflush(stdout); if( read(0, buf, 2) <=0 ) return -1; - } - - if( open_file(fname) < 0 ) - { - printf("Cannot open %s\n", fname); - return -1; } file_len = file_length(); rd_len = (file_len+1023)/1024; diff -Nurd linux86.old/bootblocks/monitor.c linux86/bootblocks/monitor.c --- linux86.old/bootblocks/monitor.c Sun May 26 14:33:55 2002 +++ linux86/bootblocks/monitor.c Sun Jan 26 22:32:42 2003 @@ -158,7 +158,7 @@ printf("\n"); #endif - printf("There is %u bytes available", offt-sbrk(0)); + printf("There is %u bytes available", &offt-sbrk(0)); printf(", %dk of boot memory", boot_mem_top/64); if( main_mem_top ) { diff -Nurd linux86.old/bootblocks/monitor.h linux86/bootblocks/monitor.h --- linux86.old/bootblocks/monitor.h Sun May 26 14:38:19 2002 +++ linux86/bootblocks/monitor.h Sun Jan 26 23:46:08 2003 @@ -48,7 +48,7 @@ #endif #ifdef SINGLEFS -/* #define NOCOMMAND */ +#define NOCOMMAND #define NOMONITOR #endif diff -Nurd linux86.old/bootblocks/relocate.c linux86/bootblocks/relocate.c --- linux86.old/bootblocks/relocate.c Sun Feb 10 15:58:35 2002 +++ linux86/bootblocks/relocate.c Sun Jan 26 22:50:37 2003 @@ -32,8 +32,10 @@ memseg = __get_cs(); codelen = __get_ds()-memseg; __set_es(memseg-2); - memlen = __deek_es( 24 ); - memlen >>=4; + if (__deek_es(0) == 0x0301 ) { + memlen = __deek_es( 24 ); + memlen >>=4; + } if( memlen == 0 ) memlen = 0x1000; memlen += codelen; __set_es(es);