Interesting tests we could run for x86

jordi
Posts: 90
Joined: Thu Jun 11, 2020 10:11 am
Has thanked: 26 times
Been thanked: 21 times

Interesting tests we could run for x86

Unread post by jordi »

I've found some interesting tests that were linked from vogons for verifying x86 CPu
https://forum.osdev.org/viewtopic.php?f ... 9&start=15

I guess it's just a matter of compiling them
jordi
Posts: 90
Joined: Thu Jun 11, 2020 10:11 am
Has thanked: 26 times
Been thanked: 21 times

Re: Interesting tests we could run for x86

Unread post by jordi »

https://www.vogons.org/viewtopic.php?t=73677

This was the original topic at vogons
MicroCoreLabs
Posts: 73
Joined: Sun Jun 05, 2022 6:12 pm
Location: California
Has thanked: 2 times
Been thanked: 62 times
Contact:

Re: Interesting tests we could run for x86

Unread post by MicroCoreLabs »

Here are the tests I wrote to verify the MCL86 core which touch on the opcodes, addressing modes, and flags.

https://github.com/MicroCoreLabs/Projec ... CL86/Tests

It compiles using A86 into .COM files which run under DOS. I'm sure they are not 100% exhaustive but were good enough to verify the core to a large degree.

Source code is simple and can easily be extended. Upon failure it prints a character using a DOS call so you can track it down in the test source code.
Mills
Posts: 70
Joined: Mon Jun 08, 2020 2:52 pm
Has thanked: 10 times
Been thanked: 20 times

Re: Interesting tests we could run for x86

Unread post by Mills »

jordi wrote: Thu Sep 22, 2022 7:40 pm I've found some interesting tests that were linked from vogons for verifying x86 CPu
https://forum.osdev.org/viewtopic.php?f ... 9&start=15

I guess it's just a matter of compiling them
I compiled that, they had some errors (relative jump instructions out of range for 8088/86) I think I solved that, there are some "failed" text but I think that's my fault.

It looks like they did not fail until the program gets stuck, probably because the code is incomplete and they need some kind of "end " instruction.
CPUTEST.zip
(4.17 KiB) Downloaded 9 times
Mills
Posts: 70
Joined: Mon Jun 08, 2020 2:52 pm
Has thanked: 10 times
Been thanked: 20 times

Re: Interesting tests we could run for x86

Unread post by Mills »

MicroCoreLabs wrote: Thu Sep 22, 2022 8:43 pm Here are the tests I wrote to verify the MCL86 core which touch on the opcodes, addressing modes, and flags.

https://github.com/MicroCoreLabs/Projec ... CL86/Tests

It compiles using A86 into .COM files which run under DOS. I'm sure they are not 100% exhaustive but were good enough to verify the core to a large degree.

Source code is simple and can easily be extended. Upon failure it prints a character using a DOS call so you can track it down in the test source code.
It looks like PCXT passed all that tests :), this is how it looks like after running "runall.bat":
20220923_154459-screen.png
20220923_154459-screen.png (68.9 KiB) Viewed 300 times
MicroCoreLabs
Posts: 73
Joined: Sun Jun 05, 2022 6:12 pm
Location: California
Has thanked: 2 times
Been thanked: 62 times
Contact:

Re: Interesting tests we could run for x86

Unread post by MicroCoreLabs »

It looks like PCXT passed all that tests :), this is how it looks like after running "runall.bat":
Yes, this was the desired result! :)

I wrote all of these tests on a genuine IBM PCXT using QEdit and then ran them on a PC which had an MCL86 installed. For opcodes which failed I single-stepped the same test on both computers using D86 to see where they diverged.

If I recall correctly, the online emulator PCJs would not complete these tests successfully...
thorr
Posts: 683
Joined: Mon Jul 06, 2020 9:37 pm
Has thanked: 288 times
Been thanked: 134 times

Re: Interesting tests we could run for x86

Unread post by thorr »

Awesome stuff! :)
User avatar
pgimeno
Posts: 552
Joined: Thu Jun 11, 2020 9:44 am
Has thanked: 202 times
Been thanked: 163 times

Re: Interesting tests we could run for x86

Unread post by pgimeno »

Is the segment override bug now incorporated as a regression test? It's customary practice to add a test that fails before a bugfix and passes after it, every time a bug is squashed. That's where regression tests take their name, after all: if the bug returns, that's a regression and it will be immediately caught by the test. Some bugs have the bad habit of reviving some time after being squashed.

Best practices also dictate to search for patterns similar to the one that produced the bug, and to elaborate tests that also exercise them. Chances are that if a bug is detected, and there's more code similar to the one that triggered the bug, it will also be similarly bugged. In this case, all segment combinations with all string instruction combinations should probably be exercised by tests, with and without repetition.
MicroCoreLabs
Posts: 73
Joined: Sun Jun 05, 2022 6:12 pm
Location: California
Has thanked: 2 times
Been thanked: 62 times
Contact:

Re: Interesting tests we could run for x86

Unread post by MicroCoreLabs »

These are all good points but I will leave it as a project for someone else. :)
Post Reply