reactos.git
10 years ago[NTVDM]: IO ports: put our internal handlers and Windows' ones for compatiblity into...
Hermès Bélusca-Maïto [Tue, 24 Dec 2013 12:15:27 +0000 (12:15 +0000)]
[NTVDM]: IO ports: put our internal handlers and Windows' ones for compatiblity into a union.

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

10 years ago[NTVDM]: DOS: Implement INT 29h: DOS 2+ Fast Console Output.
Hermès Bélusca-Maïto [Mon, 23 Dec 2013 22:01:17 +0000 (22:01 +0000)]
[NTVDM]: DOS: Implement INT 29h: DOS 2+ Fast Console Output.

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

10 years ago[NTVDM]: Add support for Windows' VDD_IO_HANDLERS in our I/O ports emulation.
Hermès Bélusca-Maïto [Mon, 23 Dec 2013 21:16:57 +0000 (21:16 +0000)]
[NTVDM]: Add support for Windows' VDD_IO_HANDLERS in our I/O ports emulation.

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

10 years ago[DDK]: Define registry manipulation APIs.
Hermès Bélusca-Maïto [Mon, 23 Dec 2013 18:34:30 +0000 (18:34 +0000)]
[DDK]: Define registry manipulation APIs.

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

10 years ago[NTVDM]
Hermès Bélusca-Maïto [Mon, 23 Dec 2013 18:17:29 +0000 (18:17 +0000)]
[NTVDM]
- Implement and export VDDInstallIOHook and VDDDeInstallIOHook; rework EmulatorRead/WriteIo to take into account for different port handlers' sizes (byte, word, dword). Still WIP and may be subject to renamings... RegisterIoPort needs to be converted.
- Stubplement and export getIntelRegistersPointer.
- Export c_get/setXX functions which are aliases to get/setXX functions, for MIPS NTVDM compatibility.

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

10 years ago[NTVDM]
Hermès Bélusca-Maïto [Mon, 23 Dec 2013 18:09:18 +0000 (18:09 +0000)]
[NTVDM]
- Simplify EmulatorReadMemory (first MMIO-mapped devices copy their memory image back to the VM' memory area, then data is read via RtlCopyMemory), and EmulatorWriteMemory (simplify VgaBuffer computation and rename this variable accordingly, for readability purposes).
- Fix Sim32pGetVDMPointer and MGetVdmPointer prototypes.

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

10 years ago[NTVDM]: Remove unneeded WINAPI convention calls.
Hermès Bélusca-Maïto [Mon, 23 Dec 2013 18:04:32 +0000 (18:04 +0000)]
[NTVDM]: Remove unneeded WINAPI convention calls.

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

10 years ago[DDK]
Hermès Bélusca-Maïto [Mon, 23 Dec 2013 17:40:50 +0000 (17:40 +0000)]
[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

10 years ago[FAST486]: Fix a comment.
Aleksandar Andrejevic [Sat, 21 Dec 2013 03:50:19 +0000 (03:50 +0000)]
[FAST486]: Fix a comment.

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

10 years ago[FAST486]
Aleksandar Andrejevic [Sat, 21 Dec 2013 03:48:46 +0000 (03:48 +0000)]
[FAST486]
Implement the LSL instruction.
Remove instructions that don't exist on a 486 from the TODO list.

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

10 years ago[NTVDM]
Hermès Bélusca-Maïto [Wed, 18 Dec 2013 01:16:54 +0000 (01:16 +0000)]
[NTVDM]
Hackplement BOP_CMD function 0x08: "Launch external command". Still WIP.
Explanation: Launching a command from command.com starts (under certain conditions not implemented there) "cmd.exe /c <the_command>"

See https://groups.google.com/forum/#!topic/microsoft.public.win2000.cmdprompt.admin/n5KbegKJuE0
and http://technet.microsoft.com/en-us/library/cc723564.aspx#XSLTsection123121120120
subsection "CMD.EXE and COMMAND.COM":
"Be aware that a command shell is not an MS-DOS command prompt, even though it shares the same icon.
The Windows NT command shell is a full 32-bit Windows NT console application that resides in the CMD.EXE executable file.
The MS-DOS command prompt is a 16-bit DOS application that resides in the COMMAND.COM executable file.
Because COMMAND.COM is a 16-bit DOS executable, Windows NT executes this shell within a Windows NT virtual DOS machine (VDM).
COMMAND.COM is supplied primarily for compatibility with MS-DOS.
[...]
This behavior reveals a quite subtle feature of Windows NT that is very important. The 16-bit MS-DOS shell (COMMAND.COM)
that ships with Windows NT is specially designed for Windows NT. When a command is entered for execution by this shell,
it does not actually execute it. Instead, it packages the command text and sends it to a 32-bit CMD.EXE command shell for
execution. Because all commands are actually executed by CMD.EXE (the Windows NT command shell), the 16-bit shell inherits
all the features and facilities of the full Windows NT shell."

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

10 years agoVDD really means "Virtual Device Drivers".
Hermès Bélusca-Maïto [Tue, 17 Dec 2013 23:13:11 +0000 (23:13 +0000)]
VDD really means "Virtual Device Drivers".

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

10 years ago[NTVDM]
Hermès Bélusca-Maïto [Tue, 17 Dec 2013 23:03:23 +0000 (23:03 +0000)]
[NTVDM]
- Halfplement and export VdmMapFlat
- Make mention of the existence of VdmFlushCache and VdmUnmapFlat, which are not exported in x86 builds (macros are therefore defined to just return TRUE) but are exported in MIPS... builds...
See VDDSVC.H and NT_VDD.H in the DDK
(those headers don't exist in ROS; we'll have to create them later on).

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

10 years ago[NTVDM]
Hermès Bélusca-Maïto [Tue, 17 Dec 2013 22:34:08 +0000 (22:34 +0000)]
[NTVDM]
Studying the "vddtest" example mentioned in revision 61283 allowed me to see that valid VDD DLL "handles" start at 1 and cannot be equal to zero.
Add helper macros to convert from indices to handles. Fixes "vddtest" example.

Have fun at running it :)

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

10 years ago[NTVDM]
Hermès Bélusca-Maïto [Tue, 17 Dec 2013 22:10:58 +0000 (22:10 +0000)]
[NTVDM]
- Thanks Thomas for having pointed me towards the fact that the NTVDM exports were really STDCALL and not CDECL (as I've thought first, because originally I was checking whether the getXX() functions were stdcall or not, and distinguishing VOID stdcall or cdecl functions without the symbols was hopeless).
- Halfplement and export Sim32pGetVDMPointer and MGetVdmPointer, needed to run correctly the RageStorm "galaxy" sample mentioned yesterday (see revision 61283). Now it loads and the dispatch call works \o/
- VDD_INIT_PROC and VDD_DISPATCH_PROC have the same signature --> rename them to VDD_PROC.

Have fun at testing!

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

10 years ago[NTVDM]
Hermès Bélusca-Maïto [Tue, 17 Dec 2013 02:19:52 +0000 (02:19 +0000)]
[NTVDM]
Implement basic VDD support:
implement the (un)register & dispatch call BOP (called BOP_3RDPARTY): see "Undocumented DOS" by Schulman et al. page 267 (as always ;) ), as well as:
http://www.ragestorm.net/tutorial?id=27 - "Tutorial - Calling Win32 from DOS"
http://www.airborn.com.au/layout/vddtest.html - "DOS to 32 bit DLL under XP - an example" (almost the same explanations as the previous article)
http://sta.c64.org/blog/dosvddaccess.html - "Accessing Windows device drivers from DOS programs"
and...
... your lovely Win2k / Win2k3 DDK section: "Device Technologies/Other Devices/Devices Requiring VDDs" !!

Ready to test? :D

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

10 years ago[NTVDM]: Implement BOP_DEBUGGER (see: "Undocumented DOS" by Schulman et al., page...
Hermès Bélusca-Maïto [Mon, 16 Dec 2013 23:57:35 +0000 (23:57 +0000)]
[NTVDM]: Implement BOP_DEBUGGER (see: "Undocumented DOS" by Schulman et al., page 267) which allows you to break into a debugger from a 16-bit app (Vampyre, it can be useful for you ;) ).

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

10 years ago[NTVDM]
Hermès Bélusca-Maïto [Sun, 15 Dec 2013 16:30:28 +0000 (16:30 +0000)]
[NTVDM]
- As already done for interrupts and I/O ports, add a registering system for BOPs.
- INT32: Move ControlBop to the 32-bit interrupts module where it is used only.
- DOS: Add (un)documented BOP_DOS (0x50) and BOP_CMD(0x54) used respectively by NTIO.SYS/NTDOS.SYS and by COMMAND.COM.
  It appears that they take an extra parameter (so, skip 1 byte-instruction after the BOP instruction as we do for the Control BOP 0xFF).
  See "Undocumented DOS 2nd edition" by Schulman et al., page 267.

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

10 years ago[NTVDM]: Report the "correct" DOS version: 5.00 (or 5.50 depending on which DOS funct...
Hermès Bélusca-Maïto [Sun, 15 Dec 2013 15:35:38 +0000 (15:35 +0000)]
[NTVDM]: Report the "correct" DOS version: 5.00 (or 5.50 depending on which DOS function you call) for NT+ compatibility (allows us to test windows' command.com, debug.com and so on... and therefore to know which BOPs they call).

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

10 years ago[FAST486]
Aleksandar Andrejevic [Sun, 15 Dec 2013 05:08:57 +0000 (05:08 +0000)]
[FAST486]
Remove the waiting code for the HLT instruction until I figure out how to do it properly.

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

10 years ago[FAST486]
Aleksandar Andrejevic [Sun, 15 Dec 2013 05:02:59 +0000 (05:02 +0000)]
[FAST486]
Fix the calculation of PageLength for the last page.

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

10 years ago[FAST486]
Aleksandar Andrejevic [Sun, 15 Dec 2013 04:15:03 +0000 (04:15 +0000)]
[FAST486]
Fix linear memory access when paging is enabled.

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

10 years ago[FAST486]
Aleksandar Andrejevic [Sat, 14 Dec 2013 02:30:42 +0000 (02:30 +0000)]
[FAST486]
The LDT can be loaded with a NULL descriptor. That invalidates the LDT but doesn't cause
any exception.

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

10 years ago[FAST486]
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

10 years ago[NTVDM]: VGA: Fix VGA_DAC_TO_COLOR macro (/me looks at [TheFlash]... :) )
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

10 years ago[FAST486]
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

10 years ago[NTVDM]
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

10 years ago[NTVDM]
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

10 years ago[NTVDM]
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

10 years ago[NTVDM]
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

10 years ago[NTVDM]
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

10 years agoFix my Engrish :)
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

10 years ago[NTVDM]
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

10 years ago[NTVDM]
Aleksandar Andrejevic [Fri, 6 Dec 2013 04:51:47 +0000 (04:51 +0000)]
[NTVDM]
Fix race conditions.

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

10 years ago[NTVDM]
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

10 years ago[NTVDM]
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

10 years ago[NTVDM]
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

10 years ago[FAST486]
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

10 years ago[NTVDM]: Code formatting only.
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

10 years ago[FAST486]
Aleksandar Andrejevic [Tue, 3 Dec 2013 01:30:15 +0000 (01:30 +0000)]
[FAST486]
Implement the BOUND instruction.

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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[NTVDM]
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

10 years ago[FAST486]
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

10 years ago[NTVDM]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[NTVDM]
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

10 years ago[NTVDM]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[NTVDM]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[NTVDM] : Implement getMSW and setMSW for getting and setting the Machine Status...
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

10 years ago[NTVDM]
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

10 years ago[NTVDM]
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

10 years ago[NTVDM]
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

10 years ago[NTVDM]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
Aleksandar Andrejevic [Thu, 14 Nov 2013 03:03:23 +0000 (03:03 +0000)]
[FAST486]
Fix previous fix.

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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
Aleksandar Andrejevic [Wed, 13 Nov 2013 22:34:38 +0000 (22:34 +0000)]
[FAST486]
Fix previous fix.

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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

10 years ago[FAST486]
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

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