Release 980329
[wine.git] / msdos / int11.c
blob4de3d41e5089b8b0ede7bfc74f3ab43b8bba1bc0
1 /*
2 * BIOS interrupt 11h handler
3 */
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include "miscemu.h"
8 #include "msdos.h"
9 #include "drive.h"
10 #include "debug.h"
12 /**********************************************************************
13 * INT_Int11Handler
15 * Handler for int 11h (get equipment list).
17 void WINAPI INT_Int11Handler( CONTEXT *context )
19 int diskdrives = 0;
20 int parallelports = 0;
21 int serialports = 0;
22 int x;
24 /* borrowed from Ralph Brown's interrupt lists
26 bits 15-14: number of parallel devices
27 bit 13: [Conv] Internal modem
28 bit 12: reserved
29 bits 11- 9: number of serial devices
30 bit 8: reserved
31 bits 7- 6: number of diskette drives minus one
32 bits 5- 4: Initial video mode:
33 00b = EGA,VGA,PGA
34 01b = 40 x 25 color
35 10b = 80 x 25 color
36 11b = 80 x 25 mono
37 bit 3: reserved
38 bit 2: [PS] =1 if pointing device
39 [non-PS] reserved
40 bit 1: =1 if math co-processor
41 bit 0: =1 if diskette available for boot
43 /* Currently the only of these bits correctly set are:
44 bits 15-14 } Added by William Owen Smith,
45 bits 11-9 } wos@dcs.warwick.ac.uk
46 bits 7-6
47 bit 2 (always set)
50 if (DRIVE_IsValid(0)) diskdrives++;
51 if (DRIVE_IsValid(1)) diskdrives++;
52 if (diskdrives) diskdrives--;
54 for (x=0; x!=MAX_PORTS; x++)
56 if (COM[x].devicename)
57 serialports++;
58 if (LPT[x].devicename)
59 parallelports++;
61 if (serialports > 7) /* 3 bits -- maximum value = 7 */
62 serialports=7;
63 if (parallelports > 3) /* 2 bits -- maximum value = 3 */
64 parallelports=3;
66 AX_reg(context) = (diskdrives << 6) | (serialports << 9) |
67 (parallelports << 14) | 0x02;