For the longest time we suspected something was wrong with QEMU. It would not play sound correctly under a Mac OS guest. We only had theories that we could only wonder about. Now we can finally see what is wrong. I would like to introduce risu to everyone. Risu is a program that can test each PowerPC instruction in a random order with random inputs. The state of all PowerPC user registers is compared to a real PowerPC chip to see which instructions are working correctly and which do not.
The command line program is a little challenging to use so I made this front end to make it a lot more user-friendly.
https://goo.gl/photos/WQW4v44AViNVGQpX8To use it just launch the frontend.py file like this from the terminal: python frontend.py
How things work are you generate a file that contains all the PowerPC instructions to test, then run the test.
To generate the instructions, just enter a number in the number field. I suggest 1000. Then push the generate button. In the terminal you will see all the instructions that will be used printed out. What you do next is actually run the test. One real PowerPC Macintosh is required. The master is the PowerPC Macintosh, the host is QEMU. On the master system with the Risu Front-End running select "master" in the Test section. An ip address will appear in the IP address of master text field. You would enter this address into the corresponding text field of the QEMU system that would also be running the front-end. On the QEMU end select "host". Next you push the start button on the master first, then on the host. In the terminal of the master you will see the result of the test. To see each instruction in hexadecimal printed while being tested, check the "Verbose testing" option.
In the future I hope to see a "replay" feature implemented in risu that would allow the user to test QEMU's PowerPC implementation without the need for a real PowerPC Macintosh. But for now a computer that runs qemu-system-ppc and a real PowerPC Macintosh is required. The front-end needs Python and the Tk framework which Mac OS 10.4 or higher supplies. If you don't have python and the Tk framework installed, then you would have to use the command-line programs risugen and risu from the terminal. This is how you should use them:
./risugen --numinsns 1000 ppc.risu ppc.out
./risu --master ppc.out <---- on real PowerPC Macintosh
./risu --host <ip address of master> ppc.out <---- on qemu-system-ppc
The included readme file has more information.
During testing I did verify that many floating point instructions were incorrectly implemented. I wanted to exclude these problem instructions from the test so I entered them in the "Exclude Instructions" text field like this: "fdivs, fctiw, fdiv, fsub". Then I push the Generate button to make a new batch of test instructions to use. The instructions entered in the "Exclude Instructions" text field were not used in the new batch.
If you want to test one or a few instructions only, you would enter them in the "Only Instructions" field like this: "add, addi, addis". The instructions are comma separated.
Networking your computer that runs qemu-system-ppc to your PowerPC Macintosh is a requirement. Connecting both computers to the same router should be enough to put both computers on the same network. Be sure QEMU and the PowerPC Macintosh have the same network mask. This can be verified from the Network Pane in the System Preferences. QEMU also needs to have a network interface card. I used the RTL8139.
Another option is to use a crossover cable to connect your PowerPC Macintosh to your computer running QEMU.
If you need any assistance please let me know. Thank you.
risu download link:
http://www.mediafire.com/file/4a0e3jdwj4j87hc/risu.zipNote: be sure to compare the same processors together. That would mean comparing a PowerPC G3 to QEMU with the "-cpu 750" option selected. When I compared a real PowerPC G5 with a real PowerPC G3, there were differences detected. Particularly the floating point instructions.