Commit graph

25 commits

Author SHA1 Message Date
Aleksandar Andrejevic 4c80791d47 [FAST486]
Fix linear memory access when paging is enabled.


svn path=/branches/ntvdm/; revision=61274
2013-12-15 04:15:03 +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
Hermès Bélusca-Maïto a2bd742ecd [FAST486]
- Call Fast486GetCurrentPrivLevel only when needed.
- Fix a type.

svn path=/branches/ntvdm/; revision=61211
2013-12-03 23:51:51 +00:00
Aleksandar Andrejevic d358641f7c [FAST486]
Fix the order of operations.


svn path=/branches/ntvdm/; revision=61106
2013-11-26 18:11:53 +00:00
Aleksandar Andrejevic 556bace69f [FAST486]
Complete the previous commit with a fix for Fast486WriteLinearMemory too.


svn path=/branches/ntvdm/; revision=61105
2013-11-26 17:56:18 +00:00
Aleksandar Andrejevic f45361126f [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
2013-11-26 17:55:07 +00:00
Aleksandar Andrejevic 37b16fec31 [FAST486]
Fix a bug in Fast486LoadSegment.


svn path=/branches/ntvdm/; revision=61062
2013-11-21 03:18:34 +00:00
Aleksandar Andrejevic 459e3a6f48 [FAST486]
Read the LDT instead of the GDT when the table indicator is set.


svn path=/branches/ntvdm/; revision=61057
2013-11-20 10:48:26 +00:00
Aleksandar Andrejevic e2fb91925e [FAST486]
Implement privilege checks when loading the code selector.


svn path=/branches/ntvdm/; revision=61056
2013-11-20 10:43:12 +00:00
Aleksandar Andrejevic b456a8b355 [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
2013-11-20 08:01:10 +00:00
Aleksandar Andrejevic 4b005f11bf [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
2013-11-15 20:49:48 +00:00
Aleksandar Andrejevic f5d0d3e784 [FAST486]
The CS cached descriptor has the default operand size, even for stack
operations.


svn path=/branches/ntvdm/; revision=60996
2013-11-15 04:16:25 +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 cd496c8e21 [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
2013-11-13 22:33:37 +00:00
Aleksandar Andrejevic c7a7dbe7e2 [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
2013-11-11 19:08:28 +00:00
Aleksandar Andrejevic 1d21bb125f [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
2013-11-11 17:24:22 +00:00
Hermès Bélusca-Maïto 77930f2a21 [FAST486]: Put the inlined function in its proper file. No code changes.
svn path=/branches/ntvdm/; revision=60940
2013-11-11 15:34:18 +00:00
Aleksandar Andrejevic 7ec93e81ff [FAST486]
Increment SP, not ESP for 16-bit stacks.


svn path=/branches/ntvdm/; revision=60925
2013-11-10 22:49:19 +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 a106a3b21e [FAST486]: Code formatting only (remove endlines spaces).
svn path=/branches/ntvdm/; revision=60894
2013-11-09 14:23:40 +00:00
Aleksandar Andrejevic 6ecc2dfd24 [FAST486]
BP is certainly not the same register as BX.


svn path=/branches/ntvdm/; revision=60851
2013-11-03 18:31:00 +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
Aleksandar Andrejevic 1c12c6fe0d [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
2013-11-01 00:30:26 +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
Renamed from lib/soft386/common.inl (Browse further)