summaryrefslogtreecommitdiffstats
path: root/usr.bin/doscmd/xms.c
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1997-08-09 01:43:15 +0000
committerdyson <dyson@FreeBSD.org>1997-08-09 01:43:15 +0000
commit305573cb2990c5d329d149cef5a3b5533b1e8fd9 (patch)
treedf06304b637358dbe8a006fdb7a6ea5955fee179 /usr.bin/doscmd/xms.c
parentdede28832bba6a9de7a428ff58df92439bddbc9c (diff)
downloadFreeBSD-src-305573cb2990c5d329d149cef5a3b5533b1e8fd9.zip
FreeBSD-src-305573cb2990c5d329d149cef5a3b5533b1e8fd9.tar.gz
Add our doscmd to the tree. This is a result of work from BSDI, and
a group of dos emulator developers. Submitted by: Jonathan Lemon <jlemon@americantv.com> Obtained from: BSDI
Diffstat (limited to 'usr.bin/doscmd/xms.c')
-rw-r--r--usr.bin/doscmd/xms.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/usr.bin/doscmd/xms.c b/usr.bin/doscmd/xms.c
new file mode 100644
index 0000000..c1524de
--- /dev/null
+++ b/usr.bin/doscmd/xms.c
@@ -0,0 +1,65 @@
+/*
+** No copyright?!
+**
+** $Id: xms.c,v 1.3 1996/09/22 15:43:01 miff Exp $
+*/
+#include "doscmd.h"
+
+u_long xms_vector;
+
+int
+int2f_43(regcontext_t *REGS)
+{
+
+ switch (R_AL) {
+ case 0x00: /* installation check */
+ R_AL = 0x80;
+ break;
+
+ case 0x10: /* get handler address */
+ N_PUTVEC(R_ES, R_BX, xms_vector);
+ break;
+
+ default:
+ return (0);
+ }
+ return (1);
+}
+
+/*
+** XXX DANGER WILL ROBINSON!
+*/
+static void
+xms_entry(regcontext_t *REGS)
+{
+ switch (R_AH) {
+ case 0x00: /* get version number */
+ R_AX = 0x0300; /* 3.0 */
+ R_BX = 0x0001; /* internal revision 0.1 */
+ R_DX = 0x0001; /* HMA exists */
+ break;
+
+ default:
+ debug(D_ALWAYS, "XMS %02x\n", R_AH);
+ R_AX = 0;
+ break;
+ }
+}
+
+static u_char xms_trampoline[] = {
+ 0xeb, /* JMP 5 */
+ 0x03,
+ 0x90, /* NOP */
+ 0x90, /* NOP */
+ 0x90, /* NOP */
+ 0xf4, /* HLT */
+ 0xcb, /* RETF */
+};
+
+void
+xms_init(void)
+{
+ xms_vector = insert_generic_trampoline(
+ sizeof(xms_trampoline), xms_trampoline);
+ register_callback(xms_vector + 5, xms_entry, "xms");
+}
OpenPOWER on IntegriCloud