reactos.git
10 years ago[NTVDM]
Aleksandar Andrejevic [Tue, 12 Nov 2013 01:56:18 +0000 (01:56 +0000)]
[NTVDM]
The command line in the PSP consists only of the parameters, the program
name is omitted.

svn path=/branches/ntvdm/; revision=60959

10 years ago[NTVDM]
Aleksandar Andrejevic [Tue, 12 Nov 2013 00:49:02 +0000 (00:49 +0000)]
[NTVDM]
Report the correct number of paragraphs in the PSP of a COM program.

svn path=/branches/ntvdm/; revision=60958

10 years ago[FAST486]
Aleksandar Andrejevic [Mon, 11 Nov 2013 20:55:33 +0000 (20:55 +0000)]
[FAST486]
Check for interrupts at the end of a cycle, to avoid confusing
debug output.

svn path=/branches/ntvdm/; revision=60956

10 years ago[NTVDM]
Aleksandar Andrejevic [Mon, 11 Nov 2013 20:41:55 +0000 (20:41 +0000)]
[NTVDM]
Implement vertical scrolling in BiosScrollWindow.

svn path=/branches/ntvdm/; revision=60955

10 years ago[FAST486]
Aleksandar Andrejevic [Mon, 11 Nov 2013 19:08:28 +0000 (19:08 +0000)]
[FAST486]
Fix the previous fix in the Mod-Reg-R/M parser. EBP is still used
if the mode is 1 or 2.

svn path=/branches/ntvdm/; revision=60948

10 years ago[NTVDM]
Aleksandar Andrejevic [Mon, 11 Nov 2013 17:59:04 +0000 (17:59 +0000)]
[NTVDM]
Implement CMOS registers 15h, 16h, 17h and 18h.

svn path=/branches/ntvdm/; revision=60946

10 years ago[FAST486]
Aleksandar Andrejevic [Mon, 11 Nov 2013 17:24:22 +0000 (17:24 +0000)]
[FAST486]
Fix the Mod-Reg-R/M parser. EBP cannot be used as a SIB byte base,
instead it's used to mark that the base is an immediate operand.

svn path=/branches/ntvdm/; revision=60944

10 years ago[NTVDM]: Display more detailed information about which unknown interruption was called.
Hermès Bélusca-Maïto [Mon, 11 Nov 2013 17:05:02 +0000 (17:05 +0000)]
[NTVDM]: Display more detailed information about which unknown interruption was called.

svn path=/branches/ntvdm/; revision=60943

10 years ago[NTVDM]
Aleksandar Andrejevic [Mon, 11 Nov 2013 16:47:10 +0000 (16:47 +0000)]
[NTVDM]
Implement INT 15h, AH = 87h, "Copy Extended Memory".

svn path=/branches/ntvdm/; revision=60942

10 years ago[FAST486]: Put the inlined function in its proper file. No code changes.
Hermès Bélusca-Maïto [Mon, 11 Nov 2013 15:34:18 +0000 (15:34 +0000)]
[FAST486]: Put the inlined function in its proper file. No code changes.

svn path=/branches/ntvdm/; revision=60940

10 years ago[FAST486]
Aleksandar Andrejevic [Mon, 11 Nov 2013 15:27:54 +0000 (15:27 +0000)]
[FAST486]
Fix Fast486GetCurrentPrivLevel.

svn path=/branches/ntvdm/; revision=60939

10 years ago[NTVDM]
Aleksandar Andrejevic [Mon, 11 Nov 2013 04:00:10 +0000 (04:00 +0000)]
[NTVDM]
Implement the miscellaneous BIOS system service (INT 15h) handler.
Implement INT 15h, AH = 88h, "Get Extended Memory Size".

svn path=/branches/ntvdm/; revision=60938

10 years ago[NTVDM]
Aleksandar Andrejevic [Mon, 11 Nov 2013 03:45:39 +0000 (03:45 +0000)]
[NTVDM]
Give the virtual machine 16 MB of memory, for DOS extenders,
protected mode programs, etc...
EMS is still not implemented.

svn path=/branches/ntvdm/; revision=60937

10 years ago[FAST486]
Aleksandar Andrejevic [Mon, 11 Nov 2013 03:16:07 +0000 (03:16 +0000)]
[FAST486]
Fix a bug in the LDS and LES instructions.

svn path=/branches/ntvdm/; revision=60936

10 years ago[FAST486]
Aleksandar Andrejevic [Mon, 11 Nov 2013 03:14:18 +0000 (03:14 +0000)]
[FAST486]
Implement the LSS instruction.
Fix a bug in LFS and LGS.

svn path=/branches/ntvdm/; revision=60935

10 years ago[NTVDM]: Fix CMOS file sharing access (so that we allow multiple ntvdm running with...
Hermès Bélusca-Maïto [Mon, 11 Nov 2013 02:35:06 +0000 (02:35 +0000)]
[NTVDM]: Fix CMOS file sharing access (so that we allow multiple ntvdm running with the same cmos data).

svn path=/branches/ntvdm/; revision=60934

10 years ago[NTVDM]
Aleksandar Andrejevic [Mon, 11 Nov 2013 02:27:29 +0000 (02:27 +0000)]
[NTVDM]
To make debugging easier, put the interrupt handlers at offset 0x1000,
and reserve 16 bytes for each. Also, move the common stub to offset
0x2000. That way the entry point of, for example, INT 0x21 is at
F000:1210.

svn path=/branches/ntvdm/; revision=60933

10 years ago[FAST486]
Aleksandar Andrejevic [Mon, 11 Nov 2013 01:14:24 +0000 (01:14 +0000)]
[FAST486]
We don't support in-circuit emulation opcodes such as USERMOV.
The 486 does not have the JMPE or POPCNT instructions.

svn path=/branches/ntvdm/; revision=60932

10 years ago[FAST486]: Remove an extra "return TRUE;"
Hermès Bélusca-Maïto [Mon, 11 Nov 2013 01:02:48 +0000 (01:02 +0000)]
[FAST486]: Remove an extra "return TRUE;"

svn path=/branches/ntvdm/; revision=60931

10 years ago[FAST486]
Aleksandar Andrejevic [Mon, 11 Nov 2013 00:57:59 +0000 (00:57 +0000)]
[FAST486]
Implement SHLD and SHRD.

svn path=/branches/ntvdm/; revision=60930

10 years ago[FAST486]
Aleksandar Andrejevic [Mon, 11 Nov 2013 00:10:46 +0000 (00:10 +0000)]
[FAST486]
Implement the two operand version of IMUL.

svn path=/branches/ntvdm/; revision=60929

10 years ago[FAST486]
Aleksandar Andrejevic [Sun, 10 Nov 2013 23:42:57 +0000 (23:42 +0000)]
[FAST486]
Don't mix up ADSIZE and OPSIZE (continued).

svn path=/branches/ntvdm/; revision=60927

10 years ago[FAST486]
Aleksandar Andrejevic [Sun, 10 Nov 2013 23:34:34 +0000 (23:34 +0000)]
[FAST486]
Don't mix up ADSIZE and OPSIZE.

svn path=/branches/ntvdm/; revision=60926

10 years ago[FAST486]
Aleksandar Andrejevic [Sun, 10 Nov 2013 22:49:19 +0000 (22:49 +0000)]
[FAST486]
Increment SP, not ESP for 16-bit stacks.

svn path=/branches/ntvdm/; revision=60925

10 years ago[FAST486]
Aleksandar Andrejevic [Sun, 10 Nov 2013 22:27:24 +0000 (22:27 +0000)]
[FAST486]
Modularize linear memory access by adding two new functions:
Fast486ReadLinearMemory and Fast486WriteLinearMemory.
Implement Fast486GetPageTableEntry.

svn path=/branches/ntvdm/; revision=60923

10 years ago[NTVDM]
Aleksandar Andrejevic [Sun, 10 Nov 2013 18:14:40 +0000 (18:14 +0000)]
[NTVDM]
Remove unnecessary indentation and clarify the code a bit.

svn path=/branches/ntvdm/; revision=60919

10 years ago[NTVDM]
Hermès Bélusca-Maïto [Sun, 10 Nov 2013 16:22:33 +0000 (16:22 +0000)]
[NTVDM]
Instead of reassembling each time the very same common stub code for each interrupt, do it once, and then assemble just a little part for each interrupt and jump to the common stub.
Now the 4DOS Ctrl-C exception bug changes, but I have an idea what's happening in there...

svn path=/branches/ntvdm/; revision=60917

10 years ago[NTVDM]
Hermès Bélusca-Maïto [Sun, 10 Nov 2013 13:12:02 +0000 (13:12 +0000)]
[NTVDM]
- BIOS: Reorganize a bit the header, and close the input thread before closing the input handle (and not after).
- INT32: Fix a comment.
- CMOS: Put CMOS data into a structure called CMOS_MEMORY, introduce READ/WRITE_CMOS_DATA macros for simplifying code. Save CMOS memory into a file (à la Windows' NTVDM), which is loaded at startup.

svn path=/branches/ntvdm/; revision=60913

10 years ago[FAST486]
Aleksandar Andrejevic [Sun, 10 Nov 2013 03:11:56 +0000 (03:11 +0000)]
[FAST486]
The number of bit places in a shift operation is ANDed by the width of the type
when it is in a register, so (1 << c), when c is 32, is actually 1, and not 0.
Fix the calculation of MaxValue by using SignFlag | (SignFlag - 1) instead.

svn path=/branches/ntvdm/; revision=60912

10 years ago[NTVDM]
Aleksandar Andrejevic [Sun, 10 Nov 2013 01:19:50 +0000 (01:19 +0000)]
[NTVDM]
Fix the jump instruction offset. Spotted by Hermes Belusca-Maito.

svn path=/branches/ntvdm/; revision=60911

10 years ago[NTVDM]
Aleksandar Andrejevic [Sun, 10 Nov 2013 00:53:05 +0000 (00:53 +0000)]
[NTVDM]
Don't enable interrupts unless it's necessary in the interrupt handler.
[FAST486]
When handling interrupt signals, make sure at least one instruction is executed,
to prevent the CPU from being completely blocked by interrupt signals.

svn path=/branches/ntvdm/; revision=60910

10 years ago[NTVDM]
Hermès Bélusca-Maïto [Sat, 9 Nov 2013 23:01:11 +0000 (23:01 +0000)]
[NTVDM]
Finish my Interruption revamp.
- Move interrupt-related code from bop.c to int32.c
- Introduce InitializeInt32 helper so that one can initialize all the needed 16-bit stubs for the 32-bit interrupts.
- Remove unneeded defines in emulator.h and an exported variable in ntvdm.h.

svn path=/branches/ntvdm/; revision=60908

10 years ago[NTVDM]
Hermès Bélusca-Maïto [Sat, 9 Nov 2013 22:15:40 +0000 (22:15 +0000)]
[NTVDM]
Start my work on modularizing registration of "32-bit" interrupts, i.e.
interrupts that are implemented in 32-bit mode, but are stubbed with 16-bit
code (so that 16-bit apps can call them).
The 16-bit stub code uses a BOP call to our Control BOP function (BOP 0xFF) which
can handle in theory many sub-functions (as the BOP 0x58 documented here: http://www.ragestorm.net/tutorial?id=27)
specified as an additional BYTE in the call:
0xC4 0xC4 bop_code <optional_bop_subfunction>
Here, for calling 32-bit interrupts we use our BOP 0xFF, subfunction 0xFF.
The final aim would be to generate the 16-bit stub code when one calls the RegisterInt32 helper function
(contrary to what's happening now, that is, the 16-bit stub code is generated for all of the interrupts
at BIOS initialization time, and we use it for BIOS and DOS interrupts).

svn path=/branches/ntvdm/; revision=60907

10 years ago[NTVDM]
Hermès Bélusca-Maïto [Sat, 9 Nov 2013 19:55:04 +0000 (19:55 +0000)]
[NTVDM]
- Make usage of MAKEWORD;
- Introduce BiosGetCursorPosition and use it in BiosPrintCharacter;
- Use EmulatorWriteMemory instead of VgaWriteMemory somewhere in BiosPrintCharacter;
- Add support for tabs in BiosPrintCharacter (taken from DosBox).

svn path=/branches/ntvdm/; revision=60906

10 years ago[NTVDM]
Aleksandar Andrejevic [Sat, 9 Nov 2013 18:10:21 +0000 (18:10 +0000)]
[NTVDM]
Allow COM programs to exit with a simple near return to PSP:0000. Spotted by Thomas Faber.

svn path=/branches/ntvdm/; revision=60904

10 years ago[NTVDM]
Aleksandar Andrejevic [Sat, 9 Nov 2013 17:16:04 +0000 (17:16 +0000)]
[NTVDM]
Make the emulator callbacks non-static.
In BiosPrintCallback, use EmulatorWriteMemory instead of VgaWriteMemory, because
VgaWriteMemory does not do any input validation.
Improve EmulatorWriteMemory input validation and bound checking.

svn path=/branches/ntvdm/; revision=60903

10 years ago[NTVDM]: Fix informative comment.
Hermès Bélusca-Maïto [Sat, 9 Nov 2013 16:19:14 +0000 (16:19 +0000)]
[NTVDM]: Fix informative comment.

svn path=/branches/ntvdm/; revision=60901

10 years ago[NTVDM]
Aleksandar Andrejevic [Sat, 9 Nov 2013 16:15:24 +0000 (16:15 +0000)]
[NTVDM]
Instead of repeating the BOP, simply handle both 0x51 and 0x62 as the same function.

svn path=/branches/ntvdm/; revision=60900

10 years ago[NTVDM]
Hermès Bélusca-Maïto [Sat, 9 Nov 2013 16:11:52 +0000 (16:11 +0000)]
[NTVDM]
DOS: Implement INT 21h, AH 62h as a call to INT 21h, AH 51h.

svn path=/branches/ntvdm/; revision=60899

10 years ago[NTVDM]: Improve DisplayMessage by also displaying the message in the debug log.
Hermès Bélusca-Maïto [Sat, 9 Nov 2013 15:53:52 +0000 (15:53 +0000)]
[NTVDM]: Improve DisplayMessage by also displaying the message in the debug log.

svn path=/branches/ntvdm/; revision=60898

10 years ago[NTVDM]
Aleksandar Andrejevic [Sat, 9 Nov 2013 15:48:07 +0000 (15:48 +0000)]
[NTVDM]
Display the opcode when an unhandled exception occurs.

svn path=/branches/ntvdm/; revision=60897

10 years ago[FAST486][NTVDM]: Rename the last two IO functions parameters in the same way as...
Hermès Bélusca-Maïto [Sat, 9 Nov 2013 15:00:19 +0000 (15:00 +0000)]
[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

10 years ago[FAST486]: Code formatting only (remove endlines spaces).
Hermès Bélusca-Maïto [Sat, 9 Nov 2013 14:23:40 +0000 (14:23 +0000)]
[FAST486]: Code formatting only (remove endlines spaces).

svn path=/branches/ntvdm/; revision=60894

10 years ago[FAST486]: Fix OUT instruction (IoWrite instead of IoRead).
Hermès Bélusca-Maïto [Sat, 9 Nov 2013 14:15:39 +0000 (14:15 +0000)]
[FAST486]: Fix OUT instruction (IoWrite instead of IoRead).

svn path=/branches/ntvdm/; revision=60893

10 years ago[FAST486][NTVDM]
Aleksandar Andrejevic [Sat, 9 Nov 2013 03:30:27 +0000 (03:30 +0000)]
[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

10 years ago[NTVDM]: Add offset information to the BIOS Data Area, and add missing fields. See...
Hermès Bélusca-Maïto [Sat, 9 Nov 2013 00:28:26 +0000 (00:28 +0000)]
[NTVDM]: Add offset information to the BIOS Data Area, and add missing fields. See the provided links in the patch for more information.

svn path=/branches/ntvdm/; revision=60890

10 years ago[NTVDM]
Hermès Bélusca-Maïto [Fri, 8 Nov 2013 23:15:58 +0000 (23:15 +0000)]
[NTVDM]
- BIOS: Implement INT 12h (BiosGetMemorySize)
- BOP/DOS: Add some DPRINTs for INT 25h, 2Fh and for unimplemented functions of INT 21h. It's for helping in testing 4DOS.COM

svn path=/branches/ntvdm/; revision=60889

10 years ago[NTVDM]
Aleksandar Andrejevic [Fri, 8 Nov 2013 21:56:30 +0000 (21:56 +0000)]
[NTVDM]
For better visibility, double the screen size if the resolution is too low.

svn path=/branches/ntvdm/; revision=60888

10 years ago[NTVDM]: Further modularize initialization/resetting of the VGA palette code.
Hermès Bélusca-Maïto [Fri, 8 Nov 2013 20:06:10 +0000 (20:06 +0000)]
[NTVDM]: Further modularize initialization/resetting of the VGA palette code.

svn path=/branches/ntvdm/; revision=60887

10 years ago[NTVDM]
Aleksandar Andrejevic [Fri, 8 Nov 2013 19:30:58 +0000 (19:30 +0000)]
[NTVDM]
Implement the use of palettes for text mode. Adapted from a patch by Hermes Belusca-Maito.
Reset the palette during every BIOS video mode switch.

svn path=/branches/ntvdm/; revision=60886

10 years ago[FAST486]
Aleksandar Andrejevic [Thu, 7 Nov 2013 01:06:39 +0000 (01:06 +0000)]
[FAST486]
Implement LFS, LGS and MOVZX.

svn path=/branches/ntvdm/; revision=60878

10 years ago[FAST486]
Aleksandar Andrejevic [Thu, 7 Nov 2013 00:57:08 +0000 (00:57 +0000)]
[FAST486]
Implement BSF, BSR and MOVSX.

svn path=/branches/ntvdm/; revision=60877

10 years ago[NTVDM]: Code formatting only.
Hermès Bélusca-Maïto [Wed, 6 Nov 2013 22:43:40 +0000 (22:43 +0000)]
[NTVDM]: Code formatting only.

svn path=/branches/ntvdm/; revision=60876

10 years ago[NTVDM]
Hermès Bélusca-Maïto [Mon, 4 Nov 2013 00:22:29 +0000 (00:22 +0000)]
[NTVDM]
- Add a missing "goto Cleanup;"
- Add DPRINT1s at the beginning and the end of ntvdm, so that one can easily localize in debug logs where one started it. Suggested by Vampyre ;)

svn path=/branches/ntvdm/; revision=60860

10 years ago[FAST486]: Code formatting only.
Hermès Bélusca-Maïto [Sun, 3 Nov 2013 23:13:53 +0000 (23:13 +0000)]
[FAST486]: Code formatting only.

svn path=/branches/ntvdm/; revision=60857

10 years ago[FAST486]: Replace (boolean_condition) ? TRUE : FALSE; by: (boolean_condition) .
Hermès Bélusca-Maïto [Sun, 3 Nov 2013 22:44:55 +0000 (22:44 +0000)]
[FAST486]: Replace (boolean_condition) ? TRUE : FALSE; by: (boolean_condition) .

svn path=/branches/ntvdm/; revision=60856

10 years ago[NTVDM]
Aleksandar Andrejevic [Sun, 3 Nov 2013 21:52:58 +0000 (21:52 +0000)]
[NTVDM]
Use BiosConsoleInput instead of calling GetStdHandle in the keyboard input thread.

svn path=/branches/ntvdm/; revision=60855

10 years ago[NTVDM]
Aleksandar Andrejevic [Sun, 3 Nov 2013 21:33:22 +0000 (21:33 +0000)]
[NTVDM]
Implement the CMOS and Real Time Clock (RTC).
Improve the performance of the PIT and RTC (correctly this time).

svn path=/branches/ntvdm/; revision=60854

10 years ago[NTVDM]
Hermès Bélusca-Maïto [Sun, 3 Nov 2013 20:31:19 +0000 (20:31 +0000)]
[NTVDM]
Start to implement a basic emulated PC speaker, using the Beep driver.

svn path=/branches/ntvdm/; revision=60853

10 years ago[FAST486]
Aleksandar Andrejevic [Sun, 3 Nov 2013 18:31:00 +0000 (18:31 +0000)]
[FAST486]
BP is certainly not the same register as BX.

svn path=/branches/ntvdm/; revision=60851

10 years ago[NTVDM]
Aleksandar Andrejevic [Sun, 3 Nov 2013 14:37:30 +0000 (14:37 +0000)]
[NTVDM]
Improve the I/O read/write callbacks to allow multiple reads or writes
at once.

svn path=/branches/ntvdm/; revision=60849

10 years ago[NTVDM]
Hermès Bélusca-Maïto [Sun, 3 Nov 2013 13:25:01 +0000 (13:25 +0000)]
[NTVDM]
Implement INT 10h, AH 10h, AL 10h, 12h, 15h and 17h (set/get individual or block of DAC registers).

svn path=/branches/ntvdm/; revision=60846

10 years ago[NTVDM]
Aleksandar Andrejevic [Sun, 3 Nov 2013 03:22:36 +0000 (03:22 +0000)]
[NTVDM]
Halfplement the BIOS palette control command (INT 10h, AH = 10h).

svn path=/branches/ntvdm/; revision=60842

10 years ago[FAST486]
Aleksandar Andrejevic [Sun, 3 Nov 2013 01:05:40 +0000 (01:05 +0000)]
[FAST486]
The RCL, RCR, ROL and ROR instructions do not update SF, ZF or PF.

svn path=/branches/ntvdm/; revision=60841

10 years ago[NTVDM]
Aleksandar Andrejevic [Sat, 2 Nov 2013 01:51:27 +0000 (01:51 +0000)]
[NTVDM]
Fix resolution calculation when scanline doubling is enabled.

svn path=/branches/ntvdm/; revision=60827

10 years ago[NTVDM]: Add a DPRINT1 that can be useful later on...
Hermès Bélusca-Maïto [Sat, 2 Nov 2013 01:24:27 +0000 (01:24 +0000)]
[NTVDM]: Add a DPRINT1 that can be useful later on...

svn path=/branches/ntvdm/; revision=60826

10 years ago[FAST486]
Aleksandar Andrejevic [Sat, 2 Nov 2013 00:47:43 +0000 (00:47 +0000)]
[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

10 years ago[FAST486]
Aleksandar Andrejevic [Fri, 1 Nov 2013 22:39:43 +0000 (22:39 +0000)]
[FAST486]
Implement opcode group 0x0F, 0x01 (SGDT, SIDT, LGDT, LIDT, SMSW and LMSW).
Only INVLPG is not implemented yet.

svn path=/branches/ntvdm/; revision=60824

10 years ago[FAST486]
Aleksandar Andrejevic [Fri, 1 Nov 2013 02:48:28 +0000 (02:48 +0000)]
[FAST486]
Implement the XADD instruction.

svn path=/branches/ntvdm/; revision=60819

10 years ago[FAST486]
Hermès Bélusca-Maïto [Fri, 1 Nov 2013 02:28:47 +0000 (02:28 +0000)]
[FAST486]
Fix the type of a variable.

[NTVDM]
Introduce a BOP handler table for the 256 possible BOP functions and use it.

svn path=/branches/ntvdm/; revision=60818

10 years ago[FAST486]
Aleksandar Andrejevic [Fri, 1 Nov 2013 02:08:34 +0000 (02:08 +0000)]
[FAST486]
Fix a bug in the IRET instruction.

svn path=/branches/ntvdm/; revision=60817

10 years ago[NTVDM]
Aleksandar Andrejevic [Fri, 1 Nov 2013 01:57:40 +0000 (01:57 +0000)]
[NTVDM]
Revert a previous incorrect fix for the PIT.
Modify the PitDecrementCount function to take a parameter instead
of it being called multiple times (which is slower).

svn path=/branches/ntvdm/; revision=60816

10 years agoFix a comment...
Hermès Bélusca-Maïto [Fri, 1 Nov 2013 01:51:15 +0000 (01:51 +0000)]
Fix a comment...

svn path=/branches/ntvdm/; revision=60815

10 years ago[FAST486][NTVDM]
Hermès Bélusca-Maïto [Fri, 1 Nov 2013 01:46:58 +0000 (01:46 +0000)]
[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

10 years ago[FAST486]
Aleksandar Andrejevic [Fri, 1 Nov 2013 00:30:26 +0000 (00:30 +0000)]
[FAST486]
In real mode, the value in the IVT is a far pointer, not an IDT entry.
Fix the case when MemReadCallback is NULL.

svn path=/branches/ntvdm/; revision=60813

10 years ago[FAST486][NTVDM]
Hermès Bélusca-Maïto [Fri, 1 Nov 2013 00:01:07 +0000 (00:01 +0000)]
[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

10 years ago[NTVDM]
Aleksandar Andrejevic [Wed, 30 Oct 2013 22:42:32 +0000 (22:42 +0000)]
[NTVDM]
Fix an EOI condition in the BIOS IRQ handler.

svn path=/branches/ntvdm/; revision=60801

10 years agoFix a comment.
Hermès Bélusca-Maïto [Tue, 29 Oct 2013 21:46:47 +0000 (21:46 +0000)]
Fix a comment.

svn path=/branches/ntvdm/; revision=60791

10 years ago[NTVDM]: DOS:
Hermès Bélusca-Maïto [Tue, 29 Oct 2013 01:55:54 +0000 (01:55 +0000)]
[NTVDM]: DOS:
- The DosErrorLevel is stored as a WORD: its LOWORD is the return code and the HIWORD is the termination code.
- When copying CurrentDirectories[...], be sure that we copy maximum DOS_DIR_LENGTH chars.
- Implement (or stubplement) bunch of INT 21h functions: 0x03, 0x04, 0x05, 0x0C, 0x0D, 0x26, 0x37, 0x47, 0x4D and 0x50. Functions 0x18, 0x1D, 0x1E and 0x20 are NULL functions present in DOS for CP/M compatibility only.
- Fix DOS version querying.
- Use set/getAX() instead of EmulatorSet/GetRegister, and use setCF instead of EmulatorSetFlag.

svn path=/branches/ntvdm/; revision=60790

10 years ago[NTVDM]
Aleksandar Andrejevic [Tue, 29 Oct 2013 00:10:14 +0000 (00:10 +0000)]
[NTVDM]
Save the error code returned by applications.

svn path=/branches/ntvdm/; revision=60789

10 years ago[NTVDM]
Aleksandar Andrejevic [Mon, 28 Oct 2013 02:25:54 +0000 (02:25 +0000)]
[NTVDM]
Improve performance by computing the resolution required by the PIT,
and then using the standard tick count instead of performance counters
when that resolution is low.

svn path=/branches/ntvdm/; revision=60783

10 years agoCode formatting only.
Hermès Bélusca-Maïto [Sun, 27 Oct 2013 23:42:16 +0000 (23:42 +0000)]
Code formatting only.

svn path=/branches/ntvdm/; revision=60782

10 years ago[NTVDM]
Hermès Bélusca-Maïto [Sun, 27 Oct 2013 23:39:52 +0000 (23:39 +0000)]
[NTVDM]
- DOS: the DOS file attributes are one byte.
- BIOS: don't use hardcoded values; use the SEG_OFF_TO_PTR macro introduced earlier; use get/setAX instead of EmulatorGet/SetRegister.

svn path=/branches/ntvdm/; revision=60781

10 years ago[NTVDM]
Hermès Bélusca-Maïto [Sun, 27 Oct 2013 22:31:53 +0000 (22:31 +0000)]
[NTVDM]
DOS: Make use of get/setAX and consorts instead of EmulatorGet/SetRegister(EMULATOR_REG_AX, ...).
Start to implement real (but undocumented?) behaviour according to http://www.delorie.com/djgpp/doc/rbinter/
and http://www.datadoctor.biz/fr/data_recovery_programming_book_chapter6-pageXX.html (change XX by a valid page number)
and http://spike.scu.edu.au/~barry/interrupts.html

svn path=/branches/ntvdm/; revision=60778

10 years ago[NTVDM]: Use SEG_OFF_TO_PTR ( $+ \epsilon * code _eorganization$ ).
Hermès Bélusca-Maïto [Sun, 27 Oct 2013 22:13:18 +0000 (22:13 +0000)]
[NTVDM]: Use SEG_OFF_TO_PTR ( $+ \epsilon * code _eorganization$ ).

svn path=/branches/ntvdm/; revision=60776

10 years ago[NTVDM]: DPRINT1 ReadConsoleInput failures (for debugging purposes) and remove an...
Hermès Bélusca-Maïto [Sun, 27 Oct 2013 22:10:51 +0000 (22:10 +0000)]
[NTVDM]: DPRINT1 ReadConsoleInput failures (for debugging purposes) and remove an unneeded comment.

svn path=/branches/ntvdm/; revision=60775

10 years ago[NTVDM]: Introduce the SEG_OFF_TO_PTR macro for code simplification purposes.
Hermès Bélusca-Maïto [Sun, 27 Oct 2013 22:08:41 +0000 (22:08 +0000)]
[NTVDM]: Introduce the SEG_OFF_TO_PTR macro for code simplification purposes.

svn path=/branches/ntvdm/; revision=60774

10 years ago[NTVDM]
Aleksandar Andrejevic [Sun, 27 Oct 2013 19:08:58 +0000 (19:08 +0000)]
[NTVDM]
The PS/2 should latch the last value that was read in the case of multiple reads.
Modify the BIOS keyboard IRQ handler to support hooks.

svn path=/branches/ntvdm/; revision=60773

10 years ago[NTVDM]
Aleksandar Andrejevic [Sun, 27 Oct 2013 16:34:27 +0000 (16:34 +0000)]
[NTVDM]
Simplify BiosPeekCharacter.
Implement DOS direct console I/O functions.

svn path=/branches/ntvdm/; revision=60772

10 years ago[NTVDM]
Aleksandar Andrejevic [Sun, 27 Oct 2013 14:57:12 +0000 (14:57 +0000)]
[NTVDM]
Implement the BIOS keyboard shift flags.

svn path=/branches/ntvdm/; revision=60771

10 years ago[NTVDM]
Hermès Bélusca-Maïto [Sun, 27 Oct 2013 14:17:34 +0000 (14:17 +0000)]
[NTVDM]
Implement all the missing INT 16h functions but 03h. Also, for simplification purposes (should be fixed later on) act exactly the same for INT 00h and 10h, and for INT 01h and 11h.
Finally, one has to implement setting the BIOS KeybdShiftFlags flag.

svn path=/branches/ntvdm/; revision=60770

10 years ago[NTVDM]: Fix the callback prototypes.
Hermès Bélusca-Maïto [Sun, 27 Oct 2013 12:17:06 +0000 (12:17 +0000)]
[NTVDM]: Fix the callback prototypes.

svn path=/branches/ntvdm/; revision=60769

10 years ago[FAST486]
Hermès Bélusca-Maïto [Sun, 27 Oct 2013 11:42:44 +0000 (11:42 +0000)]
[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

10 years ago[FAST486]
Aleksandar Andrejevic [Sun, 27 Oct 2013 01:38:24 +0000 (01:38 +0000)]
[FAST486]
Physical memory read/write callbacks don't need to return a value.

svn path=/branches/ntvdm/; revision=60765

10 years ago[NTVDM]
Aleksandar Andrejevic [Sun, 27 Oct 2013 01:33:15 +0000 (01:33 +0000)]
[NTVDM]
Push scancodes on to the BIOS keyboard queue even if they're not ASCII.

svn path=/branches/ntvdm/; revision=60764

10 years ago[FAST486]
Aleksandar Andrejevic [Sun, 27 Oct 2013 00:37:01 +0000 (00:37 +0000)]
[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

10 years ago[SOFTX86]
Hermès Bélusca-Maïto [Sat, 26 Oct 2013 21:26:28 +0000 (21:26 +0000)]
[SOFTX86]
Remove the now-unneeded headers. Bye-bye SoftX86 !

svn path=/branches/ntvdm/; revision=60758

10 years ago[SOFTX86]
Aleksandar Andrejevic [Sat, 26 Oct 2013 20:53:33 +0000 (20:53 +0000)]
[SOFTX86]
Remove softx86, as it is no longer used by anything.

svn path=/branches/ntvdm/; revision=60757

10 years ago[NTVDM]
Aleksandar Andrejevic [Sat, 26 Oct 2013 20:48:31 +0000 (20:48 +0000)]
[NTVDM]
Remove softx86 support, and use only fast486, since it is now
sufficiently functional.

svn path=/branches/ntvdm/; revision=60755

10 years ago[NTVDM]
Aleksandar Andrejevic [Sat, 26 Oct 2013 18:01:40 +0000 (18:01 +0000)]
[NTVDM]
Fix the "Read Buffered Input" command and implement "Get STDIN Status".

svn path=/branches/ntvdm/; revision=60753