#include "ntvdm.h"
#include <debug.h>
#include "emulator.h"
#include "int32.h"
#include "../dem.h"
#include "dos.h"
#include "dosfiles.h"
#include "handle.h"
#include "memory.h"
#include "bios/bios.h"
Go to the source code of this file.
◆ FreeEnvironmentStrings
◆ NDEBUG
◆ DosBIOSInitialize()
setBP(0x091E); // DOS base stack pointer relic value
Definition at line 221 of file bios.c.
222{
225
226
228
229
231
232
233
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
259
260
261
262
263
264
265
266
267
268
269
271 {
274 }
275
276
277
278
280 {
281 DosDisplayMessage(
"An error occurred when setting up the system environment block.\n");
282 }
283
284
287 {
289 {
290
291 }
293 }
294
296}
#define BiosDisplayMessage(Format,...)
#define DosDisplayMessage(Format,...)
int CDECL fclose(FILE *file)
wchar_t *CDECL fgetws(wchar_t *s, int size, FILE *file)
FILE *CDECL _wfopen(const wchar_t *path, const wchar_t *mode)
BOOLEAN DosKRNLInitialize(VOID)
#define SEG_OFF_TO_PTR(seg, off)
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
BOOLEAN DosBuildSysEnvBlock(VOID)
struct _BIOS_DATA * PBIOS_DATA
#define BIOS_DATA_SEGMENT
VOID WINAPI setSP(USHORT)
VOID WINAPI setDS(USHORT)
VOID WINAPI setSS(USHORT)
Referenced by DosStart().
◆ DosBuildSysEnvBlock()
Definition at line 165 of file bios.c.
166{
169
170
171
172
173
174
175
176
179
180
181 while (*SourcePtr)
182 {
183
184
185
186
187
188
189
190 if (*SourcePtr !=
'=' &&
_strnicmp(SourcePtr,
"WINDIR", 6) != 0)
191 {
193
194
195 strcpy(DestPtr, SourcePtr);
196
197
198 Delim =
strchr(DestPtr,
'=');
199 if (Delim) *Delim = '\0';
201 if (Delim) *Delim = '=';
202
203 DestPtr +=
strlen(SourcePtr);
204
205
206 *(DestPtr++) = '\0';
207 }
208
209
210 SourcePtr +=
strlen(SourcePtr) + 1;
211 }
212
213 *DestPtr = '\0';
214
215
217
219}
#define _strnicmp(_String1, _String2, _MaxCount)
_ACRTIMP char *__cdecl strchr(const char *, int)
_ACRTIMP size_t __cdecl strlen(const char *)
PVOID PVOID PWCHAR PVOID Environment
#define FreeEnvironmentStrings
LPSTR WINAPI GetEnvironmentStrings(void)
Referenced by DosBIOSInitialize().
◆ DosCheckInput()
Definition at line 120 of file bios.c.
121{
123
125 {
126
129 }
130
132 {
135
136 if (!
Node->InputStatusRoutine)
return FALSE;
137
140 }
141 else
142 {
145 LONG LocationHigh = 0;
147
148 return ((Location !=
FileSize) || (LocationHigh != FileSizeHigh));
149 }
150}
#define ERROR_INVALID_HANDLE
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
PDOS_FILE_DESCRIPTOR DosGetHandleFileDescriptor(WORD DosHandle)
_Must_inspect_result_ _Out_ PLARGE_INTEGER FileSize
PDOS_DEVICE_NODE DosGetDriverNode(DWORD Driver)
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Referenced by DosInt21h().
◆ DosEchoCharacter()
Definition at line 48 of file bios.c.
49{
50 switch (Character)
51 {
52 case '\0':
53 {
54
55 break;
56 }
57
58 case '\b':
59 {
60
64 break;
65 }
66
67 default:
68 {
69
70
71
72
73 if (Character < 0x20 && Character != '\r' && Character != '\n')
74 {
76 Character += 'A' - 1;
77 }
78
79
81 }
82 }
83}
VOID DosPrintCharacter(WORD FileHandle, CHAR Character)
#define DOS_OUTPUT_HANDLE
Referenced by DosReadCharacter(), DosReadFile(), and DosReadLineBuffered().
◆ DosPrintCharacter()
Definition at line 152 of file bios.c.
153{
155
157
158
161 1,
163}
WORD DosWriteFile(WORD FileHandle, DWORD Buffer, WORD Count, LPWORD BytesWritten)
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
#define DOS_DATA_OFFSET(x)
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesWritten
Referenced by DosCharPrint(), DosControlBreak(), DosEchoCharacter(), and DosInt21h().
◆ DosReadCharacter()
Definition at line 85 of file bios.c.
86{
90
91
94 {
97 }
98
100 DPRINT(
"DosReadCharacter\n");
101
102
105 1,
107
108
110 {
111
113 }
114
115
118}
WORD DosReadFile(WORD FileHandle, DWORD Buffer, WORD Count, LPWORD BytesRead)
VOID DosEchoCharacter(CHAR Character)
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
Referenced by DosInt21h().
◆ BiosData