summaryrefslogtreecommitdiffstats
path: root/usr.bin/doscmd
diff options
context:
space:
mode:
authorluoqi <luoqi@FreeBSD.org>1998-09-24 01:11:45 +0000
committerluoqi <luoqi@FreeBSD.org>1998-09-24 01:11:45 +0000
commit1e573349aa92ca5d53bb58f7463678e2ec7cfbe1 (patch)
tree26afea8f219ccd1d8927bc3da4d2fe813aa22f88 /usr.bin/doscmd
parentc51ade1afecd96fa41382fce71c9447db8ce023e (diff)
downloadFreeBSD-src-1e573349aa92ca5d53bb58f7463678e2ec7cfbe1.zip
FreeBSD-src-1e573349aa92ca5d53bb58f7463678e2ec7cfbe1.tar.gz
ELFize. In fact, doscmd is ELF natural -- there is no need for a loader
since ELF executables are loaded well above the low memory region that DOS operates in.
Diffstat (limited to 'usr.bin/doscmd')
-rw-r--r--usr.bin/doscmd/Makefile16
-rw-r--r--usr.bin/doscmd/xms.c14
2 files changed, 27 insertions, 3 deletions
diff --git a/usr.bin/doscmd/Makefile b/usr.bin/doscmd/Makefile
index 953b402..b2f2623 100644
--- a/usr.bin/doscmd/Makefile
+++ b/usr.bin/doscmd/Makefile
@@ -1,6 +1,6 @@
# from BSDI Makefile,v 2.6 1996/04/08 20:06:40 bostic Exp
#
-# $Id: Makefile,v 1.11 1998/05/26 20:12:55 sos Exp $
+# $Id: Makefile,v 1.12 1998/05/31 11:32:38 bde Exp $
PROG= doscmd
SRCS= AsyncIO.c ParseBuffer.c bios.c callback.c cpu.c dos.c cmos.c config.c \
@@ -9,7 +9,11 @@ SRCS= AsyncIO.c ParseBuffer.c bios.c callback.c cpu.c dos.c cmos.c config.c \
mem.c mouse.c net.c port.c setver.c signal.c timer.c trace.c trap.c \
tty.c xms.c
+.if ${OBJFORMAT} == "aout"
CLEANFILES= doscmd.kernel crt0.o doscmd_loader.o redir.com emsdriv.sys
+.else
+CLEANFILES= redir.com emsdriv.sys
+.endif
BINGRP= kmem
EXEGRP= bin
@@ -23,15 +27,20 @@ DPADD= ${X11BASE}/lib/libX11.a
.else
CFLAGS+= -I. -DDISASSEMBLER -DNO_X
.endif
+.if ${OBJFORMAT} == "aout"
LDADD+= -L${DESTDIR}${LIBDIR} -lgcc -lc
DPADD+= ${LIBGCC} ${LIBC}
+.endif
beforeinstall:
+.if ${OBJFORMAT} == "aout"
${INSTALL} ${COPY} -o ${BINOWN} -g ${EXEGRP} -m ${EXEMODE} \
doscmd.kernel ${DESTDIR}/usr/libexec/
+.endif
${INSTALL} ${COPY} -o ${BINOWN} -g ${EXEGRP} -m ${EXEMODE} \
emsdriv.sys redir.com ${DESTDIR}/usr/libdata/doscmd/
+.if ${OBJFORMAT} == "aout"
doscmd: ${LIBCRT0} doscmd_loader.o ${LIBGCC} ${LIBC}
ld -e start -dc -dp ${LDFLAGS:M-static:S/-static/-Bstatic/} \
-o doscmd ${LIBCRT0} doscmd_loader.o -L${DESTDIR}${LIBDIR} -lgcc -lc
@@ -41,6 +50,9 @@ doscmd: ${LIBCRT0} doscmd_loader.o ${LIBGCC} ${LIBC}
# Bogus dependencies to get more than one binary created by `make all'.
doscmd: doscmd.kernel emsdriv.sys redir.com
+.else
+doscmd: emsdriv.sys redir.com
+.endif
redir.com: redir.com.uu
uudecode ${.CURDIR}/redir.com.uu
@@ -55,8 +67,10 @@ emsdriv.sys: emsdriv.sys.uu
.include <bsd.prog.mk>
+.if ${OBJFORMAT} == "aout"
# This must be after bsd.prog.mk is included so that ${OBJS} in the
# dependency gets expanded.
doscmd.kernel: crt0.o ${OBJS} ${DPADD}
ld -N -Bstatic -T 110000 -o doscmd.kernel ${LDFLAGS} \
crt0.o ${OBJS} ${LDADD}
+.endif
diff --git a/usr.bin/doscmd/xms.c b/usr.bin/doscmd/xms.c
index 81ba91b..b016a0a 100644
--- a/usr.bin/doscmd/xms.c
+++ b/usr.bin/doscmd/xms.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: xms.c,v 1.2 1997/08/15 23:41:25 jlemon Exp $
+ * $Id: xms.c,v 1.3 1997/09/30 22:04:06 jlemon Exp $
*/
/*
@@ -70,7 +70,7 @@ static short HMA_a20 = -1;
static int HMA_fd_off, HMA_fd_on;
/* high memory mapfiles */
-static char *memfile = "/tmp/doscmd.XXXXXX";
+static char memfile[] = "/tmp/doscmd.XXXXXX";
/* Upper memory block (UMB) management */
UMB_block *UMB_freelist = NULL;
@@ -358,6 +358,16 @@ void initHMA()
lseek(HMA_fd_on, 64 * 1024 - 1, 0);
write(HMA_fd_on, "", 1);
+ if (mmap((caddr_t)0x000000, 0x100000,
+ PROT_EXEC | PROT_READ | PROT_WRITE,
+ MAP_ANON | MAP_FIXED | MAP_INHERIT | MAP_SHARED,
+ -1, 0) < 0) {
+ perror("Error mapping HMA, HMA disabled: ");
+ HMA_a20 = -1;
+ close(HMA_fd_off);
+ close(HMA_fd_on);
+ return;
+ }
if (mmap((caddr_t)0x000000, 64 * 1024,
PROT_EXEC | PROT_READ | PROT_WRITE,
MAP_FILE | MAP_FIXED | MAP_INHERIT | MAP_SHARED,
OpenPOWER on IntegriCloud