ReactOS 0.4.15-dev-7931-gfd331f1
bios.h
Go to the documentation of this file.
1/*
2 * COPYRIGHT: GPL - See COPYING in the top level directory
3 * PROJECT: ReactOS Virtual DOS Machine
4 * FILE: subsystems/mvdm/ntvdm/bios/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 "kbdbios.h"
15#include "vidbios.h"
16
17/* DEFINES ********************************************************************/
18
19/* BOP Identifiers */
20#define BOP_RESET 0x00 // Windows NTVDM (SoftPC) BIOS calls BOP 0x00
21 // to let the virtual machine perform the POST.
22#define BOP_EQUIPLIST 0x11
23#define BOP_GETMEMSIZE 0x12
24
25
26
27
28#define BDA_SEGMENT 0x40
29#define BIOS_SEGMENT 0xF000
30
31#pragma pack(push, 1)
32
33/*
34 * BIOS Data Area at 0040:XXXX
35 *
36 * See: http://webpages.charter.net/danrollins/techhelp/0093.HTM
37 * and: http://www.bioscentral.com/misc/bda.htm
38 * for more information.
39 */
40typedef struct
41{
42 WORD SerialPorts[4]; // 0x00
43 WORD ParallelPorts[3]; // 0x08
44 WORD EbdaSegment; // 0x0e - ParallelPort in PC/XT
46 BYTE Reserved0; // 0x12 - Errors in PCjr infrared keyboard link
48 WORD Reserved1; // 0x15 - Scratch pad for manufacturing error tests
53 WORD KeybdBuffer[BIOS_KBD_BUFFER_SIZE]; // 0x1e
58 BYTE Reserved2[7]; // 0x42
59 BYTE VideoMode; // 0x49
66 BYTE VideoPage; // 0x62
70
71 union // 0x67
72 {
73 BYTE CassetteData[5]; // Cassette tape control (unused)
74 DWORD ResumeEntryPoint; // CS:IP for 286 return from Protected Mode
75 };
76
80 WORD SoftReset; // 0x72
82 BYTE NumDisks; // 0x75
85 BYTE LptTimeOut[4]; // 0x78
86 BYTE ComTimeOut[4]; // 0x7c
93 BYTE VGAFlags; // 0x89
96 BYTE Reserved4; // 0x8f
97 BYTE FloppyDriveState[2]; // 0x90
98 BYTE Reserved6[2]; // 0x92
99 BYTE Reserved7[2]; // 0x94
104 DWORD Reserved11[2]; // 0xa0
105 DWORD EGAPtr; // 0xa8
106 BYTE Reserved12[68]; // 0xac
107 BYTE Reserved13[16]; // 0xf0
109C_ASSERT(sizeof(BIOS_DATA_AREA) == 0x100);
110
111/*
112 * User Data Area at 0050:XXXX
113 *
114 * See: http://helppc.netcore2k.net/table/memory-map
115 * for more information.
116 */
117typedef struct
118{
120 BYTE Basic0[3]; // 0x01
122 BYTE PostArea[10]; // 0x05
123 BYTE Basic1; // 0x0f
124 WORD Basic2; // 0x10
125 DWORD Basic3; // 0x12
126 DWORD Basic4; // 0x16
127 DWORD Basic5; // 0x1a
130 BYTE DisketteInitStorage[14]; // 0x22
133C_ASSERT(sizeof(USER_DATA_AREA) == 0x34);
134
135/*
136 * BIOS Configuration Table at F000:E6F5 for 100% compatible BIOSes.
137 *
138 * See: http://www.ctyme.com/intr/rb-1594.htm
139 * for more information.
140 */
141typedef struct _BIOS_CONFIG_TABLE
142{
143 WORD Length; // 0x00 - Number of bytes following
144 BYTE Model; // 0x02
145 BYTE SubModel; // 0x03
146 BYTE Revision; // 0x04
147 BYTE Feature[5]; // 0x05 -- 0x09
148 // Other BIOSes may extend this table. We don't.
150
151#pragma pack(pop)
152
153/* FUNCTIONS ******************************************************************/
154
155extern PBIOS_DATA_AREA Bda;
157
160
162BiosInitialize(IN LPCSTR BiosFileName,
163 IN LPCSTR RomFiles OPTIONAL);
164
165VOID
167
168#endif // _BIOS_H_
169
170/* EOF */
unsigned char BOOLEAN
@ Reserved2
Definition: bcd.h:202
struct _BIOS_CONFIG_TABLE BIOS_CONFIG_TABLE
BOOLEAN BiosInitialize(IN LPCSTR BiosFileName, IN LPCSTR RomFiles OPTIONAL)
Definition: bios.c:60
PBIOS_CONFIG_TABLE Bct
Definition: bios.c:43
VOID BiosCleanup(VOID)
Definition: bios.c:153
PBIOS_DATA_AREA Bda
Definition: bios.c:42
VOID WINAPI BiosEquipmentService(LPWORD Stack)
Definition: bios32.c:200
VOID WINAPI BiosGetMemorySize(LPWORD Stack)
Definition: bios32.c:206
struct USER_DATA_AREA * PUSER_DATA_AREA
struct BIOS_DATA_AREA * PBIOS_DATA_AREA
struct _BIOS_CONFIG_TABLE * PBIOS_CONFIG_TABLE
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
#define C_ASSERT(e)
Definition: intsafe.h:73
#define BIOS_KBD_BUFFER_SIZE
Definition: kbdbios32.h:16
static USHORT CursorPosition
Definition: pc98cons.c:20
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
DWORD ResumeEntryPoint
Definition: bios.h:74
WORD KeybdBufferEnd
Definition: bios.h:88
BYTE CtrlBreakFlag
Definition: bios.h:79
BYTE NumDisks
Definition: bios.h:82
BYTE CursorEndLine
Definition: bios.h:64
DWORD EGAPtr
Definition: bios.h:105
BYTE AlternateKeypad
Definition: bios.h:50
BYTE KeybdStatusFlags
Definition: bios.h:100
WORD KeybdBufferHead
Definition: bios.h:51
BYTE CursorStartLine
Definition: bios.h:65
WORD KeybdBufferTail
Definition: bios.h:52
BYTE DriveControlByte
Definition: bios.h:83
WORD VideoPageSize
Definition: bios.h:61
DWORD TickCounter
Definition: bios.h:77
BYTE CrtModeControl
Definition: bios.h:68
BYTE DriveMotorStatus
Definition: bios.h:55
BYTE MotorShutdownCounter
Definition: bios.h:56
BYTE VideoMode
Definition: bios.h:59
BYTE VideoPage
Definition: bios.h:66
BYTE CrtColorPaletteMask
Definition: bios.h:69
BYTE Reserved0
Definition: bios.h:46
WORD CrtBasePort
Definition: bios.h:67
BYTE Reserved4
Definition: bios.h:96
BYTE KeybdLedFlags
Definition: bios.h:101
BYTE VGAOptions
Definition: bios.h:91
WORD SoftReset
Definition: bios.h:80
BYTE VGASwitches
Definition: bios.h:92
WORD CharacterHeight
Definition: bios.h:90
WORD KeybdShiftFlags
Definition: bios.h:49
BYTE ScreenRows
Definition: bios.h:89
WORD Reserved1
Definition: bios.h:48
BYTE LastDiskOperation
Definition: bios.h:81
DWORD Reserved3
Definition: bios.h:95
BYTE MidnightPassed
Definition: bios.h:78
BYTE LastDisketteOperation
Definition: bios.h:57
WORD VideoPageOffset
Definition: bios.h:62
WORD MemorySize
Definition: bios.h:47
WORD EquipmentList
Definition: bios.h:45
WORD EbdaSegment
Definition: bios.h:44
BYTE DiskPortOffset
Definition: bios.h:84
WORD KeybdBufferStart
Definition: bios.h:87
BYTE VGADccIDActive
Definition: bios.h:94
DWORD Reserved9
Definition: bios.h:102
BYTE VGAFlags
Definition: bios.h:93
DWORD Reserved10
Definition: bios.h:103
BYTE DriveRecalibrate
Definition: bios.h:54
WORD ScreenColumns
Definition: bios.h:60
WORD DynStorage
Definition: bios.h:129
BYTE Basic1
Definition: bios.h:123
WORD Basic2
Definition: bios.h:124
DWORD Reserved1
Definition: bios.h:131
BYTE PrintScreen
Definition: bios.h:119
DWORD Basic4
Definition: bios.h:126
DWORD Basic5
Definition: bios.h:127
DWORD Basic3
Definition: bios.h:125
BYTE SingleDisketteFlag
Definition: bios.h:121
WORD Reserved0
Definition: bios.h:128
BYTE Feature[5]
Definition: bios.h:147
@ Reserved7
Definition: tvratings.idl:14
uint16_t * LPWORD
Definition: typedefs.h:56
#define IN
Definition: typedefs.h:39
#define BIOS_MAX_PAGES
Definition: vidbios.h:19
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:639
#define WINAPI
Definition: msvc.h:6
const char * LPCSTR
Definition: xmlstorage.h:183
unsigned char BYTE
Definition: xxhash.c:193