- Define and export VDDSimulate16 and host_simulate.
- Move the big emulation loop from ntvdm.c to clock.c, and the console input pump thread from ps2.c to ntvdm.c.
Indeed:
* Moving the emulation loop out of the main initialization function will be helpful if one wants to modify how emulation is done,
* The console input pump thread deals also with console UI bits that have nothing to do with keyboard/mouse/ps-2. Instead, the pump thread will dispatch keyboard and mouse events to the ps/2 controller.
- Implement a custom menu in the console's system menu to be able to parametrize ROS VDM (work-in-progress); at the moment only a menu item to show/hide mouse pointer, and another one allowing us to quit properly the VDM are implemented. The menu code was taken from the GUI frontend in winsrv.dll. Only english and french translations available at the moment.
svn path=/branches/ntvdm/; revision=61902
Declare some VDM memory services.
[NTVDM]
- Almost all of the XXXInitialize functions just return TRUE always, so VOIDify them instead (since they always succeed).
- Move almost all of the hardware initialization inside EmulatorInitialize.
- Move pure console initialization/mode-saving/cleanup code into ConsoleInit/Cleanup functions in ntvdm.c instead of in bios.c.
svn path=/branches/ntvdm/; revision=61588
Implement and export (and define in vddsvc.h) call_ica_hw_interrupt and VDDSimulateInterrupt macro.
ICA = Interrupt Controller Adapter (in windows terminology)
svn path=/branches/ntvdm/; revision=61372
Introduce DDK headers needed for Virtual Device Drivers development. nt_vdd.h and vddsvc.h will get populated with functions as soon as they will be implemented in NTVDM.
isvbop.h/.inc is fully implemented. isvbop.inc defines 3rd-party VDD bops and "function"-calls for 16-bit apps (in assembler), and isvbop.h defines the same in C-language.
They are both MSVC and GCC-compatible.
svn path=/branches/ntvdm/; revision=61352
The 486 doesn't have AC, VIF, VIP or ID.
Fix and simplify POPF.
[NTVDM]
Fix the count in the XMS copy function (INT 15h, AH = 87h).
svn path=/branches/ntvdm/; revision=61082
- Fix the privilege checks.
- Store the CPL in a special field, so that it doesn't get mixed up
with the lowest 2 bits of real mode selectors while switching
into protected mode.
- Reset the exception count after a successful ISR call.
- In Fast486OpcodeGroup0F01, check for prefix overrides after parsing
the Mod-Reg-R/M, which might add a SS: prefix override in some cases.
svn path=/branches/ntvdm/; revision=60995
Modularize linear memory access by adding two new functions:
Fast486ReadLinearMemory and Fast486WriteLinearMemory.
Implement Fast486GetPageTableEntry.
svn path=/branches/ntvdm/; revision=60923
The behavior of the I/O port bus depends on the data width. In the case
of 16-bit/32-bit access, two/four adjacent ports will be accessed.
svn path=/branches/ntvdm/; revision=60891
Fix segment initialization. The cached descriptors must have valid values
during the switch to protected mode.
For some odd reason, GCC makes the FAST486_GDT_ENTRY structure 12 bytes
instead of 8 if there is a bit field with more than 16 bits, so split
the Base field into Base and BaseMid.
Add size checks below important structure declarations.
svn path=/branches/ntvdm/; revision=60825
- Introduce a Fast486Initialize which is used to set up the CPU callbacks (and use default ones if some of the given callbacks are NULL), and to reset it the first time. Now Fast486Reset is meant to be used for only resetting the CPU to a safe state.
- Hence we are now sure that State->WhateverCallback is never NULL (and is theoretically valid), so don't do NULL-checks when calling them, but call them directly. The default cases for those checks become the default calls for the default callbacks.
- Remove the now-unneeded EmulatorIdle function.
svn path=/branches/ntvdm/; revision=60814
BOP numbers are 1 byte and map to a function (over 255). But one can pass additional "parameters" to those functions by adding extra bytes, however such functions must advance "by hand" the instruction pointer.
[NTVDM]
- Take into account our previous remark for the BIOS interrupt stubs, and comment them.
- Rework EmulatorBiosOperation (move almost all of its existing code into subfunctions in bop.c) so that one can call many other BOP functions in the future (WIP). The BOP number (still called) EMULATOR_INT_BOP (of value 0xFF) is used for internal 16 --> 32 bit switching for our 32bit bios.
- It appears that the IoRead/WriteCallback and IdleCallback must not be NULL for using fast486. I'm committing a temporary fix that I will definitely fix in a subsequent commit.
svn path=/branches/ntvdm/; revision=60812
- Remove an unneeded inclusion to the CRT header: limits.h (and use instead NDK definitions for max/min long values).
- Remove unneeded comments...
[NTVDM]
Remove an unneeded add_dependencies(...) command.
svn path=/branches/ntvdm/; revision=60767
Separate external interrupts from interrupt signals (which are
interrupts whose number is not known until they can be serviced,
just like hardware interrupts on a real CPU).
[NTVDM]
Improve the PIC emulation code (IRQ priorities, etc...).
Instead of checking for interrupts in the main loop, move the
PS/2 input parsing to a different thread.
Improve BIOS keyboard IRQ handling.
svn path=/branches/ntvdm/; revision=60761
Implement the MOV instruction for control and debug registers.
Remove definitions for non-existant registers CR1, CR4, CR5, CR6 and CR7.
The standard 80486 doesn't have a CR4 register (although some implementations
of the 80486 had large page support and CR4, it was not reliable).
As for the debug registers, DR4 is the same as DR6, and DR5 is the same as DR7.
svn path=/branches/ntvdm/; revision=60747
Implement the hardware interrupt system.
Modify Soft386Interrupt to assume hardware interrupts, because
software interrupts from outside the emulator may cause race conditions.
svn path=/branches/ntvdm/; revision=60696
Fix a bug in Soft386ExceptionWithErrorCode. The instruction pointer exceptions can
return to should point to the instruction that caused the exception.
svn path=/branches/ntvdm/; revision=60603
Implement the LES and LDS instructions.
Add optional support for BOPs (NTVDM-specific).
Fix prefix handling in some functions.
[NTVDM]
Enable BOPs for Soft386 (when NEW_EMULATOR is defined).
Fix the calling convention issue (softx86 uses cdecl, soft386 uses stdcall).
svn path=/branches/ntvdm/; revision=60395
- Put inlined functions in a .inl file, which gets included by the corresponding header file (i.e. fix MSVC builds).
- Use enums types instead of "only" INTs...
svn path=/branches/ntvdm/; revision=60193
- In the interface header soft386.h, do not include other particular headers (windows.h and debug.h). Those must be included by the different applications which also will include soft386.h.
- LPVOID --> PVOID (do it general, not just à-la Win32).
- The .c files include the headers, and each .c files must have its "#define NDEBUG\n#include <debug.h>" lines, to activate (or deactivate here in the example) debugging output.
- In the .c files, include the header windef.h for having the basic types, and temporarily comment out the needed #defines which will be needed if one needs to include other win***.h files. Those will be deleted if they aren't needed at the end.
svn path=/branches/ntvdm/; revision=59766