Fix comment.
[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 // HACK: Disable FPU for now
34 #define BIOS_EQUIPMENT_LIST 0x2C // Bit 2 set: Mouse present
35
36 #pragma pack(push, 1)
37
38 /*
39 * BIOS Data Area at 0040:XXXX
40 *
41 * See: http://webpages.charter.net/danrollins/techhelp/0093.HTM
42 * and: http://www.bioscentral.com/misc/bda.htm
43 * for more information.
44 */
45 typedef struct
46 {
47 WORD SerialPorts[4]; // 0x00
48 WORD ParallelPorts[3]; // 0x08
49 WORD EbdaSegment; // 0x0e - ParallelPort in PC/XT
50 WORD EquipmentList; // 0x10
51 BYTE Reserved0; // 0x12 - Errors in PCjr infrared keyboard link
52 WORD MemorySize; // 0x13
53 WORD Reserved1; // 0x15 - Scratch pad for manufacturing error tests
54 WORD KeybdShiftFlags; // 0x17
55 BYTE AlternateKeypad; // 0x19
56 WORD KeybdBufferHead; // 0x1a
57 WORD KeybdBufferTail; // 0x1c
58 WORD KeybdBuffer[BIOS_KBD_BUFFER_SIZE]; // 0x1e
59 BYTE DriveRecalibrate; // 0x3e
60 BYTE DriveMotorStatus; // 0x3f
61 BYTE MotorShutdownCounter; // 0x40
62 BYTE LastDisketteOperation; // 0x41
63 BYTE Reserved2[7]; // 0x42
64 BYTE VideoMode; // 0x49
65 WORD ScreenColumns; // 0x4a
66 WORD VideoPageSize; // 0x4c
67 WORD VideoPageOffset; // 0x4e
68 WORD CursorPosition[BIOS_MAX_PAGES]; // 0x50
69 BYTE CursorEndLine; // 0x60
70 BYTE CursorStartLine; // 0x61
71 BYTE VideoPage; // 0x62
72 WORD CrtBasePort; // 0x63
73 BYTE CrtModeControl; // 0x65
74 BYTE CrtColorPaletteMask; // 0x66
75 BYTE CassetteData[5]; // 0x67
76 DWORD TickCounter; // 0x6c
77 BYTE MidnightPassed; // 0x70
78 BYTE BreakFlag; // 0x71
79 WORD SoftReset; // 0x72
80 BYTE LastDiskOperation; // 0x74
81 BYTE NumDisks; // 0x75
82 BYTE DriveControlByte; // 0x76
83 BYTE DiskPortOffset; // 0x77
84 BYTE LptTimeOut[4]; // 0x78
85 BYTE ComTimeOut[4]; // 0x7c
86 WORD KeybdBufferStart; // 0x80
87 WORD KeybdBufferEnd; // 0x82
88 BYTE ScreenRows; // 0x84
89 WORD CharacterHeight; // 0x85
90 BYTE VGAOptions; // 0x87
91 BYTE VGASwitches; // 0x88
92 BYTE VGAFlags[2]; // 0x89
93 DWORD Reserved3; // 0x8b
94 BYTE Reserved4; // 0x8f
95 BYTE Reserved5[2]; // 0x90
96 BYTE Reserved6[2]; // 0x92
97 BYTE Reserved7[2]; // 0x94
98 WORD Reserved8; // 0x96
99 DWORD Reserved9; // 0x98
100 DWORD Reserved10; // 0x9c
101 DWORD Reserved11[2]; // 0xa0
102 DWORD EGAPtr; // 0xa8
103 BYTE Reserved12[68]; // 0xac
104 BYTE Reserved13[16]; // 0xf0
105
106 DWORD Reserved14; // 0x100
107 BYTE Reserved15[12]; // 0x104
108 BYTE Reserved16[17]; // 0x110
109 BYTE Reserved17[15]; // 0x121
110 BYTE Reserved18[3]; // 0x130
111 } BIOS_DATA_AREA, *PBIOS_DATA_AREA;
112 C_ASSERT(sizeof(BIOS_DATA_AREA) == 0x133);
113
114 /*
115 * BIOS Configuration Table at F000:E6F5 for 100% compatible BIOSes.
116 *
117 * See: http://www.ctyme.com/intr/rb-1594.htm
118 * for more information.
119 */
120 typedef struct _BIOS_CONFIG_TABLE
121 {
122 WORD Length; // 0x00
123 BYTE Model; // 0x02
124 BYTE SubModel; // 0x03
125 BYTE Revision; // 0x04
126 BYTE Feature[5]; // 0x05 -- 0x09
127 // Other BIOSes may extend this table. We don't.
128 } BIOS_CONFIG_TABLE, *PBIOS_CONFIG_TABLE;
129
130 #pragma pack(pop)
131
132 /* FUNCTIONS ******************************************************************/
133
134 extern PBIOS_DATA_AREA Bda;
135 extern PBIOS_CONFIG_TABLE Bct;
136
137 VOID WINAPI BiosEquipmentService(LPWORD Stack);
138 VOID WINAPI BiosGetMemorySize(LPWORD Stack);
139
140 BOOLEAN
141 BiosInitialize(IN LPCSTR BiosFileName);
142
143 VOID
144 BiosCleanup(VOID);
145
146 #endif // _BIOS_H_
147
148 /* EOF */