2 * BIOS interrupt 11h handler
4 * Copyright 1996 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "wine/port.h"
32 #include "wine/unicode.h"
33 #include "wine/debug.h"
36 /**********************************************************************
37 * DOSVM_Int11Handler (WINEDOS16.117)
39 * Handler for int 11h (get equipment list).
42 * Borrowed from Ralph Brown's interrupt lists:
44 * bits 15-14: number of parallel devices
45 * bit 13: [Conv] Internal modem
47 * bits 11- 9: number of serial devices
49 * bits 7- 6: number of diskette drives minus one
50 * bits 5- 4: Initial video mode:
56 * bit 2: [PS] =1 if pointing device
58 * bit 1: =1 if math co-processor
59 * bit 0: =1 if diskette available for boot
62 * Currently the only of these bits correctly set are:
64 * bits 15-14 } Added by William Owen Smith,
65 * bits 11-9 } wos@dcs.warwick.ac.uk
67 * bit 2 (always set) ( bit 2 = 4 )
68 * bit 1 } Robert 'Admiral' Coeyman
69 * All *nix systems either have a math processor or
72 void WINAPI DOSVM_Int11Handler( CONTEXT86 *context )
75 int parallelports = 0;
79 if (GetDriveTypeA("A:\\") == DRIVE_REMOVABLE) diskdrives++;
80 if (GetDriveTypeA("B:\\") == DRIVE_REMOVABLE) diskdrives++;
81 if (diskdrives) diskdrives--;
88 /* serial port name */
89 sprintf( file, "\\\\.\\COM%d", x+1 );
90 handle = CreateFileA( file, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0 );
91 if (handle != INVALID_HANDLE_VALUE)
93 CloseHandle( handle );
97 sprintf( file, "\\\\.\\LPT%d", x+1 );
98 handle = CreateFileA( file, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0 );
99 if (handle != INVALID_HANDLE_VALUE)
101 CloseHandle( handle );
106 if (serialports > 7) /* 3 bits -- maximum value = 7 */
109 if (parallelports > 3) /* 2 bits -- maximum value = 3 */
113 (diskdrives << 6) | (serialports << 9) | (parallelports << 14) | 0x06 );