summaryrefslogtreecommitdiff
path: root/elksemu
diff options
context:
space:
mode:
authorRobert de Bath <rdebath@poboxes.com>1996-09-03 22:06:58 +0200
committerLubomir Rintel <lkundrak@v3.sk>2013-10-23 23:31:01 +0200
commit0936b9aeab611665645a4e6bafaded7ca76dd189 (patch)
treefe6384035e96adc260f621d27909be67ad2e724a /elksemu
parente85ee07172eccafd9441362e774f7b184810d008 (diff)
downloaddev86-0936b9aeab611665645a4e6bafaded7ca76dd189.tar.gz
Import Dev86-0.0.7.tar.gzv0.0.7
Diffstat (limited to 'elksemu')
-rw-r--r--elksemu/Makefile14
-rw-r--r--elksemu/V-files.tarbin20480 -> 20480 bytes
-rw-r--r--elksemu/binfmt_elks.c1
-rw-r--r--elksemu/elks.c7
-rw-r--r--elksemu/elks_sys.c5
-rw-r--r--elksemu/linux/vm86.h8
6 files changed, 27 insertions, 8 deletions
diff --git a/elksemu/Makefile b/elksemu/Makefile
index 92aa516..2044160 100644
--- a/elksemu/Makefile
+++ b/elksemu/Makefile
@@ -2,7 +2,7 @@
# Makefile for elksemu.
#
-CFLAGS=-O2 -fno-strength-reduce -Wall
+CFLAGS=-O2 -fno-strength-reduce -Wall -idirafter . $(DEFS)
# If you need an a.out exe. NB The program _does_ now work as ELF
# CFLAGS=-O2 -fno-strength-reduce -b i486-linuxaout -N -s -static
@@ -32,12 +32,16 @@ module: binfmt_elks.o
# HOW to compile the module...
-# This matches my compile; yours may be different.
+# This matches my compile (2.0.0); yours may be different.
+MODCFLAGS=-D__KERNEL__ -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \
+ -fno-strength-reduce -pipe -m486 -DCPU=486 -DMODULE -DMODVERSIONS \
+ -include /usr/include/linux/modversions.h
+
binfmt_elks.o: binfmt_elks.c
- gcc -O -c -fomit-frame-pointer -DCPU=386 -D__KERNEL__ -DMODULE -DMODVERSIONS -include /usr/include/linux/modversions.h binfmt_elks.c
+ gcc -c $(MODCFLAGS) binfmt_elks.c
# This is another option
-# gcc -O -c -fomit-frame-pointer -DCPU=386 -D__KERNEL__ -DMODULE binfmt_elks.c
+#MODCFLAGS=-O -fomit-frame-pointer -DCPU=386 -D__KERNEL__ -DMODULE
# Or this ...
-# gcc -O -c -fomit-frame-pointer -D__KERNEL__ -DMODULE -DCONFIG_MODVERSIONS binfmt_elks.c
+#MODCFLAGS=-O -fomit-frame-pointer -D__KERNEL__ -DMODULE -DCONFIG_MODVERSIONS
diff --git a/elksemu/V-files.tar b/elksemu/V-files.tar
index 3e1227c..93e529d 100644
--- a/elksemu/V-files.tar
+++ b/elksemu/V-files.tar
Binary files differ
diff --git a/elksemu/binfmt_elks.c b/elksemu/binfmt_elks.c
index 09e5a29..9c1ecd4 100644
--- a/elksemu/binfmt_elks.c
+++ b/elksemu/binfmt_elks.c
@@ -104,7 +104,6 @@ int init_elksaout_binfmt(void) {
#ifdef MODULE
#if LINUX_VERSION_CODE < 0x010300
-#include <linux/version.h>
char kernel_version[] = UTS_RELEASE;
#endif
int init_module(void)
diff --git a/elksemu/elks.c b/elksemu/elks.c
index 10d9d78..652b559 100644
--- a/elksemu/elks.c
+++ b/elksemu/elks.c
@@ -208,10 +208,13 @@ void main(int argc, char *argv[], char *envp[])
}
/* This uses the _real_ user ID If the file is exec only that's */
/* ok cause the suid root will override. */
+ /* BTW, be careful here, security problems are possible because of
+ * races if you change this. */
if( access(argv[1], X_OK) < 0
- || stat(argv[1], &st) < 0
- || (fd=open(argv[1], O_RDONLY)) < 0)
+ || (fd=open(argv[1], O_RDONLY)) < 0
+ || fstat(fd, &st) < 0
+ )
{
perror(argv[1]);
exit(1);
diff --git a/elksemu/elks_sys.c b/elksemu/elks_sys.c
index 586ee9b..c16dc53 100644
--- a/elksemu/elks_sys.c
+++ b/elksemu/elks_sys.c
@@ -352,10 +352,12 @@ static int elks_times(int bx,int cx,int dx,int di,int si)
struct tms t;
long clock_ticks=times(&t);
long *tp=ELKS_PTR(long, bx);
+ long *clkt=ELKS_PTR(long, cx);
*tp++=t.tms_utime;
*tp++=t.tms_stime;
*tp++=t.tms_cutime;
*tp=t.tms_cstime;
+ *clkt = clock_ticks;
return 0; /* Should be clock_ticks */
}
@@ -676,6 +678,9 @@ static int elks_termios(int bx,int cx,int dx,int di,int si)
case 0x0A: rv = ioctl(bx, TCXONC, dx); break;
case 0x0B: rv = ioctl(bx, TCFLSH, dx); break;
+ case 0x11: rv = ioctl(bx, TIOCOUTQ, ELKS_PTR(void, dx)); break;
+ case 0x1B: rv = ioctl(bx, TIOCINQ, ELKS_PTR(void, dx)); break;
+
default: rv = -1; errno = EINVAL; break;
}
return rv;
diff --git a/elksemu/linux/vm86.h b/elksemu/linux/vm86.h
new file mode 100644
index 0000000..c099980
--- /dev/null
+++ b/elksemu/linux/vm86.h
@@ -0,0 +1,8 @@
+/*
+ * Since 1.3.99 vm86.h has moved from it's original position, this file
+ * redirects sys/vm86.h to the correct location if it hasn't been updated
+ * yet.
+ *
+ * Use "-idirafter . " on the command line.
+ */
+#include <asm/vm86.h>