Commit graph

69 commits

Author SHA1 Message Date
Aleksandar Andrejevic e2dbefc310 Sync with trunk.
svn path=/branches/ntvdm/; revision=62849
2014-04-21 01:45:58 +00:00
Hermès Bélusca-Maïto 67c46a3b02 [NTVDM]
- Just define GetNextVDMCommand and ExitVDM at their correct places.
- Code cleaning.

svn path=/branches/ntvdm/; revision=62687
2014-04-08 14:35:35 +00:00
Aleksandar Andrejevic bd153df890 [BASESRV]
Fix BaseSrvCheckVDM - DOS records should be initialized with a state of VDM_NOT_LOADED.
Fix BaseSrvFillCommandInfo - Check the size of the buffers.
Start implementing BaseSrvGetNextVDMCommand.


svn path=/branches/ntvdm/; revision=62683
2014-04-07 23:16:22 +00:00
Aleksandar Andrejevic 37d5c52cdc Forgot to commit this file.
svn path=/branches/ntvdm/; revision=62597
2014-04-01 02:59:00 +00:00
Aleksandar Andrejevic 49f1aa9bdc [KERNEL32]
Implement GetNextVDMCommand.


svn path=/branches/ntvdm/; revision=62574
2014-03-29 04:05:09 +00:00
Aleksandar Andrejevic 9c283d7508 [BASESRV]
- Move more constants to the global header.
- Implement GetConsoleRecordBySessionId.
- Implement BaseSrvUpdateVDMEntry.
- Improve and fix bugs in the cleanup code.


svn path=/branches/ntvdm/; revision=62451
2014-03-07 23:46:43 +00:00
Aleksandar Andrejevic 8656d3a5f6 [BASESRV]
Move the GET_NEXT_VDM_COMMAND_DATA structure to a global header, and
rename it to VDM_COMMAND_INFO.
Implement BaseSrvCopyCommand, which moves the BASE_CHECK_VDM structure data
into a new VDM_COMMAND_INFO structure.
Implement BaseSrvFreeVDMInfo which frees a VDM_COMMAND_INFO structure and
everything in it.


svn path=/branches/ntvdm/; revision=62374
2014-03-02 02:50:40 +00:00
Amine Khaldi 121bde3b83 * Sync up to trunk HEAD (r62286).
svn path=/branches/ntvdm/; revision=62287
2014-02-22 10:50:51 +00:00
Aleksandar Andrejevic 011259b78f [FAST486]
Update the AC flag in the POPF instruction.


svn path=/branches/ntvdm/; revision=62278
2014-02-21 01:15:03 +00:00
Aleksandar Andrejevic c64a03a80f [BASESRV]
Move the VDM states and binary types to a public header file.
Implement GetNextDosSesId.
Continue implementing BaseSrvCheckVDM.


svn path=/branches/ntvdm/; revision=62200
2014-02-16 00:09:27 +00:00
Hermès Bélusca-Maïto 5380113016 Sync with trunk rev.61910 to get latest improvements and bugfixes.
svn path=/branches/ntvdm/; revision=61911
2014-02-01 22:56:13 +00:00
Hermès Bélusca-Maïto 105aff1c51 [NTVDM]
- 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
2014-02-01 16:32:20 +00:00
Hermès Bélusca-Maïto 3224e67cfc Sync to trunk revision 61757.
svn path=/branches/ntvdm/; revision=61758
2014-01-22 22:56:41 +00:00
Hermès Bélusca-Maïto 40f773b96b [DDK:NT_VDD]
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
2014-01-11 20:59:27 +00:00
Hermès Bélusca-Maïto 49ab546ac3 Sync up with trunk r61578.
svn path=/branches/ntvdm/; revision=61579
2014-01-11 00:00:10 +00:00
Hermès Bélusca-Maïto 8331d27b2b [NTVDM]: Implement and export VDDTerminateVDM.
svn path=/branches/ntvdm/; revision=61374
2013-12-24 15:52:31 +00:00
Hermès Bélusca-Maïto 91a882c036 [DDK] - Code formatting only.
svn path=/branches/ntvdm/; revision=61373
2013-12-24 15:50:31 +00:00
Hermès Bélusca-Maïto 4f99547f7d [NTVDM]
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
2013-12-24 15:30:59 +00:00
Hermès Bélusca-Maïto 137d02967b [DDK]: Define registry manipulation APIs.
svn path=/branches/ntvdm/; revision=61360
2013-12-23 18:34:30 +00:00
Hermès Bélusca-Maïto 3cad6a80cf [DDK]
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
2013-12-23 17:40:50 +00:00
Aleksandar Andrejevic 18b844dffa [FAST486]
Fix the emulation of the Local Descriptor Table.


svn path=/branches/ntvdm/; revision=61268
2013-12-14 02:13:01 +00:00
Aleksandar Andrejevic 5303c91efa [FAST486]
Implement the extended opcode group 0x0F, 0x00 (SLDT, STR, LLDT, LTR, VERR, VERW).


svn path=/branches/ntvdm/; revision=61264
2013-12-13 03:32:41 +00:00
Aleksandar Andrejevic 81c27b5b19 [FAST486]
Start implementing the FPU. Stubplement the FPU opcode handlers.


svn path=/branches/ntvdm/; revision=61141
2013-11-29 03:00:59 +00:00
Aleksandar Andrejevic 8e356f7a95 [FAST486]
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
2013-11-23 01:34:03 +00:00
Aleksandar Andrejevic bbc9efd2d9 [FAST486]
- 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
2013-11-15 02:32:08 +00:00
Aleksandar Andrejevic c3c7bb89c1 [FAST486]
Modularize linear memory access by adding two new functions:
Fast486ReadLinearMemory and Fast486WriteLinearMemory.
Implement Fast486GetPageTableEntry.


svn path=/branches/ntvdm/; revision=60923
2013-11-10 22:27:24 +00:00
Hermès Bélusca-Maïto ecd0b33743 [FAST486][NTVDM]: Rename the last two IO functions parameters in the same way as some CSR functions (ElementCount == DataCount; ElementSize == DataSize).
svn path=/branches/ntvdm/; revision=60896
2013-11-09 15:00:19 +00:00
Aleksandar Andrejevic 43ee57f2f7 [FAST486][NTVDM]
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
2013-11-09 03:30:27 +00:00
Aleksandar Andrejevic d80b788ff4 [FAST486]
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
2013-11-02 00:47:43 +00:00
Hermès Bélusca-Maïto 861776bd7e [FAST486][NTVDM]
- 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
2013-11-01 01:46:58 +00:00
Hermès Bélusca-Maïto 39a527a21e [FAST486][NTVDM]
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
2013-11-01 00:01:07 +00:00
Hermès Bélusca-Maïto 2c8e8ba5d3 [FAST486]
- 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
2013-10-27 11:42:44 +00:00
Aleksandar Andrejevic 62da9a9deb [FAST486]
Physical memory read/write callbacks don't need to return a value.


svn path=/branches/ntvdm/; revision=60765
2013-10-27 01:38:24 +00:00
Aleksandar Andrejevic f5d3c9254c [FAST486]
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
2013-10-27 00:37:01 +00:00
Hermès Bélusca-Maïto fcbe98e6b6 [SOFTX86]
Remove the now-unneeded headers. Bye-bye SoftX86 !

svn path=/branches/ntvdm/; revision=60758
2013-10-26 21:26:28 +00:00
Aleksandar Andrejevic 1525a235a2 [FAST486]
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
2013-10-26 00:56:11 +00:00
Aleksandar Andrejevic 5eb7c07bb8 Sync with trunk for console graphics palettes.
svn path=/branches/ntvdm/; revision=60735
2013-10-23 00:26:50 +00:00
Aleksandar Andrejevic ca7d21eff4 [FAST486]
The 80486 doesn't have any time stamp counter (TSC) at all.


svn path=/branches/ntvdm/; revision=60710
2013-10-19 18:28:27 +00:00
Hermès Bélusca-Maïto 51040fc61e Bye bye Soft386, welcome Fast486, courtesy Aleksandar Andrejevic.
[NTVDM]: Define by default NEW_EMULATOR, i.e. use Fast486 instead of softx86.

svn path=/branches/ntvdm/; revision=60703
2013-10-19 16:55:51 +00:00
Aleksandar Andrejevic 0e8be812b0 [SOFT386]
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
2013-10-18 22:50:00 +00:00
Amine Khaldi 25445ea35f * Sync up to trunk head (r60691).
svn path=/branches/ntvdm/; revision=60692
2013-10-17 11:19:05 +00:00
Aleksandar Andrejevic 4b14d9a672 [SOFT386]
Start implementing call gate support.
Implement the direct far call opcode (0x9A).


svn path=/branches/ntvdm/; revision=60685
2013-10-16 00:41:24 +00:00
Aleksandar Andrejevic c425bbc689 [SOFT386]
Implement Soft386Interrupt.
[NTVDM]
Implement EmulatorInterrupt and EmulatorExternalInterrupt for NEW_EMULATOR.


svn path=/branches/ntvdm/; revision=60628
2013-10-12 13:58:34 +00:00
Aleksandar Andrejevic 800969b126 [SOFT386]
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
2013-10-11 12:24:05 +00:00
Aleksandar Andrejevic aef0bf1635 [SOFT386]
Implement an API for external segment modification.
[NTVDM]
Implement EmulatorSetRegister for NEW_EMULATOR.


svn path=/branches/ntvdm/; revision=60591
2013-10-09 21:48:52 +00:00
Aleksandar Andrejevic 5ef6274619 [SOFT386]
Fix the header in soft386.h.


svn path=/branches/ntvdm/; revision=60486
2013-09-30 22:13:51 +00:00
Aleksandar Andrejevic 7e119cf40b [SOFT386]
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
2013-09-28 00:29:16 +00:00
Aleksandar Andrejevic b5a9d7490a [SOFT386]
Implement the POPF instruction.


svn path=/branches/ntvdm/; revision=60341
2013-09-23 14:10:14 +00:00
Aleksandar Andrejevic 7328873681 [SOFT386]
Implement external stack modification.
[NTVDM]
Implement EmulatorSetStack for NEW_EMULATOR.


svn path=/branches/ntvdm/; revision=60257
2013-09-21 00:41:41 +00:00
Hermès Bélusca-Maïto 85f05060e4 [SOFT386]
- 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
2013-09-17 23:02:22 +00:00