[NTVDM]: we have a FPU.
[reactos.git] / reactos / subsystems / ntvdm / bios / bios.h
1 /*
2 * COPYRIGHT: GPL - See COPYING in the top level directory
3 * PROJECT: ReactOS Virtual DOS Machine
4 * FILE: bios.h
5 * PURPOSE: VDM BIOS Support Library
6 * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca@sfr.fr)
7 */
8
9 #ifndef _BIOS_H_
10 #define _BIOS_H_
11
12 /* INCLUDES *******************************************************************/
13
14 #include "ntvdm.h"
15 #include "kbdbios.h"
16 #include "vidbios.h"
17
18 /* DEFINES ********************************************************************/
19
20 /* BOP Identifiers */
21 #define BOP_RESET 0x00 // Windows NTVDM (SoftPC) BIOS calls BOP 0x00
22 // to let the virtual machine initialize itself
23 // the IVT and its hardware.
24 #define BOP_EQUIPLIST 0x11
25 #define BOP_GETMEMSIZE 0x12
26
27
28
29
30 #define BDA_SEGMENT 0x40
31 #define BIOS_SEGMENT 0xF000
32
33 #define BIOS_EQUIPMENT_LIST 0x2E // Bit1: FPU, Bit 2: Mouse
34
35 #pragma pack(push, 1)
36
37 /*
38 * BIOS Data Area at 0040:XXXX
39 *
40 * See: http://webpages.charter.net/danrollins/techhelp/0093.HTM
41 * and: http://www.bioscentral.com/misc/bda.htm
42 * for more information.
43 */
44 typedef struct
45 {
46 WORD SerialPorts[4]; // 0x00
47 WORD ParallelPorts[3]; // 0x08
48 WORD EbdaSegment; // 0x0e - ParallelPort in PC/XT
49 WORD EquipmentList; // 0x10
50 BYTE Reserved0; // 0x12 - Errors in PCjr infrared keyboard link
51 WORD MemorySize; // 0x13
52 WORD Reserved1; // 0x15 - Scratch pad for manufacturing error tests
53 WORD KeybdShiftFlags; // 0x17
54 BYTE AlternateKeypad; // 0x19
55 WORD KeybdBufferHead; // 0x1a
56 WORD KeybdBufferTail; // 0x1c
57 WORD KeybdBuffer[BIOS_KBD_BUFFER_SIZE]; // 0x1e
58 BYTE DriveRecalibrate; // 0x3e
59 BYTE DriveMotorStatus; // 0x3f
60 BYTE MotorShutdownCounter; // 0x40
61 BYTE LastDisketteOperation; // 0x41
62 BYTE Reserved2[7]; // 0x42
63 BYTE VideoMode; // 0x49
64 WORD ScreenColumns; // 0x4a
65 WORD VideoPageSize; // 0x4c
66 WORD VideoPageOffset; // 0x4e
67 WORD CursorPosition[BIOS_MAX_PAGES]; // 0x50
68 BYTE CursorEndLine; // 0x60
69 BYTE CursorStartLine; // 0x61
70 BYTE VideoPage; // 0x62
71 WORD CrtBasePort; // 0x63
72 BYTE CrtModeControl; // 0x65
73 BYTE CrtColorPaletteMask; // 0x66
74 BYTE CassetteData[5]; // 0x67
75 DWORD TickCounter; // 0x6c
76 BYTE MidnightPassed; // 0x70
77 BYTE BreakFlag; // 0x71
78 WORD SoftReset; // 0x72
79 BYTE LastDiskOperation; // 0x74
80 BYTE NumDisks; // 0x75
81 BYTE DriveControlByte; // 0x76
82 BYTE DiskPortOffset; // 0x77
83 BYTE LptTimeOut[4]; // 0x78
84 BYTE ComTimeOut[4]; // 0x7c
85 WORD KeybdBufferStart; // 0x80
86 WORD KeybdBufferEnd; // 0x82
87 BYTE ScreenRows; // 0x84
88 WORD CharacterHeight; // 0x85
89 BYTE VGAOptions; // 0x87
90 BYTE VGASwitches; // 0x88
91 BYTE VGAFlags[2]; // 0x89
92 DWORD Reserved3; // 0x8b
93 BYTE Reserved4; // 0x8f
94 BYTE Reserved5[2]; // 0x90
95 BYTE Reserved6[2]; // 0x92
96 BYTE Reserved7[2]; // 0x94
97 WORD KeybdStatusFlags; // 0x96
98 DWORD Reserved9; // 0x98
99 DWORD Reserved10; // 0x9c
100 DWORD Reserved11[2]; // 0xa0
101 DWORD EGAPtr; // 0xa8
102 BYTE Reserved12[68]; // 0xac
103 BYTE Reserved13[16]; // 0xf0
104
105 DWORD Reserved14; // 0x100
106 BYTE Reserved15[12]; // 0x104
107 BYTE Reserved16[17]; // 0x110
108 BYTE Reserved17[15]; // 0x121
109 BYTE Reserved18[3]; // 0x130
110 } BIOS_DATA_AREA, *PBIOS_DATA_AREA;
111 C_ASSERT(sizeof(BIOS_DATA_AREA) == 0x133);
112
113 /*
114 * BIOS Configuration Table at F000:E6F5 for 100% compatible BIOSes.
115 *
116 * See: http://www.ctyme.com/intr/rb-1594.htm
117 * for more information.
118 */
119 typedef struct _BIOS_CONFIG_TABLE
120 {
121 WORD Length; // 0x00
122 BYTE Model; // 0x02
123 BYTE SubModel; // 0x03
124 BYTE Revision; // 0x04
125 BYTE Feature[5]; // 0x05 -- 0x09
126 // Other BIOSes may extend this table. We don't.
127 } BIOS_CONFIG_TABLE, *PBIOS_CONFIG_TABLE;
128
129 #pragma pack(pop)
130
131 /* FUNCTIONS ******************************************************************/
132
133 extern PBIOS_DATA_AREA Bda;
134 extern PBIOS_CONFIG_TABLE Bct;
135
136 VOID WINAPI BiosEquipmentService(LPWORD Stack);
137 VOID WINAPI BiosGetMemorySize(LPWORD Stack);
138
139 BOOLEAN
140 BiosInitialize(IN LPCSTR BiosFileName);
141
142 VOID
143 BiosCleanup(VOID);
144
145 #endif // _BIOS_H_
146
147 /* EOF */