15#include <reactos/buildno.h>
16#include <reactos/version.h>
110#define BIOS_MODEL 0xFC
111#define BIOS_SUBMODEL 0x01
112#define BIOS_REVISION 0x00
138static const CHAR BiosCopyright[] =
"0000000 NTVDM IBM COMPATIBLE 486 BIOS COPYRIGHT (C) ReactOS Team 1996-"COPYRIGHT_YEAR;
139static const CHAR BiosVersion[] =
"ReactOS NTVDM 32-bit BIOS Version "KERNEL_VERSION_STR
"\0"
140 "BIOS32 Version "KERNEL_VERSION_STR
" (Build "KERNEL_VERSION_BUILD_STR
")";
150 0x5B, 0xE0, 0x00, 0xF0,
234 static DWORD StartingCount;
250 if (
getAL() & (1 << 4))
301 DPRINT1(
"INT 15h, AH = 41h - Unknown condition type: %u\n",
getAL() & 7);
331 static ULONG CompletionTime = 0;
363 DWORD SourceBase = Gdt[2].Base + (Gdt[2].BaseMid << 16) + (Gdt[2].BaseHigh << 24);
364 DWORD SourceLimit = Gdt[2].Limit + (Gdt[2].LimitHigh << 16);
365 DWORD DestBase = Gdt[3].Base + (Gdt[3].BaseMid << 16) + (Gdt[3].BaseHigh << 24);
366 DWORD DestLimit = Gdt[3].Limit + (Gdt[3].LimitHigh << 16);
369 if (Gdt[2].Granularity) SourceLimit = (SourceLimit << 12) | 0xFFF;
370 if (Gdt[3].Granularity) DestLimit = (DestLimit << 12) | 0xFFF;
372 if ((
Count > SourceLimit) || (
Count > DestLimit))
412 DPRINT1(
"BIOS INT 15h, AH=89h \"Switch to Protected Mode\" is UNIMPLEMENTED");
528 DPRINT1(
"BIOS Function INT 15h, AH = 0xE8 - unexpected AL = %02X, EDX = %08X\n",
537 DPRINT1(
"BIOS Function INT 15h, AH = 0x%02X NOT IMPLEMENTED\n",
557 DisplayMessage(
L"NTVDM doesn't support ROM Basic. The VDM is closing.");
599 DPRINT(
"BiosBootstrapLoader (BootOrder = 0x%02X) -->\n", BootOrder);
609 BootOrder = 0xFF00 | ((1 << (4 * BootOrder)) & 0xFF);
612 switch (BootOrder & 0x0F)
627#ifdef ADVANCED_DEBUGGING
628 DPRINT1(
"An error happened while loading the bootsector from floppy 0, error = %d\n",
getAH());
647#ifdef ADVANCED_DEBUGGING
648 DPRINT1(
"An error happened while loading the bootsector from HDD 0, error = %d\n",
getAH());
659 BootOrder = (BootOrder >> 4) | 0xF000;
687 DPRINT(
"<-- BiosBootstrapLoader\n");
739 setDL(StatusB & 0x01);
780 DPRINT1(
"BIOS Function INT 1Ah, AH = 0x%02X NOT IMPLEMENTED\n",
796 UCHAR pic1off = off, pic1on = on, pic2off = off>>8, pic2on = on>>8;
841 DPRINT(
"Master - IrqNumber = 0x%02X\n", IrqNumber);
853 DPRINT(
"Slave - IrqNumber = 0x%02X\n", IrqNumber);
975#if defined(ADVANCED_DEBUGGING) && (ADVANCED_DEBUGGING_LEVEL >= 3)
977 for (
i = 0x00;
i <= 0xFF;
i++)
982 for (
i = 0x00;
i <= 0x07;
i++)
1071 BYTE ShutdownStatus;
1104 DPRINT1(
"Bda->SoftReset = 0x%04X ; ShutdownStatus = 0x%02X\n",
1107 switch (ShutdownStatus)
1110 case 0x01:
case 0x02:
case 0x03:
1112 case 0x06:
case 0x07:
case 0x08:
1116 DisplayMessage(
L"Unsupported CMOS Shutdown Status value 0x%02X. The VDM will shut down.", ShutdownStatus);
1124 DPRINT1(
"Fast restart to Bootstrap Loader...\n");
1146 DPRINT1(
"Bda->ResumeEntryPoint = %04X:%04X\n",
1176 DisplayMessage(
L"NTVDM is performing a COLD reboot! The program you are currently testing does not seem to behave correctly! The VDM will shut down...");
1185 DisplayMessage(
L"NTVDM is performing a WARM reboot! This is not supported at the moment. The VDM will shut down...");
INT __cdecl DisplayMessage(_In_opt_ HWND hWnd, _In_ UINT uType, _In_opt_ PCWSTR pszTitle, _In_opt_ PCWSTR pszFormatMessage,...)
static VOID WINAPI BiosException(LPWORD Stack)
static const CHAR BiosVersion[]
static VOID BiosCharPrint(CHAR Character)
static VOID WINAPI BiosHandleSlavePicIRQ(LPWORD Stack)
static VOID WINAPI BiosSystemTimerInterrupt(LPWORD Stack)
static VOID InitializeBiosData(VOID)
static VOID BiosHwSetup(VOID)
static const CHAR BiosDate[]
static VOID PicSetIRQMask(USHORT off, USHORT on)
static VOID WINAPI BiosBootstrapLoader(LPWORD Stack)
VOID PicIRQComplete(BYTE IntNum)
static VOID WINAPI BiosTimeService(LPWORD Stack)
static const BYTE PostCode[]
static const CHAR BiosCopyright[]
static VOID WINAPI BiosMiscService(LPWORD Stack)
static VOID WINAPI BiosHandleMasterPicIRQ(LPWORD Stack)
BOOLEAN Bios32Initialize(VOID)
static VOID WINAPI BiosRomBasic(LPWORD Stack)
VOID DosBootsectorInitialize(VOID)
static VOID WINAPI BiosTimerIrq(LPWORD Stack)
VOID WINAPI BiosDiskService(LPWORD Stack)
VOID WINAPI BiosEquipmentService(LPWORD Stack)
VOID WINAPI BiosGetMemorySize(LPWORD Stack)
VOID WINAPI Bios32Post(LPWORD Stack)
static const BYTE Bootstrap[]
static VOID InitializeBiosInt32(VOID)
VOID EnableHwIRQ(UCHAR hwirq, EMULATOR_INT32_PROC func)
static const BIOS_CONFIG_TABLE BiosConfigTable
#define BIOS_SYS_TIMER_INTERRUPT
#define RegisterBiosInt32(IntNumber, IntHandler)
#define BIOS_EQUIPMENT_INTERRUPT
#define BIOS_TIME_INTERRUPT
#define BIOS_PIC_SLAVE_INT
#define BIOS_MISC_INTERRUPT
#define BIOS_BOOTSTRAP_LOADER
#define BIOS_PIC_MASTER_INT
struct _BIOS_CONFIG_TABLE BIOS_CONFIG_TABLE
VOID RegisterBop(BYTE BopCode, EMULATOR_BOP_PROC BopHandler)
_In_ PSCSI_REQUEST_BLOCK _Out_ NTSTATUS _Inout_ BOOLEAN * Retry
@ CMOS_REG_ACTUAL_EXT_MEMORY_LOW
@ CMOS_REG_SHUTDOWN_STATUS
@ CMOS_REG_BASE_MEMORY_HIGH
@ CMOS_REG_BASE_MEMORY_LOW
@ CMOS_REG_ACTUAL_EXT_MEMORY_HIGH
@ CMOS_REG_EQUIPMENT_LIST
#define CMOS_ADDRESS_PORT
DWORD WINAPI GetTickCount(VOID)
VOID DiskBios32Post(VOID)
BOOLEAN DiskBios32Initialize(VOID)
VOID DiskBios32Cleanup(VOID)
VOID EmulatorTerminate(VOID)
VOID EmulatorException(BYTE ExceptionNumber, LPWORD Stack)
#define TO_LINEAR(seg, off)
#define SEG_OFF_TO_PTR(seg, off)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
VOID Int32Call(IN PCALLBACK16 Context, IN BYTE IntNumber)
VOID(WINAPI * EMULATOR_INT32_PROC)(LPWORD Stack)
VOID KbdBiosCleanup(VOID)
BOOLEAN KbdBiosInitialize(VOID)
VOID MouseBios32Post(VOID)
BOOLEAN MouseBiosInitialize(VOID)
VOID MouseBios32Cleanup(VOID)
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
_In_ ULONG _In_ ULONG Offset
_In_ ULONG _In_ ULONG _In_ ULONG Length
VOID PrintMessageAnsi(IN CHAR_PRINT CharPrint, IN LPCSTR Format,...)
struct BIOS_MEMORY_MAP * PBIOS_MEMORY_MAP
VOID SearchAndInitRoms(IN PCALLBACK16 Context)
BOOLEAN WriteProtectRom(IN PVOID RomLocation, IN ULONG RomSize)
VOID InitializeContext(IN PCALLBACK16 Context, IN USHORT Segment, IN USHORT Offset)
#define PIC_OCW3_READ_ISR
VOID IOWriteB(USHORT Port, UCHAR Buffer)
UCHAR IOReadB(USHORT Port)
BOOLEAN MemQueryMemoryZone(ULONG StartAddress, PULONG Length, PBOOLEAN Hooked)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define RtlMoveMemory(Destination, Source, Length)
VOID WINAPI setBX(USHORT)
ULONG WINAPI getEBX(VOID)
VOID WINAPI setCX(USHORT)
VOID WINAPI setDX(USHORT)
USHORT WINAPI getBX(VOID)
USHORT WINAPI getDS(VOID)
USHORT WINAPI getCX(VOID)
VOID WINAPI setECX(ULONG)
USHORT WINAPI getSI(VOID)
USHORT WINAPI getDX(VOID)
VOID WINAPI setSP(USHORT)
VOID WINAPI setDS(USHORT)
USHORT WINAPI getAX(VOID)
VOID WINAPI setCS(USHORT)
ULONG WINAPI getEDX(VOID)
USHORT WINAPI getES(VOID)
ULONG WINAPI getECX(VOID)
USHORT WINAPI getBP(VOID)
USHORT WINAPI getDI(VOID)
VOID WINAPI setBP(USHORT)
VOID WINAPI setSS(USHORT)
VOID WINAPI setEBX(ULONG)
VOID WINAPI setAX(USHORT)
VOID WINAPI setES(USHORT)
VOID WINAPI setIP(USHORT)
VOID WINAPI setSI(USHORT)
VOID WINAPI setDI(USHORT)
VOID WINAPI setEAX(ULONG)
VOID VidBios32Cleanup(VOID)
BOOLEAN VidBiosInitialize(VOID)
#define DEFAULT_ATTRIBUTE
#define BIOS_VIDEO_INTERRUPT
_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
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack