[NTVDM]
[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 #define BDA_SEGMENT 0x40
21 #define BIOS_SEGMENT 0xF000
22
23 #define BIOS_EQUIPMENT_LIST 0x2C // HACK: Disable FPU for now
24
25 /*
26 * BIOS Data Area at 0040:XXXX
27 *
28 * See: http://webpages.charter.net/danrollins/techhelp/0093.HTM
29 * and: http://www.bioscentral.com/misc/bda.htm
30 * for more information.
31 */
32 #pragma pack(push, 1)
33 typedef struct
34 {
35 WORD SerialPorts[4]; // 0x00
36 WORD ParallelPorts[3]; // 0x08
37 WORD EbdaSegment; // 0x0e - ParallelPort in PC/XT
38 WORD EquipmentList; // 0x10
39 BYTE Reserved0; // 0x12 - Errors in PCjr infrared keyboard link
40 WORD MemorySize; // 0x13
41 WORD Reserved1; // 0x15 - Scratch pad for manufacturing error tests
42 WORD KeybdShiftFlags; // 0x17
43 BYTE AlternateKeypad; // 0x19
44 WORD KeybdBufferHead; // 0x1a
45 WORD KeybdBufferTail; // 0x1c
46 WORD KeybdBuffer[BIOS_KBD_BUFFER_SIZE]; // 0x1e
47 BYTE DriveRecalibrate; // 0x3e
48 BYTE DriveMotorStatus; // 0x3f
49 BYTE MotorShutdownCounter; // 0x40
50 BYTE LastDisketteOperation; // 0x41
51 BYTE Reserved2[7]; // 0x42
52 BYTE VideoMode; // 0x49
53 WORD ScreenColumns; // 0x4a
54 WORD VideoPageSize; // 0x4c
55 WORD VideoPageOffset; // 0x4e
56 WORD CursorPosition[BIOS_MAX_PAGES]; // 0x50
57 BYTE CursorEndLine; // 0x60
58 BYTE CursorStartLine; // 0x61
59 BYTE VideoPage; // 0x62
60 WORD CrtBasePort; // 0x63
61 BYTE CrtModeControl; // 0x65
62 BYTE CrtColorPaletteMask; // 0x66
63 BYTE CassetteData[5]; // 0x67
64 DWORD TickCounter; // 0x6c
65 BYTE MidnightPassed; // 0x70
66 BYTE BreakFlag; // 0x71
67 WORD SoftReset; // 0x72
68 BYTE LastDiskOperation; // 0x74
69 BYTE NumDisks; // 0x75
70 BYTE DriveControlByte; // 0x76
71 BYTE DiskPortOffset; // 0x77
72 BYTE LptTimeOut[4]; // 0x78
73 BYTE ComTimeOut[4]; // 0x7c
74 WORD KeybdBufferStart; // 0x80
75 WORD KeybdBufferEnd; // 0x82
76 BYTE ScreenRows; // 0x84
77 WORD CharacterHeight; // 0x85
78 BYTE EGAFlags[2]; // 0x87
79 BYTE VGAFlags[2]; // 0x89
80 DWORD Reserved3; // 0x8b
81 BYTE Reserved4; // 0x8f
82 BYTE Reserved5[2]; // 0x90
83 BYTE Reserved6[2]; // 0x92
84 BYTE Reserved7[2]; // 0x94
85 WORD Reserved8; // 0x96
86 DWORD Reserved9; // 0x98
87 DWORD Reserved10; // 0x9c
88 DWORD Reserved11[2]; // 0xa0
89 DWORD EGAPtr; // 0xa8
90 BYTE Reserved12[68]; // 0xac
91 BYTE Reserved13[16]; // 0xf0
92
93 DWORD Reserved14; // 0x100
94 BYTE Reserved15[12]; // 0x104
95 BYTE Reserved16[17]; // 0x110
96 BYTE Reserved17[15]; // 0x121
97 BYTE Reserved18[3]; // 0x130
98 } BIOS_DATA_AREA, *PBIOS_DATA_AREA;
99 #pragma pack(pop)
100
101 C_ASSERT(sizeof(BIOS_DATA_AREA) == 0x133);
102
103 /* FUNCTIONS ******************************************************************/
104
105 extern PBIOS_DATA_AREA Bda;
106
107 VOID WINAPI BiosEquipmentService(LPWORD Stack);
108 VOID WINAPI BiosGetMemorySize(LPWORD Stack);
109
110 BOOLEAN
111 BiosInitialize(IN LPCSTR BiosFileName);
112
113 VOID
114 BiosCleanup(VOID);
115
116 #endif // _BIOS_H_
117
118 /* EOF */