2 * Copyright (c) 1997 Helmut Wirth <hfwirth@ping.at>
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice immediately at the beginning of the file, witout modification,
10 * this list of conditions, and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 #include <sys/cdefs.h>
30 __FBSDID("$FreeBSD$");
32 #include <sys/param.h>
37 /* The central entry point for the emulator interrupt. This is used by
38 * different special programs to call the emulator from VM86 space.
39 * Look at emuint.h for definitions and a list of the currently defined
41 * To call emuint from VM86 space do:
42 * push ax Save original ax value (*must be done* !)
43 * mov ah, funcnum Emuint function number to ah
44 * mov al, subfunc Subfunction number, optional, depending on func
48 * Emuint saves the function and subfunction numbers internally, then
49 * pops ax off the stack and calls the function handler with the original
53 emuint(regcontext_t *REGS)
55 u_short func, subfunc;
57 /* Remove function number from stack */
63 /* Call the function handler, subfunction is ignored, if unused */
66 /* The redirector call */
71 /* EMS call, used by emsdriv.sys */
77 R_AX = (u_short)ems_init();
85 debug(D_ALWAYS, "Undefined subfunction for EMS call\n");
92 debug(D_ALWAYS, "Emulator interrupt called with undefined function %02x\n", func);
96 * temporary backwards compatibility with instbsdi.exe
97 * remove after a while.
99 fprintf(stderr, "***\n*** WARNING - unknown emuint function\n");
100 fprintf(stderr, "*** Continuing; assuming instbsdi redirector.\n");
101 fprintf(stderr, "*** Please install the new redirector");
102 fprintf(stderr, " `redir.com' as soon as possible.\n");
103 fprintf(stderr, "*** This compatibility hack is not permanent.\n");
104 fprintf(stderr, "***\n");