summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert de Bath <rdebath@poboxes.com>2003-01-29 21:07:56 +0100
committerLubomir Rintel <lkundrak@v3.sk>2013-10-23 23:48:48 +0200
commitded00c0d1c0dc38e63b2c48ff8cbb12c1b60c70f (patch)
treed453e3353975e51525ef0a9b08e751ebc5ff9c29
parentb5790e52270b149e92531a8eb0cd521ff2854dff (diff)
downloaddev86-ded00c0d1c0dc38e63b2c48ff8cbb12c1b60c70f.tar.gz
Import Dev86src-0.16.11.tar.gzv0.16.11
-rw-r--r--Changes4
-rw-r--r--Makefile2
-rw-r--r--as/genobj.c2
-rw-r--r--as/keywords.c2
-rw-r--r--as/table.c2
-rw-r--r--as/typeconv.c4
-rw-r--r--bcc/bcc.c116
-rw-r--r--bcc/input.c1
-rw-r--r--bootblocks/Makefile10
-rw-r--r--bootblocks/bzimage.c16
-rw-r--r--bootblocks/monitor.c2
-rw-r--r--bootblocks/monitor.h2
-rw-r--r--bootblocks/relocate.c6
-rw-r--r--copt/rules.8631
-rw-r--r--cpp/main.c1
-rw-r--r--elksemu/README12
-rw-r--r--ld/objdump86.c9
-rw-r--r--ld/writebin.c4
-rw-r--r--ld/writex86.c3
-rw-r--r--ld/x86_aout.h2
-rw-r--r--libc/Makefile20
-rw-r--r--libc/include/malloc.h30
-rw-r--r--libc/include/regexp.h21
-rw-r--r--libc/include/regmagic.h5
-rw-r--r--libc/include/string.h53
-rw-r--r--libc/kinclude/Makefile4
-rw-r--r--libc/malloc/Makefile2
-rw-r--r--libc/regexp/Makefile1
-rw-r--r--libc/string/Makefile2
-rw-r--r--man/as86.14
-rw-r--r--mkcompile7
-rwxr-xr-xtests/a.outbin8783 -> 0 bytes
-rw-r--r--unproto/unproto.c2
33 files changed, 161 insertions, 221 deletions
diff --git a/Changes b/Changes
index 7140760..faabcdd 100644
--- a/Changes
+++ b/Changes
@@ -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 --git a/Makefile b/Makefile
index 2aff7fd..af6625e 100644
--- a/Makefile
+++ b/Makefile
@@ -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 --git a/as/genobj.c b/as/genobj.c
index 588f41b..67eb88e 100644
--- a/as/genobj.c
+++ b/as/genobj.c
@@ -634,7 +634,7 @@ u32_T offset;
char buf[sizeof offset];
u4c4(buf, offset);
- writeobj(buf, sizeof buf);
+ writeobj(buf, 4);
}
/* write sized offset to object code buffer assuming ... */
diff --git a/as/keywords.c b/as/keywords.c
index 0db0636..4151320 100644
--- a/as/keywords.c
+++ b/as/keywords.c
@@ -621,6 +621,7 @@ PUBLIC char page1ops[] =
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 @@ PUBLIC char page1ops[] =
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 --git a/as/table.c b/as/table.c
index 3d39d0b..9c70015 100644
--- a/as/table.c
+++ b/as/table.c
@@ -129,7 +129,7 @@ PUBLIC struct sym_s *lookup()
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 --git a/as/typeconv.c b/as/typeconv.c
index d8c0c89..580f759 100644
--- a/as/typeconv.c
+++ b/as/typeconv.c
@@ -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 big_endian;
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 --git a/bcc/bcc.c b/bcc/bcc.c
index 0741572..81adda2 100644
--- a/bcc/bcc.c
+++ b/bcc/bcc.c
@@ -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 @@ char ** argv;
/* 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 @@ void
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 @@ void
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 @@ struct file_list * file;
command_opt("-t");
command_opts('c');
+ command_opts('C');
command_arch();
@@ -501,9 +523,13 @@ validate_link_opt(char * option)
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 @@ command_reset()
#endif
char buf[MAXPATHLEN];
char ** prefix;
+ char * saved_cmd;
if (command.arglist)
{
@@ -561,6 +588,7 @@ command_reset()
/* 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 @@ command_reset()
}
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 @@ char ** argv;
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 @@ char ** argv;
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 @@ char ** argv;
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 @@ char ** argv;
if (do_optim)
{
- if (opt_e)
- append_option("-O", 'c');
- append_option("-O", 'p');
+ append_option("-O", 'C');
append_option("-O", 'a');
}
}
diff --git a/bcc/input.c b/bcc/input.c
index 4ce121d..4f8ec6a 100644
--- a/bcc/input.c
+++ b/bcc/input.c
@@ -511,7 +511,6 @@ char *argv[];
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 --git a/bootblocks/Makefile b/bootblocks/Makefile
index d7ec4fa..9a97468 100644
--- a/bootblocks/Makefile
+++ b/bootblocks/Makefile
@@ -7,7 +7,7 @@ AS86=as86
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 @@ fs_min.o: minix.h
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 --git a/bootblocks/bzimage.c b/bootblocks/bzimage.c
index d9d92bc..9221bb4 100644
--- a/bootblocks/bzimage.c
+++ b/bootblocks/bzimage.c
@@ -487,8 +487,6 @@ static char * image_str = "BOOT_IMAGE=";
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,20 +648,16 @@ unsigned int k_top;
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 --git a/bootblocks/monitor.c b/bootblocks/monitor.c
index acdd168..8c79c1c 100644
--- a/bootblocks/monitor.c
+++ b/bootblocks/monitor.c
@@ -158,7 +158,7 @@ void init_prog()
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 --git a/bootblocks/monitor.h b/bootblocks/monitor.h
index 4e499f0..e229d48 100644
--- a/bootblocks/monitor.h
+++ b/bootblocks/monitor.h
@@ -48,7 +48,7 @@ extern union REGS __argr;
#endif
#ifdef SINGLEFS
-/* #define NOCOMMAND */
+#define NOCOMMAND
#define NOMONITOR
#endif
diff --git a/bootblocks/relocate.c b/bootblocks/relocate.c
index 2e31ea8..f409a4e 100644
--- a/bootblocks/relocate.c
+++ b/bootblocks/relocate.c
@@ -32,8 +32,10 @@ unsigned newseg;
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);
diff --git a/copt/rules.86 b/copt/rules.86
index 15b0749..2288050 100644
--- a/copt/rules.86
+++ b/copt/rules.86
@@ -91,19 +91,23 @@ inc %[si|di]*
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 @@ inc %2
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 --git a/cpp/main.c b/cpp/main.c
index dfe0e5c..c4e6cdd 100644
--- a/cpp/main.c
+++ b/cpp/main.c
@@ -59,7 +59,6 @@ static char Usage[] = "Usage: cpp -E -0 -Dxxx -Uxxx -Ixxx infile -o outfile";
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 --git a/elksemu/README b/elksemu/README
index 6a5bdae..065d22b 100644
--- a/elksemu/README
+++ b/elksemu/README
@@ -3,12 +3,20 @@ Elksemu is an emulator for the environment that elks will provide on a
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 --git a/ld/objdump86.c b/ld/objdump86.c
index 4979a1a..b29c24d 100644
--- a/ld/objdump86.c
+++ b/ld/objdump86.c
@@ -371,9 +371,16 @@ read_syms()
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 --git a/ld/writebin.c b/ld/writebin.c
index ef1cb7f..1b36ce7 100644
--- a/ld/writebin.c
+++ b/ld/writebin.c
@@ -1060,6 +1060,8 @@ bool_pt argbits32;
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 --git a/ld/writex86.c b/ld/writex86.c
index 42158e4..c4cd3f5 100644
--- a/ld/writex86.c
+++ b/ld/writex86.c
@@ -415,7 +415,8 @@ bool_pt argxsym;
{
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; i<strlen(symptr->name);
i+=sizeof extsym.n_name)
diff --git a/ld/x86_aout.h b/ld/x86_aout.h
index 580e977..45bf0c7 100644
--- a/ld/x86_aout.h
+++ b/ld/x86_aout.h
@@ -101,7 +101,7 @@ struct reloc {
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 --git a/libc/Makefile b/libc/Makefile
index d5887b2..7d1ceb9 100644
--- a/libc/Makefile
+++ b/libc/Makefile
@@ -52,11 +52,10 @@ transfer: .config.dir
@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 @@ clean:
############################################################################
-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 --git a/libc/include/malloc.h b/libc/include/malloc.h
deleted file mode 100644
index e8fdb0a..0000000
--- a/libc/include/malloc.h
+++ /dev/null
@@ -1,30 +0,0 @@
-
-#ifndef __MALLOC_H
-#define __MALLOC_H
-#include <features.h>
-#include <sys/types.h>
-
-/*
- * 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 --git a/libc/include/regexp.h b/libc/include/regexp.h
deleted file mode 100644
index 73d6bf4..0000000
--- a/libc/include/regexp.h
+++ /dev/null
@@ -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 --git a/libc/include/regmagic.h b/libc/include/regmagic.h
deleted file mode 100644
index 5acf447..0000000
--- a/libc/include/regmagic.h
+++ /dev/null
@@ -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 --git a/libc/include/string.h b/libc/include/string.h
deleted file mode 100644
index 2233bf9..0000000
--- a/libc/include/string.h
+++ /dev/null
@@ -1,53 +0,0 @@
-
-#ifndef __STRING_H
-#define __STRING_H
-#include <features.h>
-#include <sys/types.h>
-#include <stddef.h>
-
-/* 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 --git a/libc/kinclude/Makefile b/libc/kinclude/Makefile
index 7722d68..dd26b5d 100644
--- a/libc/kinclude/Makefile
+++ b/libc/kinclude/Makefile
@@ -9,8 +9,6 @@ transfer:
-@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 --git a/libc/malloc/Makefile b/libc/malloc/Makefile
index e762582..b083b2e 100644
--- a/libc/malloc/Makefile
+++ b/libc/malloc/Makefile
@@ -15,7 +15,7 @@ $(LIBC)($(AOBJ)): $(ASRC)
$(AR) $(ARFLAGS) $@ $*.o
clean:
- rm -f *.o libc.a
+ rm -f *.o libc.a ../include/malloc.h
transfer:
-@rm ../include/malloc.h
diff --git a/libc/regexp/Makefile b/libc/regexp/Makefile
index c99c22e..a5ad0d8 100644
--- a/libc/regexp/Makefile
+++ b/libc/regexp/Makefile
@@ -23,3 +23,4 @@ $(LIBC)(regsub.o): regsub.c regexp.h regmagic.h
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 --git a/libc/string/Makefile b/libc/string/Makefile
index 0f47b40..a19ac0e 100644
--- a/libc/string/Makefile
+++ b/libc/string/Makefile
@@ -26,4 +26,4 @@ transfer:
cp -p string.h ../include/.
clean:
- rm -f *.o
+ rm -f *.o ../include/string.h
diff --git a/man/as86.1 b/man/as86.1
index 6948486..619d604 100644
--- a/man/as86.1
+++ b/man/as86.1
@@ -395,13 +395,13 @@ JNL JNLE JNO JNP JNS JNZ JO JP JPE JPO JS JZ LAHF LAR LDS LEA LEAVE LES
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 --git a/mkcompile b/mkcompile
index 52b0b5a..0e634c0 100644
--- a/mkcompile
+++ b/mkcompile
@@ -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 @@ main() {
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"
diff --git a/tests/a.out b/tests/a.out
deleted file mode 100755
index 14156c6..0000000
--- a/tests/a.out
+++ /dev/null
Binary files differ
diff --git a/unproto/unproto.c b/unproto/unproto.c
index 9dcdf1a..da1560c 100644
--- a/unproto/unproto.c
+++ b/unproto/unproto.c
@@ -219,7 +219,7 @@ char **argv;
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