2 * Copyright (c) 1992, 1993, 1996
3 * Berkeley Software Design, Inc. All rights reserved.
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, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement:
15 * This product includes software developed by Berkeley Software
18 * THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND
19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE
22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * BSDI int2f.c,v 2.2 1996/04/08 19:32:53 bostic Exp
40 ** Multiplex interrupt.
42 ** subfunctions 0-0x7f reserved for DOS, some are implemented here.
47 ** 2f:00 2f:01 2f:02 2f:03
49 ** Various PRINT.COM functions
52 int2f_printer(regcontext_t *REGS)
54 debug (D_FILE_OPS, "Called printer function 0x%02x", R_AH);
55 R_AL = FUNC_NUM_IVALID;
62 ** DOS internal functions. Only one we support is 0x2e, and then only to
66 int2f_dosinternal(regcontext_t *REGS)
69 case 0x2e: /* XXX - GET/SET ERROR TABLE ADDRESSES */
75 debug(D_ALWAYS,"DOS program attempted to get internal error table.\n");
83 debug(D_ALWAYS,"DOS program attempted to set error table.\n");
88 unknown_int4(0x2f, 0x12, R_AL, R_DL, REGS);
91 R_AL = FUNC_NUM_IVALID;
98 ** Windows Enhanced Mode functions. Aigh!
101 int2f_windows(regcontext_t *REGS)
105 R_AL = 0x00; /* Neither Win 3.x nor 2.x running */
108 case 0x80: /* installation check */
114 unknown_int3(0x2f, 0x16, R_AL, REGS);
117 R_AL = FUNC_NUM_IVALID;
127 int2f_xms(regcontext_t *REGS)
130 case 0: /* installation check */
131 return(0); /* %al = 0 */
133 R_AL = FUNC_NUM_IVALID;
139 static struct intfunc_table int2f_table[] = {
141 { 0x00, IFT_NOSUBFUNC, int2f_printer, "printer"},
142 { 0x01, IFT_NOSUBFUNC, int2f_printer, "printer"},
143 { 0x02, IFT_NOSUBFUNC, int2f_printer, "printer"},
144 { 0x03, IFT_NOSUBFUNC, int2f_printer, "printer"},
145 { 0x12, IFT_NOSUBFUNC, int2f_dosinternal, "DOS internal function"},
146 { 0x16, IFT_NOSUBFUNC, int2f_windows, "Windows detect"},
147 { 0x43, IFT_NOSUBFUNC, int2f_xms, "XMS"},
152 ** int2f (multiplex) handler.
154 ** Note that due to the widely varied and inconsistent conventions, handlers
155 ** called from here are expected to manage their own return values.
158 int2f(regcontext_t *REGS)
162 /* look up the handler for the current function */
163 idx = intfunc_search(int2f_table, R_AH, R_AL);
165 if (idx >= 0) { /* respond on multiplex chain */
166 int2f_table[idx].handler(REGS);
168 unknown_int2(0x2f, R_AH, REGS);