GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

About Qemu-system-ppc, a PPC Mac emulator for Windows, macOS and Linux that can run Mac OS 9.0 up to Mac OS X 10.5

Moderators: Cat_7, Ronald P. Regensburg

mcayland
Mac Mechanic
Posts: 152
Joined: Sun Nov 01, 2015 10:33 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by mcayland »

kikyoulinux wrote:mouse jerking only happens when using GTK output under Windows. It's a bug of qemu windows port itself. Try SDL output instead, just add "-sdl".
Has anyone reported this upstream on QEMU's launchpad bug tracker? As I don't use Windows here and I don't see the issue locally, there's nothing I can really do about this, other than to recommend that you report this upstream :/
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by adespoton »

Well, to be fair, I don't think it's an issue with QEMU; I seem to recall similar issues in the past using GTK and Windows with other software that captures the mouse. Probably needs to be reported to the GTK team.
kataetheweirdo
Master Emulator
Posts: 313
Joined: Sun Feb 01, 2009 4:55 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by kataetheweirdo »

I can't boot up Mac OS 9.2.1 with the OpenBIOS image compiled on April 15, 2016. Doing so results in an illegal instruction error at boot-up. I tried out both GTK and SDL for this. I used this boot-up command for SDL one, but the GTK one is the same (minus the sdl argument):
qemu-system-ppc -bios openbios-ppc_2016apr -boot d -drive file=os92_test.iso,index=0,media=cdrom -M mac99 -m 256 -prom-env 'auto-boot?=true' -g 800x600x32 -cpu G3 -net none -usb -device usb-mouse -device usb-kbd -sdl
With SDL on in 64-bit Windows 10 and using any OpenBIOS image, the mouse is completely unusable. The mouse can move very erratically for a few seconds and then stops dead in its tracks. Often, that behavior is moving in a random direction and in a certain distance for every mouse movement. Eventually, I can't control the cursor anymore.

I think it might be the mouse drivers, as I see three of them - a Dell Touchpad and two HID-compliant mice. Keyboards is just as bad with five keyboard drivers loaded in - HID Keyboard Device, eHome MCIR 109, eHome MCIR, eHome Remote Control, and Standard PS2. I'm not sure how QEMU handles these and I (not so fondly) recall this being a potential issue in DOSBox (which does use SDL).

Disabling all the mouse drivers except for the Dell Touchpad results in a mouse is controllable for a brief period of time (under 5 seconds), but the cursor quickly becomes uncontrollable.

It should be noted I've been testing QEMU on a laptop computer older than 5 years. With this in mind, QEMU does run rather slow, though it should not make a difference as to how the mouse is handled.

I'll be trying this out further with other ROMs when this is possible, extracted from actual Macintoshes.

As for the OpenBIOS list on the unimplemented registers, I was referring to resolving the invalid SPR errors the PPC emulation was encountering.

I did find a USB-to-Serial driver for Mac OS Classic, but I'm not sure if I should test Mac OS 9 with that yet. I also am trying to figure out how to disable serial through the command line. It is possible that differences between the streams QEMU typically outputs/inputs and Open Transport's streams are causing conflicts in regularly booting the system up.

I don't see any distinguishing between Port B and DDRB in QEMU's CUDA code, although I will need to do more research on the CUDA, if possible. Something to note is that these may rely on PowerPC instruction eieio.

All of my trace files looks something like this now (this is the raw hex for the trace files):
FF FF FF FF FF FF FF FF B4 29 A4 0A CB 77 B1 F2 03 00 00 00 00 00 00 00
mcayland
Mac Mechanic
Posts: 152
Joined: Sun Nov 01, 2015 10:33 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by mcayland »

Friday teaser alert: the latest QEMU git master can now boot my MacOS 9.2.1 ISO!

The random crashes turned out to be caused by not invalidating the macio DMA memory, which mean that stale code in QEMU's softtlb instruction cache could be executed by accident. It seems that changing the the default mac99 CPU with -cpu G3 was a red herring, presumably because of the difference in CPU cache size, and in fact it is possible to boot to the Finder using my OS9-patched BIOS under git master with just:

qemu-system-ppc -cdrom MacOS921.iso -M mac99 -boot d -bios openbios-ppc-os9

There was also a minor issue with the "Apple CPU Plugins" causing QEMU to get stuck in an infinite loop, however that was traced to missing emulation of the THRM registers for which a patch has now been applied.

Note that while I can complete the installation to a fresh HD image from CD, the resulting HD image doesn't boot due to issues with the ESCC DMA which is as suspected - we knew this would be an issue, but finally boot is failing not due to random crashes but due to hammering the DBDMA controller ESCC channel waiting for a response. Stay tuned!
PeterHolbrook
Apple Corer
Posts: 273
Joined: Fri Oct 26, 2007 7:56 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by PeterHolbrook »

Many thanks for the excellent news.
kataetheweirdo
Master Emulator
Posts: 313
Joined: Sun Feb 01, 2009 4:55 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by kataetheweirdo »

That's something tricky to catch there. I might want to look into some of the other troublesome parts of PowerPC Mac emulation. I wonder if there are still any issues involving OpenTransport though. Searching up OTRunPortScanners isn't turning up much, if at all, even in the documents sentient provided. I had a brief look inside the SDK for answers, but even there, it barely mentions the function. I'm also curious if your 9.2.1 installation does included OT.

I also looked at AppleScript, but I've yet to find much on direct serial port communications (with the Mac OS 9 version, obviously).

For the record, Quickdraw 3D relies on ecowx and eciwx calls, especially 1.6. This is probably because RAVE relies on actual QD3D hardware support.
LightBulbFun
Tinkerer
Posts: 50
Joined: Mon Jul 13, 2015 11:32 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by LightBulbFun »

im pleased to report that with the latest QEMU from git and the open Firmware OpenBIOS file from mcayland a Mac OS 9.1 install CD boots up to the finder with out any mods having to be done to the CD it self, my command line is as follows

qemu-system-ppc -M mac99 -cpu G3 -g 1024x768x32 -m 128 -cdrom /Volumes/Storage/OS-images/Apple\ Mac\ OS\ 9.1/macos_91_ppc.iso -bios /Volumes/Storage/Downloads/openbios-ppc-jun-25-2016/openbios-ppc

Image

I will be testing more Mac OS images shortly :)
kataetheweirdo
Master Emulator
Posts: 313
Joined: Sun Feb 01, 2009 4:55 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by kataetheweirdo »

Very nice to hear that it's booting up nice now. Although considering that it had to check on the thermal registers, it makes me wonder if any of the other extensions reference some other SPRs to take into consideration.

I'd still like to hear as to how other people are experiencing mouse support in QEMU with Windows. In the builds I'm using, the mouse support is actually more broken with SDL than with the default setting. This is surprising, considering that GTK support is still pretty broken with Windows and PowerPC Mac OS 9 emulation.
gtxaspec
Tinkerer
Posts: 62
Joined: Mon Oct 19, 2015 7:32 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by gtxaspec »

Awesome!
User avatar
celebi23
Granny Smith
Posts: 101
Joined: Wed Jun 18, 2008 5:53 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by celebi23 »

LightBulbFun wrote:im pleased to report that with the latest QEMU from git and the open Firmware OpenBIOS file from mcayland a Mac OS 9.1 install CD boots up to the finder with out any mods having to be done to the CD it self, my command line is as follows

qemu-system-ppc -M mac99 -cpu G3 -g 1024x768x32 -m 128 -cdrom /Volumes/Storage/OS-images/Apple\ Mac\ OS\ 9.1/macos_91_ppc.iso -bios /Volumes/Storage/Downloads/openbios-ppc-jun-25-2016/openbios-ppc

Image

I will be testing more Mac OS images shortly :)
Any chance you could upload the version you compiled? Having some issues on my end trying to compile Qemu from the source.
DANADAX
Student Driver
Posts: 14
Joined: Tue Jun 23, 2015 5:37 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by DANADAX »

Watching the updates on this forum. It's getting pretty cool!

I was just wondering, is audio playback an issue?
kataetheweirdo
Master Emulator
Posts: 313
Joined: Sun Feb 01, 2009 4:55 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by kataetheweirdo »

The audio support for PowerPC machines isn't there yet, mainly because AWACS or an equally suitable sound card isn't supported. Mac OS X 10.3 and later kind of has sound working, but it's very glitchy and doesn't work on every set-up.

Programmingkid thinks it's a floating point error with how it handles sound, but it could also be the refresh rate used or the fact that it's simply not fast enough to play properly.
sparcdr
Space Cadet
Posts: 6
Joined: Wed Jun 22, 2016 1:24 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by sparcdr »

The images/archives have gone missing from the linked mirror (Modified OS9 iso/disk) and I would like to get my hands on a copy. Much thanks.
gtxaspec
Tinkerer
Posts: 62
Joined: Mon Oct 19, 2015 7:32 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by gtxaspec »

sorry about that! all links are restored!
Arths
Student Driver
Posts: 10
Joined: Wed Jul 06, 2016 11:25 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Arths »

Works successfully for me guys :shock:
Compiled latest QEMU from their Git repository
Installed 9.1 from a CD image on a QCOW2 hdd image
./qemu-system-ppc -M mac99 -cpu G3 -m 512 -bios openbios-ppc -boot c -hda 9.1.img -net none
Image
Image
PeterHolbrook
Apple Corer
Posts: 273
Joined: Fri Oct 26, 2007 7:56 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by PeterHolbrook »

Excellent. By any chance, can it be updated to OS 9.2.x?
Arths
Student Driver
Posts: 10
Joined: Wed Jul 06, 2016 11:25 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Arths »

PeterHolbrook wrote:Excellent. By any chance, can it be updated to OS 9.2.x?
Gonna try that :smile:

edit : apparently it freezes when trying to load Open Transport extensions just like before :cry:
gtxaspec
Tinkerer
Posts: 62
Joined: Mon Oct 19, 2015 7:32 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by gtxaspec »

Anyone trying 8.5?I remember that wasnt working before
kataetheweirdo
Master Emulator
Posts: 313
Joined: Sun Feb 01, 2009 4:55 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by kataetheweirdo »

Some news on OpenTransport:

I did get the 2.0 SDK to extract successfully, but I wasn't able to extract 2.6. It's interesting to note that I found one site that mentioned how 9.2 made OpenTransport boot first and foremost before any other extension. It would seem that the 2.0 SDK is too old to properly determine the problem. I'm curious to know what happens if OS 9.2's OpenTransport is replaced with an earlier version (read:2.6 or earlier).

Mac OS 9.2.x uses OpenTransport 2.7.x, while Mac OS X's classic mode has 2.8, if I'm not mistaken. I really need to look into 2.7.x or 2.8 in order to have a better idea as to what could be causing these issues, as it seems 9.1 boots up just fine from a regular CD while 9.2 doesn't. Mac OS 9.0.x and Mac OS 9.1 have OpenTransport 2.6.x.

I'd also look into an extension called the Open Transport ASLM Modules, as that has resource forks filled with PowerPC and 68k code. This extension is used along the main OpenTransport extension. Open Transport ASLM Modules contains OTRunPortScanners in it, which is part of OTScanPortLib, and you might be able to look into with a debugger. Confusingly, the main Open Transport plug-in also has OTRunPortScanners in it. Considering that eMaculation is the only site that even mentions this undocumented, it would probably be best if this does get documented by someone.

Here are the source I used:
https://web.archive.org/web/20020828025 ... num=106963
http://www.macos.utah.edu/documentation ... 9-2-1.html

Side Note:

Nanosaur does require a graphics card, regardless of which version of QuickDraw is used and which version of Nanosaur the player decides to use. This is because it tries to find a compatible card first, then allocate some memory to said graphics card when it boots up. If it fails, then the game will crash (especially in an emulator like Sheepshaver) or quit out with an error.
User avatar
celebi23
Granny Smith
Posts: 101
Joined: Wed Jun 18, 2008 5:53 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by celebi23 »

Could someone post a compiled version? I'm having some issues on my end. I keep getting this error message when trying the ./configure:
ERROR: glib-2.22 gthread-2.0 is required to compile QEMU

I can't get those to properly compile because of libffi not being found when trying to compile glib. So, if someone could post a newly compiled version, I'd greatly appreciate it :mrgreen: Thanks! :smile:
Programmingkid
Apple Corer
Posts: 243
Joined: Sun Jan 31, 2016 6:01 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Programmingkid »

Mac OS 9.0.4 will install in QEMU, but booting it is another problem. My Mac OS 9.0.4 iMac installation CD boots, but the installation crashes on startup. Turning off extensions isn't enough to stop the crash.

Details:
QEMU git commit version: 4f4a9ca4a4386c137301b3662faba076455ff15a
Mac OS 9.0.4
Command line: qemu-system-ppc -hda Mac OS 9.0.4 HD.img -m 256 -boot c -M mac99 -g 800x600x32 -cpu 750 -net none -bios openbios-qemu.elf.nostrip
Programmingkid
Apple Corer
Posts: 243
Joined: Sun Jan 31, 2016 6:01 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Programmingkid »

celebi23 wrote:Could someone post a compiled version? I'm having some issues on my end. I keep getting this error message when trying the ./configure:
ERROR: glib-2.22 gthread-2.0 is required to compile QEMU

I can't get those to properly compile because of libffi not being found when trying to compile glib. So, if someone could post a newly compiled version, I'd greatly appreciate it :mrgreen: Thanks! :smile:
What operating system and version are you using?
These directions may help: http://qemu.weilnetz.de/qemu-doc.html#compilation

If you want to stick with the bleeding edge in QEMU technology, then you certainly would want to build your own QEMU using the git repository and 'git pull' every couple of days.
User avatar
celebi23
Granny Smith
Posts: 101
Joined: Wed Jun 18, 2008 5:53 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by celebi23 »

Programmingkid wrote:
celebi23 wrote:Could someone post a compiled version? I'm having some issues on my end. I keep getting this error message when trying the ./configure:
ERROR: glib-2.22 gthread-2.0 is required to compile QEMU

I can't get those to properly compile because of libffi not being found when trying to compile glib. So, if someone could post a newly compiled version, I'd greatly appreciate it :mrgreen: Thanks! :smile:
What operating system and version are you using?
These directions may help: http://qemu.weilnetz.de/qemu-doc.html#compilation

If you want to stick with the bleeding edge in QEMU technology, then you certainly would want to build your own QEMU using the git repository and 'git pull' every couple of days.
I'm using Mac OS X 10.10.5. I spent most of yesterday trying to fix those issues and couldn't.
User avatar
24bit
Forum All-Star
Posts: 1424
Joined: Wed Nov 11, 2009 5:47 pm
Location: Germany

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by 24bit »

Yes please a pre-built executable for 10.10 or 10.11 from time to time would be nice to have.
No need for cutting edge, major proceedings would be fine.
kikyoulinux
Tinkerer
Posts: 92
Joined: Sun Sep 28, 2014 11:53 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by kikyoulinux »

With SDL on in 64-bit Windows 10 and using any OpenBIOS image, the mouse is completely unusable. The mouse can move very erratically for a few seconds and then stops dead in its tracks. Often, that behavior is moving in a random direction and in a certain distance for every mouse movement. Eventually, I can't control the cursor anymore.
Well, SDL output works on my PC. but the window is always displayed at 640x480 and the window size is not adjusted automatically.
A better choice is VNC output. type "-vnc :0" and it starts a VNC server on localhost. you just need a VNC client.
Post Reply