2013-06-17 00:00:36 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: GPL - See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS Virtual DOS Machine
|
2015-09-18 17:01:49 +00:00
|
|
|
* FILE: subsystems/mvdm/ntvdm/ntvdm.h
|
2013-06-17 00:00:36 +00:00
|
|
|
* PURPOSE: Header file to define commonly used stuff
|
|
|
|
* PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
|
|
|
|
*/
|
|
|
|
|
2013-06-26 22:58:41 +00:00
|
|
|
#ifndef _NTVDM_H_
|
|
|
|
#define _NTVDM_H_
|
|
|
|
|
2013-06-17 00:00:36 +00:00
|
|
|
/* INCLUDES *******************************************************************/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdarg.h>
|
2014-05-02 22:23:34 +00:00
|
|
|
#include <wchar.h>
|
2013-10-27 14:17:34 +00:00
|
|
|
|
2015-04-19 00:01:03 +00:00
|
|
|
/* PSDK/NDK Headers */
|
2013-11-03 20:31:19 +00:00
|
|
|
#define WIN32_NO_STATUS
|
2013-11-16 23:11:54 +00:00
|
|
|
#include <windef.h>
|
|
|
|
#include <winbase.h>
|
|
|
|
#include <wingdi.h>
|
|
|
|
#include <wincon.h>
|
|
|
|
#include <winnls.h>
|
2013-12-23 18:17:29 +00:00
|
|
|
#include <winreg.h>
|
2013-11-16 23:11:54 +00:00
|
|
|
#include <winuser.h>
|
2015-09-27 15:24:26 +00:00
|
|
|
#include <commdlg.h>
|
|
|
|
|
2014-04-08 00:28:49 +00:00
|
|
|
#include <subsys/win/vdm.h>
|
2013-10-27 14:17:34 +00:00
|
|
|
|
2015-05-11 23:04:24 +00:00
|
|
|
// Do not include stuff that is only defined
|
|
|
|
// for backwards compatibility in nt_vdd.h
|
|
|
|
#define NO_NTVDD_COMPAT
|
2013-12-24 15:30:59 +00:00
|
|
|
#include <vddsvc.h>
|
2013-12-23 18:17:29 +00:00
|
|
|
|
2014-05-11 19:25:09 +00:00
|
|
|
DWORD WINAPI SetLastConsoleEventActive(VOID);
|
|
|
|
|
2015-04-19 00:01:03 +00:00
|
|
|
#define NTOS_MODE_USER
|
|
|
|
#include <ndk/kefuncs.h>
|
2015-05-14 21:13:07 +00:00
|
|
|
#include <ndk/mmfuncs.h>
|
2015-04-19 00:01:03 +00:00
|
|
|
#include <ndk/obfuncs.h>
|
|
|
|
#include <ndk/rtlfuncs.h>
|
|
|
|
#include <ndk/rtltypes.h>
|
|
|
|
|
|
|
|
/* PSEH for SEH Support */
|
|
|
|
#include <pseh/pseh2.h>
|
|
|
|
|
2014-05-11 19:25:09 +00:00
|
|
|
/*
|
|
|
|
* Activate this line if you want to run NTVDM in standalone mode with:
|
|
|
|
* ntvdm.exe <program>
|
|
|
|
*/
|
2014-05-11 19:26:17 +00:00
|
|
|
// #define STANDALONE
|
2014-04-22 20:46:50 +00:00
|
|
|
|
2015-03-13 23:26:33 +00:00
|
|
|
/*
|
|
|
|
* Activate this line for Win2k compliancy
|
|
|
|
*/
|
2015-05-11 23:10:00 +00:00
|
|
|
// #define WIN2K_COMPLIANT
|
2015-03-13 23:26:33 +00:00
|
|
|
|
2015-05-07 23:11:32 +00:00
|
|
|
/*
|
|
|
|
* Activate this line if you want advanced hardcoded debug facilities
|
|
|
|
* (called interrupts, etc...), that break PC-AT compatibility.
|
|
|
|
* USE AT YOUR OWN RISK! (disabled by default)
|
|
|
|
*/
|
|
|
|
// #define ADVANCED_DEBUGGING
|
|
|
|
|
[NTVDM]
- Add some level of "Advanced debugging" (see ntvdm.h) which one can adjust to enable/disable debugging features inside NTVDM (this can be useful as long as NTVDM is under heavy bugfixing. When it will be more perfect, this stuff will be removed).
- Add the possibility to load option ROMs at a given segment. Currently their list should be specified from inside ntvdm.c (in the BiosInitialize call), but I plan to make it available from a registry option (or via command-line for NTVDM-standalone mode).
- Start to separate the initialization of "static" BIOS data (stuff that lives in ROM space) and initialization of "dynamic" BIOS data (eg. initializing the interrupt vector table, the BIOS data area at segment 40h, ...) so that we may be able to reuse part of our code to be able to more-or-less run external (16-bit) BIOSes, or the Windows NTVDM BIOS that uses BOPs to run some of its stuff in ntvdm in 32-bit (as we do for our 32-bit BIOS, except that *all* of our bios is 32-bit, not just some parts). Also, some file reorganization will be in order there soon...
- Add video BIOS version information in memory so that tools such as Microsoft Diagnostics can correctly recognize our video BIOS (btw, we try to emulate the functionality of Cirrus' CL-GD5434).
- Correctly put video BIOS ROM header (+ checksum) in memory so that it is recognized as such by diagnostics tools.
- During BIOS POST, scan for ROMs starting segment 0xC000 (where video ROMs reside).
- Store statically the BIOS configuration table.
- Fix INT 16h, AH=12h "Get extended shift states" so that it correctly returns the state of right Ctrl and Alt keys.
- Fix bit-setting state; report that our keyboard is 101/102 enhanced keyboard.
- Correctly set the error return values (AH=86h and CF set) when a function of INT 15h is unsupported.
- Implement INT 15h, AH=C9h "Get CPU Type and Mask Revision"; INT 1Ah, AH=02h "Get Real-Time Clock Time" and Ah=04h "Get Real-Time Clock Date" by reading the CMOS.
- Implement CMOS century register support.
svn path=/trunk/; revision=68598
2015-08-04 20:17:05 +00:00
|
|
|
#ifdef ADVANCED_DEBUGGING
|
|
|
|
#define ADVANCED_DEBUGGING_LEVEL 1
|
|
|
|
#endif
|
|
|
|
|
2018-02-11 23:38:10 +00:00
|
|
|
#define NULL32 0
|
2015-09-28 01:36:31 +00:00
|
|
|
|
|
|
|
/* VARIABLES ******************************************************************/
|
|
|
|
|
|
|
|
typedef struct _NTVDM_SETTINGS
|
|
|
|
{
|
|
|
|
ANSI_STRING BiosFileName;
|
|
|
|
ANSI_STRING RomFiles;
|
2015-11-07 20:19:32 +00:00
|
|
|
UNICODE_STRING FloppyDisks[2];
|
|
|
|
UNICODE_STRING HardDisks[4];
|
2015-09-28 01:36:31 +00:00
|
|
|
} NTVDM_SETTINGS, *PNTVDM_SETTINGS;
|
|
|
|
|
|
|
|
extern NTVDM_SETTINGS GlobalSettings;
|
2013-06-17 00:00:36 +00:00
|
|
|
|
2014-10-04 13:36:17 +00:00
|
|
|
// Command line of NTVDM
|
|
|
|
extern INT NtVdmArgc;
|
|
|
|
extern WCHAR** NtVdmArgv;
|
|
|
|
|
2015-09-27 15:24:26 +00:00
|
|
|
extern HWND hConsoleWnd;
|
|
|
|
|
2014-10-04 13:36:17 +00:00
|
|
|
|
2015-09-28 01:36:31 +00:00
|
|
|
/* FUNCTIONS ******************************************************************/
|
|
|
|
|
2014-09-16 00:51:15 +00:00
|
|
|
/*
|
|
|
|
* Interface functions
|
|
|
|
*/
|
2015-10-01 00:09:24 +00:00
|
|
|
typedef VOID (*CHAR_PRINT)(IN CHAR Character);
|
2015-07-13 01:21:46 +00:00
|
|
|
VOID DisplayMessage(IN LPCWSTR Format, ...);
|
2015-10-01 00:09:24 +00:00
|
|
|
VOID PrintMessageAnsi(IN CHAR_PRINT CharPrint,
|
|
|
|
IN LPCSTR Format, ...);
|
2013-06-26 22:58:41 +00:00
|
|
|
|
2015-10-03 02:36:35 +00:00
|
|
|
/*static*/ VOID
|
|
|
|
UpdateVdmMenuDisks(VOID);
|
2014-09-14 00:43:43 +00:00
|
|
|
|
2015-03-31 21:28:40 +00:00
|
|
|
BOOL ConsoleAttach(VOID);
|
|
|
|
VOID ConsoleDetach(VOID);
|
2015-10-03 15:06:24 +00:00
|
|
|
VOID ConsoleReattach(HANDLE ConOutHandle);
|
2017-12-23 22:56:04 +00:00
|
|
|
BOOL IsConsoleHandle(HANDLE hHandle);
|
2014-09-16 00:51:15 +00:00
|
|
|
VOID MenuEventHandler(PMENU_EVENT_RECORD MenuEvent);
|
|
|
|
VOID FocusEventHandler(PFOCUS_EVENT_RECORD FocusEvent);
|
|
|
|
|
2015-10-04 11:49:28 +00:00
|
|
|
#endif // _NTVDM_H_
|
|
|
|
|
|
|
|
/* EOF */
|