ReactOS 0.4.16-dev-2633-g8dc9e50
x86bios.c File Reference
#include <hal.h>
#include <debug.h>
#include <fast486.h>
Include dependency graph for x86bios.c:

Go to the source code of this file.

Functions

VOID NTAPI DbgDumpPage (PUCHAR MemBuffer, USHORT Segment)
 
VOID NTAPI HalInitializeBios (_In_ ULONG Phase, _In_ PLOADER_PARAMETER_BLOCK LoaderBlock)
 
NTSTATUS NTAPI x86BiosAllocateBuffer (_Inout_ ULONG *Size, _Out_ USHORT *Segment, _Out_ USHORT *Offset)
 
NTSTATUS NTAPI x86BiosFreeBuffer (_In_ USHORT Segment, _In_ USHORT Offset)
 
NTSTATUS NTAPI x86BiosReadMemory (_In_ USHORT Segment, _In_ USHORT Offset, _Out_writes_bytes_(Size) PVOID Buffer, _In_ ULONG Size)
 
NTSTATUS NTAPI x86BiosWriteMemory (_In_ USHORT Segment, _In_ USHORT Offset, _In_reads_bytes_(Size) PVOID Buffer, _In_ ULONG Size)
 
static VOID FASTCALL x86MemRead (PFAST486_STATE State, ULONG Address, PVOID Buffer, ULONG Size)
 
static VOID FASTCALL x86MemWrite (PFAST486_STATE State, ULONG Address, PVOID Buffer, ULONG Size)
 
static BOOLEAN ValidatePort (USHORT Port, UCHAR Size, BOOLEAN IsWrite)
 
static VOID FASTCALL x86IoRead (PFAST486_STATE State, USHORT Port, PVOID Buffer, ULONG DataCount, UCHAR DataSize)
 
static VOID FASTCALL x86IoWrite (PFAST486_STATE State, USHORT Port, PVOID Buffer, ULONG DataCount, UCHAR DataSize)
 
static VOID FASTCALL x86BOP (PFAST486_STATE State, UCHAR BopCode)
 
static UCHAR FASTCALL x86IntAck (PFAST486_STATE State)
 
BOOLEAN NTAPI x86BiosCall (_In_ ULONG InterruptNumber, _Inout_ PX86_BIOS_REGISTERS Registers)
 

Variables

PFN_NUMBER x86BiosFallbackPfn
 
BOOLEAN x86BiosIsInitialized
 
LONG x86BiosBufferIsAllocated = 0
 
PUCHAR x86BiosMemoryMapping
 
ULONG64 x86BiosBufferPhysical
 

Function Documentation

◆ DbgDumpPage()

VOID NTAPI DbgDumpPage ( PUCHAR  MemBuffer,
USHORT  Segment 
)

Definition at line 31 of file x86bios.c.

32{
33 ULONG x, y, Offset;
34
35 for (y = 0; y < 0x100; y++)
36 {
37 for (x = 0; x < 0x10; x++)
38 {
39 Offset = Segment * 16 + y * 16 + x;
40 DbgPrint("%02x ", MemBuffer[Offset]);
41 }
42 DbgPrint("\n");
43 }
44}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define DbgPrint
Definition: hal.h:12
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
uint32_t ULONG
Definition: typedefs.h:59
_Inout_ PVOID Segment
Definition: exfuncs.h:1101

◆ HalInitializeBios()

VOID NTAPI HalInitializeBios ( _In_ ULONG  Phase,
_In_ PLOADER_PARAMETER_BLOCK  LoaderBlock 
)

Definition at line 48 of file x86bios.c.

51{
52 PPFN_NUMBER PfnArray;
53 PFN_NUMBER Pfn, Last;
55 PLIST_ENTRY ListEntry;
56 PMDL Mdl;
58
59 if (HalBootViaEfi)
60 return;
61
62 if (Phase == 0)
63 {
64 /* Allocate one page for a fallback mapping */
66 0x100000,
67 1,
68 FALSE);
69 if (PhysicalAddress == 0)
70 {
72 }
73
76
77 /* Allocate a page for the buffer allocation */
79 0x100000,
80 1,
81 FALSE);
82 if (x86BiosBufferPhysical == 0)
83 {
85 }
86 }
87 else
88 {
89
90 /* Allocate an MDL for 1MB */
91 Mdl = IoAllocateMdl(NULL, 0x100000, FALSE, FALSE, NULL);
92 if (!Mdl)
93 {
95 }
96
97 /* Get pointer to the pfn array */
98 PfnArray = MmGetMdlPfnArray(Mdl);
99
100 /* Fill the array with the fallback page */
101 for (Pfn = 0; Pfn < 0x100; Pfn++)
102 {
103 PfnArray[Pfn] = x86BiosFallbackPfn;
104 }
105
106 /* Loop the memory descriptors */
107 for (ListEntry = LoaderBlock->MemoryDescriptorListHead.Flink;
108 ListEntry != &LoaderBlock->MemoryDescriptorListHead;
109 ListEntry = ListEntry->Flink)
110 {
111 /* Get the memory descriptor */
112 Descriptor = CONTAINING_RECORD(ListEntry,
114 ListEntry);
115
116 /* Check if the memory is in the low 1 MB range */
117 if (Descriptor->BasePage < 0x100)
118 {
119 /* Check if the memory type is firmware */
120 if ((Descriptor->MemoryType == LoaderFirmwarePermanent) ||
121 (Descriptor->MemoryType == LoaderSpecialMemory))
122 {
123 /* It's firmware, so map it! */
124 Last = min(Descriptor->BasePage + Descriptor->PageCount, 0x100);
125 for (Pfn = Descriptor->BasePage; Pfn < Last; Pfn++)
126 {
127 /* Set each physical page in the MDL */
128 PfnArray[Pfn] = Pfn;
129 }
130 }
131 }
132 }
133
134 /* Map this page proper, too */
136 PfnArray[Pfn] = Pfn;
137
138 Mdl->MdlFlags = MDL_PAGES_LOCKED;
139
140 /* Map the MDL to system space */
143
144 DPRINT1("*x86BiosMemoryMapping: %p, %p\n",
146 //DbgDumpPage(x86BiosMemoryMapping, 0xc351);
147
149 }
150}
ULONG_PTR PFN_NUMBER
#define DPRINT1
Definition: precomp.h:8
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define PAGE_SIZE
Definition: env_spec_w32.h:49
#define IoAllocateMdl
Definition: fxmdl.h:88
ULONG64 NTAPI HalpAllocPhysicalMemory(IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN ULONG64 MaxAddress, IN PFN_NUMBER PageCount, IN BOOLEAN Aligned)
Definition: memory.c:29
BOOLEAN HalBootViaEfi
Definition: halinit.c:21
#define ASSERT(a)
Definition: mode.c:44
unsigned __int64 ULONG64
Definition: imports.h:198
@ HighPagePriority
Definition: imports.h:55
#define min(a, b)
Definition: monoChain.cc:55
@ LoaderFirmwarePermanent
Definition: arc.h:299
@ LoaderSpecialMemory
Definition: arc.h:315
ULONG * PPFN_NUMBER
Definition: ke.h:9
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:342
BOOLEAN x86BiosIsInitialized
Definition: x86bios.c:22
PUCHAR x86BiosMemoryMapping
Definition: x86bios.c:24
ULONG64 x86BiosBufferPhysical
Definition: x86bios.c:27
PFN_NUMBER x86BiosFallbackPfn
Definition: x86bios.c:20
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS PhysicalAddress
Definition: iotypes.h:1098
#define MmGetSystemAddressForMdlSafe(_Mdl, _Priority)
#define MmGetMdlPfnArray(_Mdl)
#define MDL_PAGES_LOCKED
Definition: mmtypes.h:19

Referenced by HalInitSystem().

◆ ValidatePort()

static BOOLEAN ValidatePort ( USHORT  Port,
UCHAR  Size,
BOOLEAN  IsWrite 
)
static

Definition at line 302 of file x86bios.c.

306{
307 switch (Port)
308 {
309 // VGA: https://wiki.osdev.org/VGA_Hardware#Port_0x3C0
310 case 0x3C0: return (Size == 1) && IsWrite;
311 case 0x3C1: return (Size == 1) && !IsWrite;
312 case 0x3C2: return (Size == 1) && IsWrite;
313 case 0x3C4: return IsWrite;
314 case 0x3C5: return (Size <= 2);
315 case 0x3C7: return (Size == 1) && IsWrite;
316 case 0x3CC: return (Size == 1) && !IsWrite;
317 case 0x3CE: return IsWrite;
318 case 0x3CF: return (Size <= 2);
319 case 0x3D4: return IsWrite;
320 case 0x3D5: return (Size <= 2);
321 case 0x3C6: return (Size == 1);
322 case 0x3C8: return (Size == 1) && IsWrite;
323 case 0x3C9: return (Size == 1);
324 case 0x3DA: return (Size == 1) && !IsWrite;
325
326 // OVMF debug messages used by VBox / QEMU
327 // https://www.virtualbox.org/svn/vbox/trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/README
328 case 0x402: return (Size == 1) && IsWrite;
329
330 // BOCHS VBE: https://forum.osdev.org/viewtopic.php?f=1&t=14639
331 case 0x1CE: return (Size == 1) && IsWrite;
332 case 0x1CF: return (Size == 1);
333
334 // CHECKME!
335 case 0x3B6: return (Size <= 2);
336 }
337
338 /* Allow but report unknown ports, we trust the BIOS for now */
339 DPRINT1("Unknown port 0x%x, size %d, write %d\n", Port, Size, IsWrite);
340 return TRUE;
341}
CPPORT Port[4]
Definition: headless.c:38
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539

Referenced by x86IoRead(), and x86IoWrite().

◆ x86BiosAllocateBuffer()

NTSTATUS NTAPI x86BiosAllocateBuffer ( _Inout_ ULONG Size,
_Out_ USHORT Segment,
_Out_ USHORT Offset 
)

Definition at line 154 of file x86bios.c.

158{
159 /* Check if the system is initialized and the buffer is large enough */
161 {
162 /* Something was wrong, fail! */
164 }
165
166 /* Check if the buffer is already allocated */
168 {
169 /* Buffer was already allocated, fail */
171 }
172
173 /* The buffer is sufficient, return hardcoded address and size */
174 *Size = PAGE_SIZE;
176 *Offset = 0;
177
178 return STATUS_SUCCESS;
179}
#define InterlockedBitTestAndSet
Definition: interlocked.h:30
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
LONG x86BiosBufferIsAllocated
Definition: x86bios.c:23

Referenced by IntInitializeX86Emu(), and IntInt10AllocateBufferEmu().

◆ x86BiosCall()

BOOLEAN NTAPI x86BiosCall ( _In_ ULONG  InterruptNumber,
_Inout_ PX86_BIOS_REGISTERS  Registers 
)

Definition at line 413 of file x86bios.c.

416{
417 const ULONG StackBase = 0x2000;
418 FAST486_STATE EmulatorContext;
419 ULONG FlatIp;
420 PUCHAR InstructionPointer;
421
423 return FALSE;
424
425 /* Initialize the emulator context */
429 x86IoRead,
431 x86BOP,
432 x86IntAck,
433 NULL, // FpuCallback,
434 NULL); // Tlb
435
436 /* Copy the GP registers */
437 EmulatorContext.GeneralRegs[FAST486_REG_EAX].Long = Registers->Eax;
438 EmulatorContext.GeneralRegs[FAST486_REG_EBX].Long = Registers->Ebx;
439 EmulatorContext.GeneralRegs[FAST486_REG_ECX].Long = Registers->Ecx;
440 EmulatorContext.GeneralRegs[FAST486_REG_EDX].Long = Registers->Edx;
441 EmulatorContext.GeneralRegs[FAST486_REG_ESI].Long = Registers->Esi;
442 EmulatorContext.GeneralRegs[FAST486_REG_EDI].Long = Registers->Edi;
443
444 /* Initialize segment registers */
445 Fast486SetSegment(&EmulatorContext, FAST486_REG_DS, Registers->SegDs);
446 Fast486SetSegment(&EmulatorContext, FAST486_REG_ES, Registers->SegEs);
447
448 /* Set Eflags */
449 EmulatorContext.Flags.Long = 0;
450 EmulatorContext.Flags.AlwaysSet = 1;
451 EmulatorContext.Flags.If = 1;
452
453 /* Set up the INT stub */
454 FlatIp = StackBase - 4;
455 InstructionPointer = x86BiosMemoryMapping + FlatIp;
456 InstructionPointer[0] = 0xCD; // INT instruction
457 InstructionPointer[1] = (UCHAR)InterruptNumber;
458 InstructionPointer[2] = 0x90; // NOP. We will stop at this address.
459
460 /* Set the stack pointer */
461 Fast486SetStack(&EmulatorContext, 0, StackBase - 8);
462
463 /* Start execution at the INT stub */
464 Fast486ExecuteAt(&EmulatorContext, 0x00, FlatIp);
465
466 while (TRUE)
467 {
468 /* Get the current flat IP */
469 FlatIp = (EmulatorContext.SegmentRegs[FAST486_REG_CS].Selector << 4) +
470 EmulatorContext.InstPtr.Long;
471
472 /* Make sure we haven't left the allowed memory range */
473 if (FlatIp >= 0x100000)
474 {
475 DPRINT1("x86BiosCall: invalid IP (0x%lx) during BIOS execution\n", FlatIp);
476 return FALSE;
477 }
478
479 /* Check if we returned from our int stub */
480 if (FlatIp == (StackBase - 2))
481 {
482 /* We are done! */
483 break;
484 }
485
486 /* Emulate one instruction */
488 }
489
490 /* Copy the registers back */
491 Registers->Eax = EmulatorContext.GeneralRegs[FAST486_REG_EAX].Long;
492 Registers->Ebx = EmulatorContext.GeneralRegs[FAST486_REG_EBX].Long;
493 Registers->Ecx = EmulatorContext.GeneralRegs[FAST486_REG_ECX].Long;
494 Registers->Edx = EmulatorContext.GeneralRegs[FAST486_REG_EDX].Long;
495 Registers->Esi = EmulatorContext.GeneralRegs[FAST486_REG_ESI].Long;
496 Registers->Edi = EmulatorContext.GeneralRegs[FAST486_REG_EDI].Long;
497 Registers->SegDs = EmulatorContext.SegmentRegs[FAST486_REG_DS].Selector;
498 Registers->SegEs = EmulatorContext.SegmentRegs[FAST486_REG_ES].Selector;
499
500 return TRUE;
501}
VOID NTAPI Fast486SetStack(PFAST486_STATE State, USHORT Segment, ULONG Offset)
Definition: fast486.c:227
VOID NTAPI Fast486Initialize(PFAST486_STATE State, FAST486_MEM_READ_PROC MemReadCallback, FAST486_MEM_WRITE_PROC MemWriteCallback, FAST486_IO_READ_PROC IoReadCallback, FAST486_IO_WRITE_PROC IoWriteCallback, FAST486_BOP_PROC BopCallback, FAST486_INT_ACK_PROC IntAckCallback, FAST486_FPU_PROC FpuCallback, PULONG Tlb)
Definition: fast486.c:103
VOID NTAPI Fast486SetSegment(PFAST486_STATE State, FAST486_SEG_REGS Segment, USHORT Selector)
Definition: fast486.c:242
VOID NTAPI Fast486ExecuteAt(PFAST486_STATE State, USHORT Segment, ULONG Offset)
Definition: fast486.c:212
if(dx< 0)
Definition: linetemp.h:194
VOID NTAPI Fast486StepInto(PFAST486_STATE State)
Definition: debug.c:248
FAST486_STATE EmulatorContext
Definition: cpu.c:39
unsigned char UCHAR
Definition: typedefs.h:53
unsigned char * PUCHAR
Definition: typedefs.h:53
static VOID FASTCALL x86IoRead(PFAST486_STATE State, USHORT Port, PVOID Buffer, ULONG DataCount, UCHAR DataSize)
Definition: x86bios.c:346
static VOID FASTCALL x86MemWrite(PFAST486_STATE State, ULONG Address, PVOID Buffer, ULONG Size)
Definition: x86bios.c:283
static VOID FASTCALL x86MemRead(PFAST486_STATE State, ULONG Address, PVOID Buffer, ULONG Size)
Definition: x86bios.c:262
static UCHAR FASTCALL x86IntAck(PFAST486_STATE State)
Definition: x86bios.c:404
static VOID FASTCALL x86IoWrite(PFAST486_STATE State, USHORT Port, PVOID Buffer, ULONG DataCount, UCHAR DataSize)
Definition: x86bios.c:370
static VOID FASTCALL x86BOP(PFAST486_STATE State, UCHAR BopCode)
Definition: x86bios.c:394

Referenced by IntInitializeX86Emu(), and IntInt10CallBiosEmu().

◆ x86BiosFreeBuffer()

NTSTATUS NTAPI x86BiosFreeBuffer ( _In_ USHORT  Segment,
_In_ USHORT  Offset 
)

Definition at line 183 of file x86bios.c.

186{
187 /* Check if the system is initialized and if the address matches */
188 if (!x86BiosIsInitialized || (Segment != 0x2000) || (Offset != 0))
189 {
190 /* Something was wrong, fail */
192 }
193
194 /* Check if the buffer was allocated */
196 {
197 /* It was not, fail */
199 }
200
201 /* Buffer is freed, nothing more to do */
202 return STATUS_SUCCESS;
203}
#define InterlockedBitTestAndReset
Definition: interlocked.h:35
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135

Referenced by IntInitializeX86Emu(), and IntInt10FreeBufferEmu().

◆ x86BiosReadMemory()

NTSTATUS NTAPI x86BiosReadMemory ( _In_ USHORT  Segment,
_In_ USHORT  Offset,
_Out_writes_bytes_(Size) PVOID  Buffer,
_In_ ULONG  Size 
)

Definition at line 207 of file x86bios.c.

212{
214
215 /* Calculate the physical address */
216 Address = (Segment << 4) + Offset;
217
218 /* Check if it's valid */
219 if (!x86BiosIsInitialized || ((Address + Size) > 0x100000))
220 {
221 /* Invalid */
223 }
224
225 /* Copy the memory to the buffer */
227
228 /* Return success */
229 return STATUS_SUCCESS;
230}
Definition: bufpool.h:45
static WCHAR Address[46]
Definition: ping.c:68
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
uint32_t ULONG_PTR
Definition: typedefs.h:65

Referenced by IntInitializeX86Emu(), and IntInt10ReadMemoryEmu().

◆ x86BiosWriteMemory()

NTSTATUS NTAPI x86BiosWriteMemory ( _In_ USHORT  Segment,
_In_ USHORT  Offset,
_In_reads_bytes_(Size) PVOID  Buffer,
_In_ ULONG  Size 
)

Definition at line 234 of file x86bios.c.

239{
241
242 /* Calculate the physical address */
243 Address = (Segment << 4) + Offset;
244
245 /* Check if it's valid */
246 if (!x86BiosIsInitialized || ((Address + Size) > 0x100000))
247 {
248 /* Invalid */
250 }
251
252 /* Copy the memory from the buffer */
254
255 /* Return success */
256 return STATUS_SUCCESS;
257}

Referenced by IntInitializeX86Emu(), and IntInt10WriteMemoryEmu().

◆ x86BOP()

static VOID FASTCALL x86BOP ( PFAST486_STATE  State,
UCHAR  BopCode 
)
static

Definition at line 394 of file x86bios.c.

397{
398 ASSERT(FALSE);
399}

Referenced by x86BiosCall().

◆ x86IntAck()

static UCHAR FASTCALL x86IntAck ( PFAST486_STATE  State)
static

Definition at line 404 of file x86bios.c.

406{
407 ASSERT(FALSE);
408 return 0;
409}

Referenced by x86BiosCall().

◆ x86IoRead()

static VOID FASTCALL x86IoRead ( PFAST486_STATE  State,
USHORT  Port,
PVOID  Buffer,
ULONG  DataCount,
UCHAR  DataSize 
)
static

Definition at line 346 of file x86bios.c.

352{
353 /* Validate the port */
355 {
356 DPRINT1("Invalid IO port read access (port: 0x%x, count: 0x%x)\n", Port, DataSize);
357 }
358
359 switch (DataSize)
360 {
361 case 1: READ_PORT_BUFFER_UCHAR((PUCHAR)(ULONG_PTR)Port, Buffer, DataCount); return;
362 case 2: READ_PORT_BUFFER_USHORT((PUSHORT)(ULONG_PTR)Port, Buffer, DataCount); return;
363 case 4: READ_PORT_BUFFER_ULONG((PULONG)(ULONG_PTR)Port, Buffer, DataCount); return;
364 }
365}
#define READ_PORT_BUFFER_UCHAR(port, buffer, count)
Definition: hardware.h:30
#define READ_PORT_BUFFER_ULONG(port, buffer, count)
Definition: hardware.h:32
#define READ_PORT_BUFFER_USHORT(port, buffer, count)
Definition: hardware.h:31
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4755
uint32_t * PULONG
Definition: typedefs.h:59
uint16_t * PUSHORT
Definition: typedefs.h:56
static BOOLEAN ValidatePort(USHORT Port, UCHAR Size, BOOLEAN IsWrite)
Definition: x86bios.c:302

Referenced by x86BiosCall().

◆ x86IoWrite()

static VOID FASTCALL x86IoWrite ( PFAST486_STATE  State,
USHORT  Port,
PVOID  Buffer,
ULONG  DataCount,
UCHAR  DataSize 
)
static

Definition at line 370 of file x86bios.c.

376{
377 /* Validate the port */
379 {
380 DPRINT1("Invalid IO port write access (port: 0x%x, count: 0x%x)\n", Port, DataSize);
381 }
382
383 switch (DataSize)
384 {
385 case 1: WRITE_PORT_BUFFER_UCHAR((PUCHAR)(ULONG_PTR)Port, Buffer, DataCount); return;
386 case 2: WRITE_PORT_BUFFER_USHORT((PUSHORT)(ULONG_PTR)Port, Buffer, DataCount); return;
387 case 4: WRITE_PORT_BUFFER_ULONG((PULONG)(ULONG_PTR)Port, Buffer, DataCount); return;
388 }
389}
#define WRITE_PORT_BUFFER_ULONG(port, buffer, count)
Definition: hardware.h:35
#define WRITE_PORT_BUFFER_USHORT(port, buffer, count)
Definition: hardware.h:34
#define WRITE_PORT_BUFFER_UCHAR(port, buffer, count)
Definition: hardware.h:33

Referenced by x86BiosCall().

◆ x86MemRead()

static VOID FASTCALL x86MemRead ( PFAST486_STATE  State,
ULONG  Address,
PVOID  Buffer,
ULONG  Size 
)
static

Definition at line 262 of file x86bios.c.

267{
268 /* Validate the address range */
269 if (((ULONG64)Address + Size) < 0x100000)
270 {
272 }
273 else
274 {
275 RtlFillMemory(Buffer, Size, 0xCC);
276 DPRINT1("x86MemRead: invalid read at 0x%lx (size 0x%lx)\n", Address, Size);
277 }
278}
#define RtlFillMemory(Dest, Length, Fill)
Definition: winternl.h:603

Referenced by x86BiosCall().

◆ x86MemWrite()

static VOID FASTCALL x86MemWrite ( PFAST486_STATE  State,
ULONG  Address,
PVOID  Buffer,
ULONG  Size 
)
static

Definition at line 283 of file x86bios.c.

288{
289 /* Validate the address range */
290 if (((ULONG64)Address + Size) < 0x100000)
291 {
293 }
294 else
295 {
296 DPRINT1("x86MemWrite: invalid write at 0x%lx (size 0x%lx)\n", Address, Size);
297 }
298}

Referenced by x86BiosCall().

Variable Documentation

◆ x86BiosBufferIsAllocated

LONG x86BiosBufferIsAllocated = 0

Definition at line 23 of file x86bios.c.

Referenced by x86BiosAllocateBuffer(), and x86BiosFreeBuffer().

◆ x86BiosBufferPhysical

ULONG64 x86BiosBufferPhysical

Definition at line 27 of file x86bios.c.

Referenced by HalInitializeBios(), and x86BiosAllocateBuffer().

◆ x86BiosFallbackPfn

PFN_NUMBER x86BiosFallbackPfn

Definition at line 20 of file x86bios.c.

Referenced by HalInitializeBios().

◆ x86BiosIsInitialized

◆ x86BiosMemoryMapping

PUCHAR x86BiosMemoryMapping