Commit graph

224 commits

Author SHA1 Message Date
Aleksandar Andrejevic f86c0161e0 [NTVDM]
Fix bug in DosChangeDirectory.


svn path=/branches/ntvdm/; revision=59701
2013-08-11 21:07:09 +00:00
Aleksandar Andrejevic 5921c465db [NTVDM]
Keep a list of current directories for all drives.
Implement functions that change the default drive and current directory.


svn path=/branches/ntvdm/; revision=59700
2013-08-11 20:54:07 +00:00
Aleksandar Andrejevic b60ee76f22 [NTVDM]
Use DOS_CMDLINE_LENGTH instead of MAX_PATH.
Fix bug in DosInitializePsp which allowed writing past the end of the Program Segment Prefix (PSP).


svn path=/branches/ntvdm/; revision=59693
2013-08-10 21:41:20 +00:00
Hermès Bélusca-Maïto 2288b2c576 [NTVDM]
- Use up to 256 parameters for programs (as suggested by the parsing while loop), but don't hardcode this values in many other places.
- The passed command line to ntvdm should be as long as MAX_PATH.

svn path=/branches/ntvdm/; revision=59691
2013-08-10 20:50:37 +00:00
Aleksandar Andrejevic b34e5646dd [NTVDM]
Optimize screen clearing by implementing it as a helper function in vga.c.


svn path=/branches/ntvdm/; revision=59690
2013-08-10 19:30:14 +00:00
Aleksandar Andrejevic acf127fe24 [NTVDM]
Clear the screen when switching video modes.


svn path=/branches/ntvdm/; revision=59688
2013-08-10 19:24:00 +00:00
Aleksandar Andrejevic 7b2978c43f Synchronize with trunk to fix spec2def issue.
[NTVDM]
Implement write modes and latch register for VGA.


svn path=/branches/ntvdm/; revision=59687
2013-08-10 17:06:04 +00:00
Aleksandar Andrejevic 022895e518 [NTVDM]
Synchronize with trunk again to fix important bugs in the build system.
Implement register control functions which should be exported (Adapted from a patch by Hermes Belusca-Maito).
The actual export is temporarily disabled because a bug in the build system compiles ntvdm as a DLL instead of an EXE.


svn path=/branches/ntvdm/; revision=59684
2013-08-09 23:52:08 +00:00
Hermès Bélusca-Maïto 6a2534345c Fix formatting, no code changes.
svn path=/branches/ntvdm/; revision=59682
2013-08-09 18:55:35 +00:00
Hermès Bélusca-Maïto 2f3827d040 [NTVDM]
Simplify code.

svn path=/branches/ntvdm/; revision=59681
2013-08-09 14:01:43 +00:00
Aleksandar Andrejevic b62ad02740 [NTVDM]
- Enable TESTING by default until the correct way to load ntvdm is found.
- Calculate the character height instead of hardcoding in the BDA.


svn path=/branches/ntvdm/; revision=59678
2013-08-09 13:14:56 +00:00
Hermès Bélusca-Maïto d497b99734 [NTVDM]
Implement INT 10h, function 04h (Query Light Pen) (deprecated)

svn path=/branches/ntvdm/; revision=59677
2013-08-09 13:06:01 +00:00
Hermès Bélusca-Maïto 5670c032a9 Fix the fix.
svn path=/branches/ntvdm/; revision=59676
2013-08-09 11:55:31 +00:00
Hermès Bélusca-Maïto fda0b22ee8 [NTVDM]
Fix cursor position.

svn path=/branches/ntvdm/; revision=59675
2013-08-09 11:41:13 +00:00
Aleksandar Andrejevic 2f908ec723 [NTVDM]
Calculate the text height instead of using a hardcoded value.


svn path=/branches/ntvdm/; revision=59674
2013-08-09 09:24:40 +00:00
Hermès Bélusca-Maïto bd75425efd [NTVDM]
- Fix usage of the console framebuffer mutex (used only with graphics screen buffers).
- Do not check for text/graphics mode when updating each scan line, in VgaUpdateFramebuffer.

svn path=/branches/ntvdm/; revision=59673
2013-08-09 00:13:54 +00:00
Aleksandar Andrejevic 12b2347206 [NTVDM]
Fix the default cursor size and cursor size calculation.


svn path=/branches/ntvdm/; revision=59672
2013-08-07 21:57:07 +00:00
Aleksandar Andrejevic 94b6893a01 [NTVDM]
Clear the VGA memory during initialization.
Clear the graphics framebuffer when switching to graphics mode.


svn path=/branches/ntvdm/; revision=59671
2013-08-07 21:15:02 +00:00
Aleksandar Andrejevic b4ed87bb3a [NTVDM]
Fix coding style.
Fix initial cursor position bug.
Fix memory limit constant for VGA memory modes 0 and 1 (64 KB not 32 KB).


svn path=/branches/ntvdm/; revision=59669
2013-08-07 19:56:28 +00:00
Hermès Bélusca-Maïto 58c1653592 [NTVDM]
- Check return value of VgaEnterGraphicsMode (because CreateConsoleScreenBuffer can fail), and create VgaEnterTextMode and VgaLeaveTextMode helpers.
- Don't declare variables inside loops.

svn path=/branches/ntvdm/; revision=59668
2013-08-07 17:41:54 +00:00
Aleksandar Andrejevic bcdc670ae9 [NTVDM]
Fix more MSVC warnings.


svn path=/branches/ntvdm/; revision=59667
2013-08-07 15:42:32 +00:00
Aleksandar Andrejevic 5e69cb4dcb [NTVDM]
Fix MSVC warnings.


svn path=/branches/ntvdm/; revision=59666
2013-08-07 15:01:38 +00:00
Aleksandar Andrejevic a989736ead [NTVDM]
Remove unnecessary call to UNREFERENCED_PARAMETER, as the parameter is used later in the function.


svn path=/branches/ntvdm/; revision=59662
2013-08-07 12:06:39 +00:00
Hermès Bélusca-Maïto 454fade2ac [NTVDM]
Code formatting only.

svn path=/branches/ntvdm/; revision=59660
2013-08-06 21:06:00 +00:00
Hermès Bélusca-Maïto 5bc19fdbfb [NTVDM]
- Don't leak console input/output handles when opening them in BiosInitialize.
- Deinitialize the emulator in the reverse order it was initialized.
- Simplify VgaGetVideoBaseAddress and VgaGetVideoLimitAddress and use the former one in VgaTranslate[Read-Write]Address.
- Use only unicode Win32 APIs where it's needed.

svn path=/branches/ntvdm/; revision=59659
2013-08-06 20:01:05 +00:00
Aleksandar Andrejevic 455deb3bde [NTVDM]
Implement Video Graphics Array (VGA) support.
Replace the old BIOS video code with new code that uses the VGA.


svn path=/branches/ntvdm/; revision=59648
2013-08-05 23:20:25 +00:00
Aleksandar Andrejevic b49476f20c [NTVDM]
Modify the flags on the stack instead of the flags register directly.
The flags register is restored during IRET so changing it directly does nothing.


svn path=/branches/ntvdm/; revision=59566
2013-07-23 21:43:57 +00:00
Aleksandar Andrejevic 6be35ef0bb [NTVDM]
Remove the old "INT 0xFF" hack and instead use an invalid opcode sequence for emulator operations.
Fix the flags register update bug.


svn path=/branches/ntvdm/; revision=59565
2013-07-23 19:31:00 +00:00
Aleksandar Andrejevic 7bcfe7b2a8 [NTVDM]
Implement several INT 21h functions.


svn path=/branches/ntvdm/; revision=59563
2013-07-23 14:43:03 +00:00
Aleksandar Andrejevic be2e1f0907 [NTVDM]
Add the program name after the environment block.


svn path=/branches/ntvdm/; revision=59559
2013-07-22 20:21:46 +00:00
Aleksandar Andrejevic 87fc3759e3 [NTVDM]
Fix bug while initializing and copying the environment strings.


svn path=/branches/ntvdm/; revision=59557
2013-07-22 16:36:05 +00:00
Aleksandar Andrejevic c04b008f1f [NTVDM]
Add debug output.


svn path=/branches/ntvdm/; revision=59555
2013-07-22 13:51:26 +00:00
Aleksandar Andrejevic f603441db9 [NTVDM]
Implement multiple allocation strategies.


svn path=/branches/ntvdm/; revision=59530
2013-07-20 06:14:13 +00:00
Aleksandar Andrejevic bac747f151 [NTVDM]
Fix several bugs.


svn path=/branches/ntvdm/; revision=59502
2013-07-18 12:31:11 +00:00
Aleksandar Andrejevic 495320af6e [NTVDM]
Implement Upper Memory Blocks (UMB) support.


svn path=/branches/ntvdm/; revision=59501
2013-07-18 11:44:06 +00:00
Hermès Bélusca-Maïto c5dad7aefe [NTVDM]
Fix the TESTING case, in case you run ntvdm without other parameters.

svn path=/branches/ntvdm/; revision=59498
2013-07-18 00:17:04 +00:00
Aleksandar Andrejevic bebaf9e812 [NTVDM]
Add a compile-time option (not default) to run ntvdm manually with the target executable as a parameter.
Fix screen clearing bug.
Rewrite several INT 10h functions to work for all video pages.


svn path=/branches/ntvdm/; revision=59497
2013-07-18 00:01:18 +00:00
Aleksandar Andrejevic 40d639e7ff [NTVDM]
Implement the Bios Data Area (BDA).
Fix keyboard character translation bug.


svn path=/branches/ntvdm/; revision=59489
2013-07-15 01:37:38 +00:00
Aleksandar Andrejevic 7ba3013923 [NTVDM]
Implement the IOCTL command in VDM DOS.
Rewrite the BIOS video pages support to use only one console buffer (not yet complete).
Fix the BIOS video mode table and several bugs in video functions.


svn path=/branches/ntvdm/; revision=59460
2013-07-13 01:56:36 +00:00
Aleksandar Andrejevic be1d88e4b7 [NTVDM]
Add video pages support to INT 10h functions and memory access.
[SOFTX86]
Fix the opcode check for XLAT.


svn path=/branches/ntvdm/; revision=59454
2013-07-10 19:41:43 +00:00
Aleksandar Andrejevic 25cbe37d30 [NTVDM]
Fix bugs in the VDM DOS executable loader.


svn path=/branches/ntvdm/; revision=59452
2013-07-09 17:28:16 +00:00
Aleksandar Andrejevic 59e28c4f15 [SOFTX86]
Fix jump conditions.
[NTVDM]
Implement BIOS teletype output command.
Start implementation of a new CPU emulator to replace softx86.


svn path=/branches/ntvdm/; revision=59450
2013-07-07 20:53:23 +00:00
Aleksandar Andrejevic 1f4d89e7d7 [NTVDM]
Improve vertical refresh performance.
Properly synchronize access to the framebuffer.


svn path=/branches/ntvdm/; revision=59425
2013-07-05 01:31:50 +00:00
Aleksandar Andrejevic 01fd2f9aa3 [NTVDM]
Implement BIOS video mode setting.
Fix bugs in video memory access emulation.


svn path=/branches/ntvdm/; revision=59424
2013-07-05 00:08:18 +00:00
Aleksandar Andrejevic 988c4490a8 [NTVDM]
Fix bugs in video memory access emulation.
Implement several missing INT 10h functions.
Resize the console screen buffer on startup.


svn path=/branches/ntvdm/; revision=59421
2013-07-03 23:38:51 +00:00
Aleksandar Andrejevic c4ef9b6f44 [NTVDM]
Add more debug output.
[SOFTX86]
Properly set the carry and overflow flags.


svn path=/branches/ntvdm/; revision=59410
2013-07-02 21:40:11 +00:00
Aleksandar Andrejevic 36f251eca0 [NTVDM]
Fix several bugs:
The file was not entirely read due to an integer overflow.
The second WORD of the Program Segment Prefix (PSP) is not the number of allocated
paragraphs, but the segment of the last paragraph.
Fix the order of registers (SI and DI were mixed up with SP and BP).
Implement interrupt 0x11.
Implement redirection for reading/writing characters.


svn path=/branches/ntvdm/; revision=59409
2013-07-02 02:08:30 +00:00
Aleksandar Andrejevic 40e7d3a9fb [NTVDM]
Implement file creation, opening, reading and writing.


svn path=/branches/ntvdm/; revision=59406
2013-07-01 02:29:29 +00:00
Aleksandar Andrejevic ed9f26ccca [NTVDM]
Fix several bugs.
Implement some interrupt 1Ah services in the BIOS.


svn path=/branches/ntvdm/; revision=59374
2013-06-29 21:37:44 +00:00
Aleksandar Andrejevic 944d6e8b5a [NTVDM]
Implement "Get DOS Version" API call.
Implement BIOS keyboard IRQ handler and some "INT 16h" functions.


svn path=/branches/ntvdm/; revision=59350
2013-06-28 20:52:40 +00:00
Aleksandar Andrejevic 4c4c69fc37 [NTVDM]
Clean up the code and properly separate different modules into different files.


svn path=/branches/ntvdm/; revision=59344
2013-06-26 22:58:41 +00:00
Aleksandar Andrejevic 44f2787b1f [NTVDM]
Use 286 mode in softx86.
Implement "Get / Set Disk Transfer Area".
Start implementation of PS/2 controller.
Improve hardware interrupts. Fix CLI / STI / HLT instruction support.


svn path=/branches/ntvdm/; revision=59343
2013-06-26 17:15:45 +00:00
Aleksandar Andrejevic 53fbdf6bc9 [NTVDM]
Implement the "Get Interrupt Vector" and "Set Interrupt Vector" DOS API functions.


svn path=/branches/ntvdm/; revision=59340
2013-06-25 17:56:05 +00:00
Aleksandar Andrejevic 2ea7dab9a6 [NTVDM]
Fix more bugs in DosResizeMemory().


svn path=/branches/ntvdm/; revision=59339
2013-06-25 17:18:34 +00:00
Aleksandar Andrejevic 6d45f4e6e3 [NTVDM]
Fix the VDM DOS memory manager to use the segment of the data portion of the block, rather than the MCB itself.


svn path=/branches/ntvdm/; revision=59338
2013-06-25 16:46:35 +00:00
Aleksandar Andrejevic 5db2a4a6dd [NTVDM]
Fix many VDM DOS memory manager bugs.


svn path=/branches/ntvdm/; revision=59336
2013-06-24 23:10:31 +00:00
Aleksandar Andrejevic 07928d50d4 [NTVDM]
Implement several directory operations.


svn path=/branches/ntvdm/; revision=59331
2013-06-24 18:15:53 +00:00
Aleksandar Andrejevic ca06374c9f [NTOSKRNL]
Check for old-style MZ executable in PeFmtCreateSection.
[NTVDM]
Fix bugs.
Implement MZ executable loading.


svn path=/branches/ntvdm/; revision=59328
2013-06-24 01:59:09 +00:00
Aleksandar Andrejevic 4c459af487 [KERNEL32]
Implement BasepCheckDosApp.
Enable NTVDM in CreateProcessInternalW.
[NTVDM]
Remove the old command line parser code. The entire command line is for the DOS application now.


svn path=/branches/ntvdm/; revision=59310
2013-06-23 12:33:13 +00:00
Aleksandar Andrejevic e7ce79fc05 [NTVDM]
Perform multiple CPU instructions in one emulator cycle.


svn path=/branches/ntvdm/; revision=59298
2013-06-23 00:20:24 +00:00
Aleksandar Andrejevic 030a935096 [NTVDM]
Remove whitespace from empty lines.


svn path=/branches/ntvdm/; revision=59296
2013-06-23 00:11:45 +00:00
Hermès Bélusca-Maïto 2bd695b42e [NTVDM]
Use correctly NDEBUG, and use ReactOS macro: ASSERT, instead of the assert() CRT function.

svn path=/branches/ntvdm/; revision=59280
2013-06-22 01:48:28 +00:00
Aleksandar Andrejevic 6a3d90cf53 [NTVDM]
Improve keyboard IRQ performance.
Add debug output to measure number of instructions per second.


svn path=/branches/ntvdm/; revision=59279
2013-06-22 01:41:51 +00:00
Aleksandar Andrejevic b040791380 [NTVDM]
Use local time instead of system time for the clock.
Implement the "set system date" and "set system time" DOS functions.


svn path=/branches/ntvdm/; revision=59277
2013-06-21 22:14:07 +00:00
Aleksandar Andrejevic fe6988cbdd [NTVDM]
Implement the keyboard IRQ.


svn path=/branches/ntvdm/; revision=59276
2013-06-21 21:25:01 +00:00
Aleksandar Andrejevic f3aa7c7145 [NTVDM]
Change the PIT code to use only one thread, to avoid race conditions.
Implement PIT counter reading and latch command.


svn path=/branches/ntvdm/; revision=59273
2013-06-21 13:55:31 +00:00
Aleksandar Andrejevic 03b2c06c97 [NTVDM]
Fix the PIC IRQ code. Interrupt requests only occur when no higher-priority IRQ is busy.


svn path=/branches/ntvdm/; revision=59272
2013-06-21 01:44:56 +00:00
Aleksandar Andrejevic da877e495e [NTVDM]
Implement Programmable Interval Timer (PIT) emulation. Fix bugs in interrupts and PIC emulation.


svn path=/branches/ntvdm/; revision=59271
2013-06-21 00:47:07 +00:00
Aleksandar Andrejevic 7765319949 [NTVDM]
Make sure bit 2 in the ISR of the master PIC is set when an IRQ in the slave PIC occurs.


svn path=/branches/ntvdm/; revision=59269
2013-06-20 19:43:29 +00:00
Aleksandar Andrejevic b44c5d3a6f [NTVDM]
Implement 8259 Programmable Interrupt Controller emulation.


svn path=/branches/ntvdm/; revision=59268
2013-06-20 19:00:07 +00:00
Aleksandar Andrejevic c1bb00076e [NTVDM]
Implement the "get system time" and "get system date" functions in the virtual DOS kernel.


svn path=/branches/ntvdm/; revision=59264
2013-06-20 02:10:42 +00:00
Aleksandar Andrejevic cde3f9547b [NTVDM]
Implement up/down scrolling function in interrupt 0x10.


svn path=/branches/ntvdm/; revision=59261
2013-06-19 22:53:16 +00:00
Hermès Bélusca-Maïto f1e0b70d39 [NTVDM]
Start of an implementation of a software DOS emulator.
Brought to you by Aleksandar Andrejevic. Good luck ;)

Remove the old language files. They will be recreated when the time comes.

svn path=/branches/ntvdm/; revision=59249
2013-06-17 00:00:36 +00:00
Hermès Bélusca-Maïto 4f0b8d3db0 Create a branch for Aleksandar Andrejevic for his work on NTVDM. See http://jira.reactos.org/browse/CORE-7250 for more details.
svn path=/branches/ntvdm/; revision=59241
2013-06-16 22:01:41 +00:00