Commit graph

55254 commits

Author SHA1 Message Date
Aleksandar Andrejevic 3fbe4cb107 [NTVDM]
Use BiosConsoleInput instead of calling GetStdHandle in the keyboard input thread.


svn path=/branches/ntvdm/; revision=60855
2013-11-03 21:52:58 +00:00
Aleksandar Andrejevic 36afa0ea12 [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
2013-11-03 21:33:22 +00:00
Hermès Bélusca-Maïto e9f8b230a6 [NTVDM]
Start to implement a basic emulated PC speaker, using the Beep driver.

svn path=/branches/ntvdm/; revision=60853
2013-11-03 20:31:19 +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 a0587b741a [NTVDM]
Improve the I/O read/write callbacks to allow multiple reads or writes
at once.


svn path=/branches/ntvdm/; revision=60849
2013-11-03 14:37:30 +00:00
Hermès Bélusca-Maïto c0a85cdfce [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
2013-11-03 13:25:01 +00:00
Aleksandar Andrejevic 67d77ecebe [NTVDM]
Halfplement the BIOS palette control command (INT 10h, AH = 10h).


svn path=/branches/ntvdm/; revision=60842
2013-11-03 03:22:36 +00:00
Aleksandar Andrejevic 6e6e0bac08 [FAST486]
The RCL, RCR, ROL and ROR instructions do not update SF, ZF or PF.


svn path=/branches/ntvdm/; revision=60841
2013-11-03 01:05:40 +00:00
Aleksandar Andrejevic fde9609542 [NTVDM]
Fix resolution calculation when scanline doubling is enabled.


svn path=/branches/ntvdm/; revision=60827
2013-11-02 01:51:27 +00:00
Hermès Bélusca-Maïto e9a30e1068 [NTVDM]: Add a DPRINT1 that can be useful later on...
svn path=/branches/ntvdm/; revision=60826
2013-11-02 01:24:27 +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
Aleksandar Andrejevic dcbdbb7d9f [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
2013-11-01 22:39:43 +00:00
Aleksandar Andrejevic 20c0db9f08 [FAST486]
Implement the XADD instruction.


svn path=/branches/ntvdm/; revision=60819
2013-11-01 02:48:28 +00:00
Hermès Bélusca-Maïto 5c220ef022 [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
2013-11-01 02:28:47 +00:00
Aleksandar Andrejevic 13b771ac15 [FAST486]
Fix a bug in the IRET instruction.


svn path=/branches/ntvdm/; revision=60817
2013-11-01 02:08:34 +00:00
Aleksandar Andrejevic 90d7fbd4a8 [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
2013-11-01 01:57:40 +00:00
Hermès Bélusca-Maïto f62b9a81d4 Fix a comment...
svn path=/branches/ntvdm/; revision=60815
2013-11-01 01:51:15 +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 39a527a21e [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
2013-11-01 00:01:07 +00:00
Aleksandar Andrejevic b7ac8cf58e [NTVDM]
Fix an EOI condition in the BIOS IRQ handler.


svn path=/branches/ntvdm/; revision=60801
2013-10-30 22:42:32 +00:00
Hermès Bélusca-Maïto da33c5532e Fix a comment.
svn path=/branches/ntvdm/; revision=60791
2013-10-29 21:46:47 +00:00
Hermès Bélusca-Maïto 4784c22d50 [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
2013-10-29 01:55:54 +00:00
Aleksandar Andrejevic 1c1febed17 [NTVDM]
Save the error code returned by applications.


svn path=/branches/ntvdm/; revision=60789
2013-10-29 00:10:14 +00:00
Aleksandar Andrejevic 97acc35c7c [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
2013-10-28 02:25:54 +00:00
Hermès Bélusca-Maïto b8d8b21ebd Code formatting only.
svn path=/branches/ntvdm/; revision=60782
2013-10-27 23:42:16 +00:00
Hermès Bélusca-Maïto 76708ef246 [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
2013-10-27 23:39:52 +00:00
Hermès Bélusca-Maïto 09d991b838 [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
2013-10-27 22:31:53 +00:00
Hermès Bélusca-Maïto d35b972d75 [NTVDM]: Use SEG_OFF_TO_PTR ( $+ \epsilon * code _eorganization$ ).
svn path=/branches/ntvdm/; revision=60776
2013-10-27 22:13:18 +00:00
Hermès Bélusca-Maïto 720ab73ec3 [NTVDM]: DPRINT1 ReadConsoleInput failures (for debugging purposes) and remove an unneeded comment.
svn path=/branches/ntvdm/; revision=60775
2013-10-27 22:10:51 +00:00
Hermès Bélusca-Maïto b8fa6d1de4 [NTVDM]: Introduce the SEG_OFF_TO_PTR macro for code simplification purposes.
svn path=/branches/ntvdm/; revision=60774
2013-10-27 22:08:41 +00:00
Aleksandar Andrejevic 7e0285b710 [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
2013-10-27 19:08:58 +00:00
Aleksandar Andrejevic 37430c188b [NTVDM]
Simplify BiosPeekCharacter.
Implement DOS direct console I/O functions.


svn path=/branches/ntvdm/; revision=60772
2013-10-27 16:34:27 +00:00
Aleksandar Andrejevic 161fc791e4 [NTVDM]
Implement the BIOS keyboard shift flags.


svn path=/branches/ntvdm/; revision=60771
2013-10-27 14:57:12 +00:00
Hermès Bélusca-Maïto d9c072aba2 [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
2013-10-27 14:17:34 +00:00
Hermès Bélusca-Maïto 4d28af9bb5 [NTVDM]: Fix the callback prototypes.
svn path=/branches/ntvdm/; revision=60769
2013-10-27 12:17:06 +00:00
Hermès Bélusca-Maïto 2c8e8ba5d3 [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
2013-10-27 11:42:44 +00:00
Aleksandar Andrejevic 62da9a9deb [FAST486]
Physical memory read/write callbacks don't need to return a value.


svn path=/branches/ntvdm/; revision=60765
2013-10-27 01:38:24 +00:00
Aleksandar Andrejevic 8800ea89d1 [NTVDM]
Push scancodes on to the BIOS keyboard queue even if they're not ASCII.


svn path=/branches/ntvdm/; revision=60764
2013-10-27 01:33:15 +00:00
Aleksandar Andrejevic f5d3c9254c [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
2013-10-27 00:37:01 +00:00
Hermès Bélusca-Maïto fcbe98e6b6 [SOFTX86]
Remove the now-unneeded headers. Bye-bye SoftX86 !

svn path=/branches/ntvdm/; revision=60758
2013-10-26 21:26:28 +00:00
Aleksandar Andrejevic e954b0db71 [SOFTX86]
Remove softx86, as it is no longer used by anything.


svn path=/branches/ntvdm/; revision=60757
2013-10-26 20:53:33 +00:00
Aleksandar Andrejevic 0981b0859f [NTVDM]
Remove softx86 support, and use only fast486, since it is now
sufficiently functional.


svn path=/branches/ntvdm/; revision=60755
2013-10-26 20:48:31 +00:00
Aleksandar Andrejevic 68de967fb2 [NTVDM]
Fix the "Read Buffered Input" command and implement "Get STDIN Status".


svn path=/branches/ntvdm/; revision=60753
2013-10-26 18:01:40 +00:00
Aleksandar Andrejevic dfd1c031d6 [FAST486]
Implement the CLTS instruction.


svn path=/branches/ntvdm/; revision=60752
2013-10-26 17:33:10 +00:00
Aleksandar Andrejevic 1525a235a2 [FAST486]
Implement the MOV instruction for control and debug registers.
Remove definitions for non-existant registers CR1, CR4, CR5, CR6 and CR7.
The standard 80486 doesn't have a CR4 register (although some implementations
of the 80486 had large page support and CR4, it was not reliable).
As for the debug registers, DR4 is the same as DR6, and DR5 is the same as DR7.


svn path=/branches/ntvdm/; revision=60747
2013-10-26 00:56:11 +00:00
Aleksandar Andrejevic 87f5903d48 [FAST486]
Implement extended opcode groups 0xB9 (UD2) and 0xBA (BT/BTS/BTR/BTC).


svn path=/branches/ntvdm/; revision=60745
2013-10-25 18:15:24 +00:00
Aleksandar Andrejevic 01d5a36cf5 [NTVDM]
Remove the code that performs waiting in 32-bit mode since that blocks the emulator
and prevents interrupts from working.
Implement a 16-bit waiting system in the interrupt handlers.
Fix the PS/2 interrupt code.


svn path=/branches/ntvdm/; revision=60739
2013-10-24 01:01:49 +00:00
Aleksandar Andrejevic 5eb7c07bb8 Sync with trunk for console graphics palettes.
svn path=/branches/ntvdm/; revision=60735
2013-10-23 00:26:50 +00:00
Hermès Bélusca-Maïto dd2d4349e2 [CONSRV]:
Fix console palette setting. For that, we create a console framebuffer on which we draw the different active screen buffers (be they text or graphics), we can change the palette associated to this framebuffer and then we draw the framebuffer on screen.
Console palettes now work !!!!!! @ [TheFlash]

Part 2/2

svn path=/trunk/; revision=60734
2013-10-23 00:12:17 +00:00