Aleksandar Andrejevic [Sat, 14 Dec 2013 02:13:01 +0000 (02:13 +0000)]
[FAST486]
Fix the emulation of the Local Descriptor Table.
svn path=/branches/ntvdm/; revision=61268
Hermès Bélusca-Maïto [Fri, 13 Dec 2013 23:14:33 +0000 (23:14 +0000)]
[NTVDM]: VGA: Fix VGA_DAC_TO_COLOR macro (/me looks at [TheFlash]... :) )
svn path=/branches/ntvdm/; revision=61267
Aleksandar Andrejevic [Fri, 13 Dec 2013 03:32:41 +0000 (03:32 +0000)]
[FAST486]
Implement the extended opcode group 0x0F, 0x00 (SLDT, STR, LLDT, LTR, VERR, VERW).
svn path=/branches/ntvdm/; revision=61264
Hermès Bélusca-Maïto [Thu, 12 Dec 2013 20:09:24 +0000 (20:09 +0000)]
[NTVDM]
- Add/fix few comments;
- Don't forget to redisable access to AC registers after modifying them in int 10h. Usurp, please retest Rescue Rover 2 :)
- Make EmulatorGet/Set/ClearFlag internal functions only and use set/get<FLAG> instead.
svn path=/branches/ntvdm/; revision=61263
Aleksandar Andrejevic [Tue, 10 Dec 2013 02:56:42 +0000 (02:56 +0000)]
[NTVDM]
Add echo to INT 21h, function AH = 3Fh.
svn path=/branches/ntvdm/; revision=61257
Aleksandar Andrejevic [Tue, 10 Dec 2013 01:30:53 +0000 (01:30 +0000)]
[NTVDM]
Fix the file reading subfunction (AH = 3Fh) of INT 21h.
When reading from the console, it always stops on a carriage return.
svn path=/branches/ntvdm/; revision=61256
Hermès Bélusca-Maïto [Sun, 8 Dec 2013 14:22:27 +0000 (14:22 +0000)]
[NTVDM]
Rewrite the VGA emulation.
Nah, it's a joke!
- Store VGA registers setup in VGA_REGISTERS structure.
- Improve BiosSetVideoMode and introduce a VgaSetRegisters function for setting VGA regs.
- Initialize Bda->CrtBasePort: it is used to determine the address of some I/O ports which depend on whether we are in color or monochrome mode.
- Add UnregisterIoPort in io.c (and fix some DPRINTs) (needed for VGA).
- When setting the misc. VGA register, check whether we're going to monochrome emulation, and reset some port addresses in that case.
svn path=/branches/ntvdm/; revision=61246
Aleksandar Andrejevic [Sat, 7 Dec 2013 03:47:58 +0000 (03:47 +0000)]
[NTVDM]
Use the EGA palette for EGA modes.
svn path=/branches/ntvdm/; revision=61242
Hermès Bélusca-Maïto [Sat, 7 Dec 2013 00:03:39 +0000 (00:03 +0000)]
Fix my Engrish :)
svn path=/branches/ntvdm/; revision=61240
Hermès Bélusca-Maïto [Sat, 7 Dec 2013 00:01:24 +0000 (00:01 +0000)]
[NTVDM]
- Last race condition fix (see revision 61230).
- Add a comment why we do twice the same emptiness check (one before holding the mutex and one just after).
svn path=/branches/ntvdm/; revision=61239
Aleksandar Andrejevic [Fri, 6 Dec 2013 04:51:47 +0000 (04:51 +0000)]
[NTVDM]
Fix race conditions.
svn path=/branches/ntvdm/; revision=61230
Aleksandar Andrejevic [Fri, 6 Dec 2013 04:35:58 +0000 (04:35 +0000)]
[NTVDM]
Improve the keyboard event handling.
Clean up the PS/2 code a bit.
svn path=/branches/ntvdm/; revision=61229
Aleksandar Andrejevic [Wed, 4 Dec 2013 00:43:11 +0000 (00:43 +0000)]
[NTVDM]
Also serialize access to KeyboardQueueEmpty.
svn path=/branches/ntvdm/; revision=61215
Aleksandar Andrejevic [Wed, 4 Dec 2013 00:38:52 +0000 (00:38 +0000)]
[NTVDM]
Fix the VGA refresh rate.
Serialize access to the PS/2 keyboard queue.
svn path=/branches/ntvdm/; revision=61214
Hermès Bélusca-Maïto [Tue, 3 Dec 2013 23:51:51 +0000 (23:51 +0000)]
[FAST486]
- Call Fast486GetCurrentPrivLevel only when needed.
- Fix a type.
svn path=/branches/ntvdm/; revision=61211
Hermès Bélusca-Maïto [Tue, 3 Dec 2013 23:50:33 +0000 (23:50 +0000)]
[NTVDM]: Code formatting only.
svn path=/branches/ntvdm/; revision=61210
Aleksandar Andrejevic [Tue, 3 Dec 2013 01:30:15 +0000 (01:30 +0000)]
[FAST486]
Implement the BOUND instruction.
svn path=/branches/ntvdm/; revision=61205
Aleksandar Andrejevic [Tue, 3 Dec 2013 00:56:47 +0000 (00:56 +0000)]
[FAST486]
Check for division by zero, and generate the appropriate exception.
svn path=/branches/ntvdm/; revision=61204
Aleksandar Andrejevic [Tue, 3 Dec 2013 00:12:55 +0000 (00:12 +0000)]
[FAST486]
The current "fast" method used in MOVS gives incorrect results. It has been temporarily
replaced with a slow method that works correctly.
The string functions do nothing when CX is 0 on entry, fix CMPS and SCAS.
svn path=/branches/ntvdm/; revision=61203
Aleksandar Andrejevic [Mon, 2 Dec 2013 01:02:17 +0000 (01:02 +0000)]
[NTVDM]
Compile NTVDM even on non-i386 architectures.
svn path=/branches/ntvdm/; revision=61194
Aleksandar Andrejevic [Sun, 1 Dec 2013 03:16:49 +0000 (03:16 +0000)]
[FAST486]
Fix MOVS and STOS when DF = 1. The starting position in the block was off by 1.
svn path=/branches/ntvdm/; revision=61163
Aleksandar Andrejevic [Sun, 1 Dec 2013 00:17:46 +0000 (00:17 +0000)]
[NTVDM]
Set AL to 0 for unimplemented functions in INT 21h.
svn path=/branches/ntvdm/; revision=61161
Aleksandar Andrejevic [Sat, 30 Nov 2013 23:45:59 +0000 (23:45 +0000)]
[FAST486]
Revert r61158, and fix the prefix issue correctly, but resetting the flags
again after the call to Fast486InterruptInternal.
svn path=/branches/ntvdm/; revision=61160
Aleksandar Andrejevic [Sat, 30 Nov 2013 23:14:54 +0000 (23:14 +0000)]
[FAST486]
Use the size of CS, and not SS, in Fast486OpcodePopReg.
svn path=/branches/ntvdm/; revision=61159
Aleksandar Andrejevic [Sat, 30 Nov 2013 22:17:18 +0000 (22:17 +0000)]
[FAST486]
Move the prefix reset below the interrupt check, because Fast486InterruptInternal
might set OPSIZE in some circumstances.
svn path=/branches/ntvdm/; revision=61158
Hermès Bélusca-Maïto [Sat, 30 Nov 2013 22:01:44 +0000 (22:01 +0000)]
[NTVDM]
- Remove some DPRINTs.
- Fix a bug in VgaEnterGraphicsMode (erroneous change of the real saved resolution when going into DoubleVision(TM) mode).
- Do not update the text cursor when being in graphics mode (otherwise I've already hit some ScanlineSize==0 problems) <-- [TheFlash], can you recheck that, please?
- Little optimisation: do not do anything in VgaRefreshDisplay if nothing has to be done.
svn path=/branches/ntvdm/; revision=61157
Aleksandar Andrejevic [Sat, 30 Nov 2013 03:59:26 +0000 (03:59 +0000)]
[NTVDM]
Fix the PIT square wave generator.
svn path=/branches/ntvdm/; revision=61151
Aleksandar Andrejevic [Sat, 30 Nov 2013 02:03:51 +0000 (02:03 +0000)]
[FAST486]
FPU instructions never generate #UD. If CR0.EM is set, they generate #NM.
If there is no FPU and CR0.EM is cleared, they do nothing.
Add a helper macro FPU_ST for accessing FPU registers.
Add a compile-time option to disable the FPU.
svn path=/branches/ntvdm/; revision=61150
Aleksandar Andrejevic [Fri, 29 Nov 2013 03:00:59 +0000 (03:00 +0000)]
[FAST486]
Start implementing the FPU. Stubplement the FPU opcode handlers.
svn path=/branches/ntvdm/; revision=61141
Hermès Bélusca-Maïto [Tue, 26 Nov 2013 20:20:51 +0000 (20:20 +0000)]
[NTVDM]
- Move some PS/2 initialization from bios.c to ps2.c
- NULLify interrupt entries which are in fact pointers to data tables.
- Add a framework for adding I/O port handlers.
svn path=/branches/ntvdm/; revision=61107
Aleksandar Andrejevic [Tue, 26 Nov 2013 18:11:53 +0000 (18:11 +0000)]
[FAST486]
Fix the order of operations.
svn path=/branches/ntvdm/; revision=61106
Aleksandar Andrejevic [Tue, 26 Nov 2013 17:56:18 +0000 (17:56 +0000)]
[FAST486]
Complete the previous commit with a fix for Fast486WriteLinearMemory too.
svn path=/branches/ntvdm/; revision=61105
Aleksandar Andrejevic [Tue, 26 Nov 2013 17:55:07 +0000 (17:55 +0000)]
[FAST486]
Handle the case when the last page is also the first page in Fast486ReadLinearMemory ( when paging is enabled).
svn path=/branches/ntvdm/; revision=61104
Aleksandar Andrejevic [Sat, 23 Nov 2013 01:34:03 +0000 (01:34 +0000)]
[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
Aleksandar Andrejevic [Fri, 22 Nov 2013 02:47:48 +0000 (02:47 +0000)]
[FAST486]
Fix CF calculation in SHRD/SHLD.
svn path=/branches/ntvdm/; revision=61070
Aleksandar Andrejevic [Fri, 22 Nov 2013 02:02:05 +0000 (02:02 +0000)]
[FAST486]
DAA, DAS: Update the flags.
AAA, AAS: Subtract from AX instead of AL. The specification says AL, but
so far in all known CPUs and emulators, AX is subtracted.
AAD: Clear AH.
svn path=/branches/ntvdm/; revision=61069
Aleksandar Andrejevic [Fri, 22 Nov 2013 01:22:00 +0000 (01:22 +0000)]
[FAST486]
Fix the calculation of AF in ADC and the calculation of AF and CF in SBB.
svn path=/branches/ntvdm/; revision=61068
Aleksandar Andrejevic [Fri, 22 Nov 2013 00:46:28 +0000 (00:46 +0000)]
[FAST486]
In the string functions, use ADSIZE and not OPSIZE.
In SCAS and CMPS, fix the "(1 << 32) - 1" bug.
svn path=/branches/ntvdm/; revision=61067
Aleksandar Andrejevic [Thu, 21 Nov 2013 04:07:15 +0000 (04:07 +0000)]
[FAST486]
Put the conditional expression in parenthesis so that the addition happens after it.
svn path=/branches/ntvdm/; revision=61063
Aleksandar Andrejevic [Thu, 21 Nov 2013 03:18:34 +0000 (03:18 +0000)]
[FAST486]
Fix a bug in Fast486LoadSegment.
svn path=/branches/ntvdm/; revision=61062
Aleksandar Andrejevic [Wed, 20 Nov 2013 14:21:47 +0000 (14:21 +0000)]
[FAST486]
The top half of EIP is cleared after a 16-bit jump.
svn path=/branches/ntvdm/; revision=61058
Aleksandar Andrejevic [Wed, 20 Nov 2013 10:48:26 +0000 (10:48 +0000)]
[FAST486]
Read the LDT instead of the GDT when the table indicator is set.
svn path=/branches/ntvdm/; revision=61057
Aleksandar Andrejevic [Wed, 20 Nov 2013 10:43:12 +0000 (10:43 +0000)]
[FAST486]
Implement privilege checks when loading the code selector.
svn path=/branches/ntvdm/; revision=61056
Aleksandar Andrejevic [Wed, 20 Nov 2013 08:01:10 +0000 (08:01 +0000)]
[FAST486]
Make the parameters to Fast486ReadModrm*Operands optional, so that
unnecessary extra reads aren't performed. This also eliminates the
need for dummy variables.
svn path=/branches/ntvdm/; revision=61055
Hermès Bélusca-Maïto [Mon, 18 Nov 2013 20:25:10 +0000 (20:25 +0000)]
[NTVDM] : Implement getMSW and setMSW for getting and setting the Machine Status Word (lower word of CR0).
[FAST486]: MSW = Machine Status Word
svn path=/branches/ntvdm/; revision=61044
Hermès Bélusca-Maïto [Mon, 18 Nov 2013 01:16:19 +0000 (01:16 +0000)]
[NTVDM]
- Get rid of EmulatorGetRegister and EmulatorSetRegister and replace their calls with the proper definitions.
- Get rid of the enums EMULATOR_REG_* and use the FAST486_REG_* definitions instead.
svn path=/branches/ntvdm/; revision=61034
Hermès Bélusca-Maïto [Mon, 18 Nov 2013 00:45:00 +0000 (00:45 +0000)]
[NTVDM]
- Implement and export getEFLAGS and setEFLAGS.
- Do some code reorganization (move all registers-related functions into "registers.c").
svn path=/branches/ntvdm/; revision=61033
Hermès Bélusca-Maïto [Sun, 17 Nov 2013 20:44:23 +0000 (20:44 +0000)]
[NTVDM]
Initialize LastClockUpdate, LastVerticalRefresh and LastCyclePrintout with the value of StartTickCount.
svn path=/branches/ntvdm/; revision=61021
Hermès Bélusca-Maïto [Sat, 16 Nov 2013 23:11:54 +0000 (23:11 +0000)]
[NTVDM]
- Use MAX/MINSHORT instead of CRT macros.
- Include only the relevant headers.
svn path=/branches/ntvdm/; revision=61014
Aleksandar Andrejevic [Fri, 15 Nov 2013 20:49:48 +0000 (20:49 +0000)]
[FAST486]
- When accessing memory using ESP, make the SS segment default.
- The INT instructions always pushes 16-bit values in real mode, regardless
of the operand/address size attributes.
svn path=/branches/ntvdm/; revision=61000
Aleksandar Andrejevic [Fri, 15 Nov 2013 04:16:25 +0000 (04:16 +0000)]
[FAST486]
The CS cached descriptor has the default operand size, even for stack
operations.
svn path=/branches/ntvdm/; revision=60996
Aleksandar Andrejevic [Fri, 15 Nov 2013 02:32:08 +0000 (02:32 +0000)]
[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
Aleksandar Andrejevic [Thu, 14 Nov 2013 03:11:33 +0000 (03:11 +0000)]
[FAST486]
Fix the previous fix. ESI was already updated earlier in the function.
svn path=/branches/ntvdm/; revision=60990
Aleksandar Andrejevic [Thu, 14 Nov 2013 03:03:23 +0000 (03:03 +0000)]
[FAST486]
Fix previous fix.
svn path=/branches/ntvdm/; revision=60989
Aleksandar Andrejevic [Thu, 14 Nov 2013 02:54:20 +0000 (02:54 +0000)]
[FAST486]
Update the register values in REP LODS.
svn path=/branches/ntvdm/; revision=60988
Aleksandar Andrejevic [Thu, 14 Nov 2013 02:39:54 +0000 (02:39 +0000)]
[FAST486]
Fix the BSF and BSR instructions. Partially fix SHLD and SHRD.
svn path=/branches/ntvdm/; revision=60987
Aleksandar Andrejevic [Wed, 13 Nov 2013 22:34:38 +0000 (22:34 +0000)]
[FAST486]
Fix previous fix.
svn path=/branches/ntvdm/; revision=60985
Aleksandar Andrejevic [Wed, 13 Nov 2013 22:33:37 +0000 (22:33 +0000)]
[FAST486]
XADD: Fix the order of operations.
POP <modrm>: The value must be popped from the stack before parsing the
Mod-Reg-R/M, because of the "POP DWORD [ESP]" case.
svn path=/branches/ntvdm/; revision=60984
Aleksandar Andrejevic [Wed, 13 Nov 2013 19:20:04 +0000 (19:20 +0000)]
[FAST486]
LOOP and JECXZ use the ADSIZE attribute, not OPSIZE.
svn path=/branches/ntvdm/; revision=60977
Aleksandar Andrejevic [Wed, 13 Nov 2013 18:14:01 +0000 (18:14 +0000)]
[FAST486]
The bit number should be normalized to [0, DataSize- 1], not [0, 2 ^ DataSize - 1].
svn path=/branches/ntvdm/; revision=60975
Aleksandar Andrejevic [Wed, 13 Nov 2013 13:32:00 +0000 (13:32 +0000)]
[FAST486]
Fix a bug in the ROL and ROR instructions.
svn path=/branches/ntvdm/; revision=60972
Aleksandar Andrejevic [Wed, 13 Nov 2013 02:38:36 +0000 (02:38 +0000)]
[FAST486]
Fix several bugs in Fast486RotateOperation.
svn path=/branches/ntvdm/; revision=60969
Aleksandar Andrejevic [Tue, 12 Nov 2013 21:55:05 +0000 (21:55 +0000)]
[FAST486]
Don't return uninitialized variables.
svn path=/branches/ntvdm/; revision=60967
Aleksandar Andrejevic [Tue, 12 Nov 2013 19:25:50 +0000 (19:25 +0000)]
[FAST486]
In rotate operations, the count is always masked with 0x1F, regardless
of the operand size.
svn path=/branches/ntvdm/; revision=60966
Aleksandar Andrejevic [Tue, 12 Nov 2013 18:40:13 +0000 (18:40 +0000)]
[FAST486]
Don't forget to check for the operand/address size prefix.
svn path=/branches/ntvdm/; revision=60964
Aleksandar Andrejevic [Tue, 12 Nov 2013 18:21:30 +0000 (18:21 +0000)]
[FAST486]
Fix the 3-byte IMUL instruction. If the operand size is 16-bit, the
result should be written in 16-bit too.
svn path=/branches/ntvdm/; revision=60963
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
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
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
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
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
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
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
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
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
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
Aleksandar Andrejevic [Mon, 11 Nov 2013 15:27:54 +0000 (15:27 +0000)]
[FAST486]
Fix Fast486GetCurrentPrivLevel.
svn path=/branches/ntvdm/; revision=60939
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
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
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
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
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
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
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
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
Aleksandar Andrejevic [Mon, 11 Nov 2013 00:57:59 +0000 (00:57 +0000)]
[FAST486]
Implement SHLD and SHRD.
svn path=/branches/ntvdm/; revision=60930
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
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
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
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
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
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
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
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
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
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
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
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
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
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