[Patch] Undocumented instructions and processor accuracy

Discussion of development and patch submission.
Greatpsycho
Posts: 88
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

[Patch] Undocumented instructions and processor accuracy

Postby Greatpsycho » Sun 23 Apr, 2017 12:24 pm

This patch does the following

- Added undocumented TEST instruction(0xF6/1 and 0xF7/1) on all processors.
- Added undocumented instruction 0xF1 as alias of LOCK prefix on 286 and ICEBP on 386+ processors.
- Implemented full features of 286 LOADALL instruction
- 286 SMSW instruction set higher 12 bits to 1 as real processor does.
Attachments
undoc_ops_patch.tar.gz
Patch files for undocumented instructions.
(2.73 KiB) Downloaded 35 times
User avatar
omarsis81
Posts: 544
Joined: Thu 17 Dec, 2015 6:20 pm

Re: [Patch] Undocumented instructions and processor accuracy

Postby omarsis81 » Sun 23 Apr, 2017 8:52 pm

Wow! Great job!
SarahWalker
Site Admin
Posts: 1327
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch] Undocumented instructions and processor accuracy

Postby SarahWalker » Fri 28 Apr, 2017 6:06 pm

Committed at rev 699.
Greatpsycho
Posts: 88
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

Re: [Patch] Undocumented instructions and processor accuracy

Postby Greatpsycho » Sun 30 Apr, 2017 5:00 am

This additional patch does the following

- Raise exception #6 when attempt to execute opcode 0xC6/1~0xC6/7 and 0xC7/1~0xC7/7 on 286+ processors.
- Raise exception #13 when attempt to write code segment in protected mode.
- 286 LOADALL instruction does not alter PE bit in MSW register when in protected mode.
Attachments
ops_patch.tar.gz
Patch files against rev 699.
(916 Bytes) Downloaded 24 times
Greatpsycho
Posts: 88
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

Re: [Patch] Undocumented instructions and processor accuracy

Postby Greatpsycho » Mon 19 Jun, 2017 1:31 pm

This patch applies experimental 286 TSS switching. Microport UNIX System V-AT 2.3 installer no longer crashes.
Attachments
x86seg.c.patch
Patch to apply 286 TSS switching.
(8.67 KiB) Downloaded 16 times
SarahWalker
Site Admin
Posts: 1327
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch] Undocumented instructions and processor accuracy

Postby SarahWalker » Mon 19 Jun, 2017 7:10 pm

Committed at rev 777.
ecksemmess
Posts: 122
Joined: Wed 18 Mar, 2015 5:27 am

Re: [Patch] Undocumented instructions and processor accuracy

Postby ecksemmess » Tue 20 Jun, 2017 10:59 am

Greatpsycho wrote:This additional patch does the following

- Raise exception #6 when attempt to execute opcode 0xC6/1~0xC6/7 and 0xC7/1~0xC7/7 on 286+ processors.
- Raise exception #13 when attempt to write code segment in protected mode.
- 286 LOADALL instruction does not alter PE bit in MSW register when in protected mode.



Sarah, did you ever apply this patch posted upthread from 30 April? The changes don't appear to be live in the repo currently. (Note: at first glance it looks like a few things in there may need to be checked to avoid regressions of other alterations that have been made to some of the same code since then)
SarahWalker
Site Admin
Posts: 1327
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch] Undocumented instructions and processor accuracy

Postby SarahWalker » Tue 20 Jun, 2017 5:13 pm

Apparently not! Thanks for the reminder.
SarahWalker
Site Admin
Posts: 1327
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch] Undocumented instructions and processor accuracy

Postby SarahWalker » Tue 20 Jun, 2017 6:47 pm

Committed in revs 778-780.
Greatpsycho
Posts: 88
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

Re: [Patch] Undocumented instructions and processor accuracy

Postby Greatpsycho » Mon 26 Jun, 2017 2:05 pm

This patch improves task switching accuracy. Borland C++ 2.0 for 286(BCX.EXE & BCCX.EXE) and Turbo debugger for 286 no longer crashes.
Attachments
x86seg.c.patch
Patch for improve task switching accuracy.
(17.59 KiB) Downloaded 19 times
SarahWalker
Site Admin
Posts: 1327
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch] Undocumented instructions and processor accuracy

Postby SarahWalker » Wed 05 Jul, 2017 8:55 pm

Committed at rev 785.
Greatpsycho
Posts: 88
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

Re: [Patch] Undocumented instructions and processor accuracy

Postby Greatpsycho » Thu 06 Jul, 2017 2:22 pm

More task switching fixes. It fixes OS/2 Warp 4.0 installer crashing.
Attachments
x86seg.c.patch
Patch for task switching.
(6.53 KiB) Downloaded 19 times
ecksemmess
Posts: 122
Joined: Wed 18 Mar, 2015 5:27 am

Re: [Patch] Undocumented instructions and processor accuracy

Postby ecksemmess » Sat 08 Jul, 2017 5:40 pm

If I'm not mistaken, it looks like this last patch that fixes the OS/2 Warp 4.0 installer was committed at rev 787?
SarahWalker
Site Admin
Posts: 1327
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch] Undocumented instructions and processor accuracy

Postby SarahWalker » Sun 09 Jul, 2017 5:34 pm

Sorry, yes.
Greatpsycho
Posts: 88
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

Re: [Patch] Undocumented instructions and processor accuracy

Postby Greatpsycho » Tue 11 Jul, 2017 8:58 am

This patch does the following

- LTR instruction set TSS state to busy.
- LMSW instruction does not alter ET bit in CR0 register.
- Improved accuracy destination IP address calculation in protected mode JMP and CALL instruction via system segment.
Attachments
x86seg.c.patch
Patch for processor accuracy
(2.24 KiB) Downloaded 17 times
x86_ops_pmode.h.patch
Patch for processor accuracy
(1022 Bytes) Downloaded 13 times
SarahWalker
Site Admin
Posts: 1327
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch] Undocumented instructions and processor accuracy

Postby SarahWalker » Sun 16 Jul, 2017 3:06 pm

Committed at rev 796.
SA1988
Posts: 205
Joined: Wed 30 Apr, 2014 9:38 am

Re: [Patch] Undocumented instructions and processor accuracy

Postby SA1988 » Mon 17 Jul, 2017 1:35 pm

The latest commit (in x86seg.c where it says "x86ss("Load CS call not present", seg & 0xfffc);" ) breaks win3.0 in protected mode. It should be set to x86np.
Greatpsycho
Posts: 88
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

Re: [Patch] Undocumented instructions and processor accuracy

Postby Greatpsycho » Mon 17 Jul, 2017 2:03 pm

SA1988 wrote:The latest commit (in x86seg.c where it says "x86ss("Load CS call not present", seg & 0xfffc);" ) breaks win3.0 in protected mode. It should be set to x86np.


It seems 86Box's trouble. PCem doesn't have this problem.
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: [Patch] Undocumented instructions and processor accuracy

Postby Battler » Mon 17 Jul, 2017 2:28 pm

Yes, I misapplied one of your patches. I fixed the problem now.
Greatpsycho
Posts: 88
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

Re: [Patch] Undocumented instructions and processor accuracy

Postby Greatpsycho » Fri 10 Nov, 2017 8:46 am

This patch does the following.

- Implemented IDT limit too small exception on real mode.
- Changed AT compatible machine's reset vector to F000:FFF0 instead of FFFF:0000
- Set IDT limit to 0xFFFF when system reset as real machine does.

Edit : Below feature also added.
- Changed 286 and 386SX processor's address mask to 24bit.

Edit : This patch has been incorporated here.
Last edited by Greatpsycho on Sun 10 Dec, 2017 10:09 am, edited 3 times in total.
Greatpsycho
Posts: 88
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

Re: [Patch] Undocumented instructions and processor accuracy

Postby Greatpsycho » Sun 19 Nov, 2017 11:35 am

This patch does the following. Reworked against rev 932.

- Implemented IDT limit too small exception on real mode.
- Changed AT compatible machine's reset vector to F000:FFF0 instead of FFFF:0000
- Set IDT limit to 0xFFFF when system reset as real machine does.
- Changed 286 and 386SX processor's address mask to 24bit.
- More fixes applied to get improved accuracy.

Edit : This patch has been incorporated here.
Last edited by Greatpsycho on Sun 10 Dec, 2017 10:10 am, edited 2 times in total.
Greatpsycho
Posts: 88
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

Re: [Patch] Undocumented instructions and processor accuracy

Postby Greatpsycho » Fri 24 Nov, 2017 8:38 am

This patch does the following. Reworked against rev 937.

- Implemented IDT limit too small exception on real mode.
- Changed AT compatible machine's reset vector to F000:FFF0 instead of FFFF:0000
- Set IDT limit to 0xFFFF on 286 and 0x03FF on 386+ when system reset as real machine does.
- Changed 286 and 386SX processor's address mask to 24bit.
- Correctly initialize segment descriptor cache when system reset.
- Improved accuracy of ROM BIOS mapping to top 128KB address area on 286 and 386SX processor.

Edit : This patch has been incorporated here.
Last edited by Greatpsycho on Sun 10 Dec, 2017 10:09 am, edited 1 time in total.
Greatpsycho
Posts: 88
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

Re: [Patch] Undocumented instructions and processor accuracy

Postby Greatpsycho » Sun 10 Dec, 2017 10:08 am

This patch does the following. Reworked against commit c014367.

- Implemented IDT limit too small exception on real mode.
- Changed AT compatible machine's reset vector to F000:FFF0 instead of FFFF:0000
- Set IDT limit to 0xFFFF on 286 and 0x03FF on 386+ when system reset as real machine does.
- Changed 286 and 386SX processor's address mask to 24bit.
- Correctly initialize segment descriptor cache when system reset.
- Improved accuracy of ROM BIOS mapping to top 128KB address area on 286 and 386SX processor.
- Don't push exception error code on stack when triple fault exception occurs.
Attachments
cpu_patch.tar.gz
Patch for processor and memory addressing accuracy.
(2.78 KiB) Downloaded 9 times
SarahWalker
Site Admin
Posts: 1327
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch] Undocumented instructions and processor accuracy

Postby SarahWalker » Sun 10 Dec, 2017 10:58 am

I'm holding off on this patch until after v13 is out - I don't want to make these kind of changes this close to release.

Return to “Development”

Who is online

Users browsing this forum: grommit2007 and 2 guests