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

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 »

Graphics acceleration?

I'm not sure I've understood some of the latest posts correctly. Has graphics acceleration been achieved on Qemu for OS X guests (like, say, Tiger)? If so, can Front Row run on such virtual machines? If it doesn't work yet, will that goal be achievable in the near future?
User avatar
Cat_7
Expert User
Posts: 6121
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

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

Post by Cat_7 »

Hi,

No, there is no Graphics Acceleration. Only the basic drivers load. The GA drivers garble the OSX screen.
There would have to be a relation to hardware to get real acceleration, and currently there is none. So, even thought the driver might load, all graphics would still have to be calculated through software.

Best,
Cat_7
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 »

Thanks.
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 »

So, I'm using the latest screamer build (Qemu-4.0pre-OSX-Altivec-Screamer-09-02-2019) on Mac OS X and was wondering if there was a way to enable internet and sound on Mac OS X Public Beta?

Here's my qemu.command file

Code: Select all

#!/bin/bash
cd "$(dirname "$0")"

./qemu-system-ppc -L pc-bios -boot c -M mac99 -cpu G4 -m 1024 -prom-env 'auto-boot?=true' -prom-env 'boot-args=-v' -drive file=MacintoshHD.dmg,format=raw,media=disk -drive file=files.dmg,format=raw,media=disk -rtc base="2000-09-13",clock=vm -netdev user,id=network01 -device sungem,netdev=network01 -device VGA,edid=on
Do I need to add anything to my command file to enable audio & an internet connection in Mac OS X Public Beta?
User avatar
Cat_7
Expert User
Posts: 6121
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

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

Post by Cat_7 »

Hi,

I just installed the PB from the macintoshgarden.
Internet should work with that command line. Internet Explorer tries to open e.g., www.google.com, but crashes...(what's new).

It seems the PB does not like the screamer code. As soon as I click a sound, Qemu starts throwing errors ... invalid key ....

Best,
Cat_7
User avatar
adespoton
Forum All-Star
Posts: 4208
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 »

I think I got USB audio working on PB; screamer is incompatible.

For internet, it works, but you should disable the time server prior to enabling it, or PB will call home to Apple, set the time, and immediately stop working.
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 »

Great news! I made a patch that implements the Screamer sound chip into QEMU. This one sounds better than the older Screamer implementation. Also I am trying to commit these patches into QEMU so we will no longer need a custom made version of QEMU to play sound.

- Mac OS 9.0.4 plays MP3's perfectly.
- MP3's sound perfect on Mac OS 9.2.2. Games like Wolfenstein 3D and Duke Nukem 3D also sound perfect.
- The default Quicktime version in Mac OS 10.2.3 sounds very choppy when playing MP3's. When I use MpegDec 3.1.1 in the classic environment the audio sounds perfect. I think it is a problem with the MP3 decoder (Quicktime 6.0.2).
- On Mac OS 10.4.3 the audio is almost good sounding. Very minor audio artifacts appear. Mac OS 10.4.11 sounds ok.

I noticed that patches are sometimes committed that break features in QEMU that we need. Some patch has broken my Screamer patch. In order to make testing the sound system simple I added a word to the sound node in OpenBIOS called test-sound. When ran this word will play some musical tones. This should make testing easy for anyone who works on QEMU. There is no need to install a PowerPC operating system to test the sound.

To run this 'word' go to the sound node like this in OpenBIOS: cd mac-io/davbus/sound

Then type test-sound

http://www.mediafire.com/file/ez2xtxblo ... t.zip/file
Patches for both QEMU and OpenBIOS plus an already made OpenBIOS file with the patch applied.

Enjoy!
jgreene01
Space Cadet
Posts: 4
Joined: Fri Nov 20, 2020 7:01 pm

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

Post by jgreene01 »

I am running Qemu 5.1.0 on Catalina, which I obtained both from here and also via my Homebrew installation (which reports no issues).

On this thread, albeit some time ago, it is mentioned that Qemu's savevm and loadvm are working for people, but this isn't working for me. I've gotten both OS 9 & multiple versions of OS X booting (using both raw image drives and qcow2 drives), but when I go to the console and try to run savevm, Qemu immediately freezes and becomes unresponsive.

Anyone know have any idea if the problem might be in the command line options below, or in the platform I'm running, or in this release of Qemu?

qemu-system-ppc -L pc-bios -boot d -M mac99,via=pmu -m 512 \
-prom-env 'auto-boot?=true' -prom-env 'boot-args=-v' -prom-env 'vga-ndrv?=true' \
-drive file=MacOS10.4.qcow2,format=qcow2,media=disk \
-netdev user,id=network01 -device sungem,netdev=network01 \
-device VGA,edid=on
User avatar
Cat_7
Expert User
Posts: 6121
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

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

Post by Cat_7 »

Hi,

The discussion on this topic seems to suggest savevm/loadvm does not work for qemu-system-ppc.
viewtopic.php?f=34&t=7047&hilit=qemu+savevm&start=1200

Best,
Cat_7
WizKid
Tinkerer
Posts: 72
Joined: Sun Jul 31, 2016 11:58 pm

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

Post by WizKid »

Cat_7 wrote: Sat Nov 21, 2020 6:38 am Hi,

The discussion on this topic seems to suggest savevm/loadvm does not work for qemu-system-ppc.
viewtopic.php?f=34&t=7047&hilit=qemu+savevm&start=1200

Best,
Cat_7
Then perhaps those monitor commands (and the relevant code) should only be enabled when in the target arch is not ppc?
jgreene01
Space Cadet
Posts: 4
Joined: Fri Nov 20, 2020 7:01 pm

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

Post by jgreene01 »

Cat_7 wrote: Sat Nov 21, 2020 6:38 am Hi,

The discussion on this topic seems to suggest savevm/loadvm does not work for qemu-system-ppc.
viewtopic.php?f=34&t=7047&hilit=qemu+savevm&start=1200

Best,
Cat_7
I see. Thank you so much!
User avatar
adespoton
Forum All-Star
Posts: 4208
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 »

jgreene01 wrote: Sat Nov 21, 2020 4:30 pm
Cat_7 wrote: Sat Nov 21, 2020 6:38 am Hi,

The discussion on this topic seems to suggest savevm/loadvm does not work for qemu-system-ppc.
viewtopic.php?f=34&t=7047&hilit=qemu+savevm&start=1200

Best,
Cat_7
I see. Thank you so much!
Drive snapshotting works as long as you pause the emulation first. It's just the full savevm/loadvm that hasn't been implemented properly yet.
jgreene01
Space Cadet
Posts: 4
Joined: Fri Nov 20, 2020 7:01 pm

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

Post by jgreene01 »

Drive snapshotting works as long as you pause the emulation first. It's just the full savevm/loadvm that hasn't been implemented properly yet.
Do am I right this means:
1) type "stop" in that console
2) make a copy the "img" file
3) type "cont" to get the emulation going again

This is helpful. But I suppose there's no way to avoid passing through the boot sequence when commencing the emulation :smile:
User avatar
adespoton
Forum All-Star
Posts: 4208
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 »

jgreene01 wrote: Sat Nov 21, 2020 9:46 pm
Drive snapshotting works as long as you pause the emulation first. It's just the full savevm/loadvm that hasn't been implemented properly yet.
Do am I right this means:
1) type "stop" in that console
2) make a copy the "img" file
3) type "cont" to get the emulation going again

This is helpful. But I suppose there's no way to avoid passing through the boot sequence when commencing the emulation :smile:
Not quite: start your qemu-ppc with -snapshot; then from the monitor you can type stop, commit, cont.

But as you say, you still need to boot every time you start emulation -- the snapshotting only allows you to save different states of the image as difference files (faster and uses up less space than a full copy) -- it doesn't do machine state or memory snapshotting.
jgreene01
Space Cadet
Posts: 4
Joined: Fri Nov 20, 2020 7:01 pm

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

Post by jgreene01 »

adespoton wrote: Mon Nov 23, 2020 6:06 pm
jgreene01 wrote: Sat Nov 21, 2020 9:46 pm
Drive snapshotting works as long as you pause the emulation first. It's just the full savevm/loadvm that hasn't been implemented properly yet.
Do am I right this means:
1) type "stop" in that console
2) make a copy the "img" file
3) type "cont" to get the emulation going again

This is helpful. But I suppose there's no way to avoid passing through the boot sequence when commencing the emulation :smile:
Not quite: start your qemu-ppc with -snapshot; then from the monitor you can type stop, commit, cont.

But as you say, you still need to boot every time you start emulation -- the snapshotting only allows you to save different states of the image as difference files (faster and uses up less space than a full copy) -- it doesn't do machine state or memory snapshotting.
Now that I grasp this I am sure it will be especially helpful for OS 9 since it's got its fragilities. Thank you much.
mcayland
Mac Mechanic
Posts: 150
Joined: Sun Nov 01, 2015 10:33 pm

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

Post by mcayland »

adespoton wrote: Mon Nov 23, 2020 6:06 pm But as you say, you still need to boot every time you start emulation -- the snapshotting only allows you to save different states of the image as difference files (faster and uses up less space than a full copy) -- it doesn't do machine state or memory snapshotting.
Well actually yes it does - a QEMU snapshot not only snapshots the disk, but also the internal device state of all devices. Last time I checked everything was working except that the timebase register was based upon wallclock time rather than virtual time, although I think some others have been looking at this recently. In my last set of tests it worked for me probably around 95% of the time.
adespoton wrote: Mon Nov 23, 2020 6:06 pm Not quite: start your qemu-ppc with -snapshot; then from the monitor you can type stop, commit, cont.
Ah no, this is incorrect. The -snapshot parameter tells QEMU to use a temporary snapshot for the qcow2 disk (and yes, it must be qcow2 as raw images don't have the required COW metadata) which means that any changes made to the disk will be lost when you exit qemu-system-ppc. I use this a lot during development for things like disk drivers where it can be all to easy to corrupt the disk: using the snapshot feature ensures I can simply reboot and try again without having to reinstall.
adespoton wrote: Sat Nov 21, 2020 5:21 pm Drive snapshotting works as long as you pause the emulation first. It's just the full savevm/loadvm that hasn't been implemented properly yet.
There's no need to pause the emulation to create a snapshot: QEMU will pause the VM, create the snapshot, and then resume as soon as the process is complete.

The correct sequence to generate a QEMU snapshot is to run qemu-system-ppc as normal, then type "savevm foo" in the monitor. This will snapshot the disk as well as the device data, and store the snapshot within the qcow2 disk image with the label "foo".

When you want to run from a snapshot previous saved within the qcow2 file then run qemu-system-ppc with the extra parameter "-loadvm foo" which will restore the state from the foo image and then start the VM as normal.
User avatar
adespoton
Forum All-Star
Posts: 4208
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 »

mcayland wrote: Fri Nov 27, 2020 6:15 pm
adespoton wrote: Mon Nov 23, 2020 6:06 pm But as you say, you still need to boot every time you start emulation -- the snapshotting only allows you to save different states of the image as difference files (faster and uses up less space than a full copy) -- it doesn't do machine state or memory snapshotting.
Well actually yes it does - a QEMU snapshot not only snapshots the disk, but also the internal device state of all devices. Last time I checked everything was working except that the timebase register was based upon wallclock time rather than virtual time, although I think some others have been looking at this recently. In my last set of tests it worked for me probably around 95% of the time.
adespoton wrote: Mon Nov 23, 2020 6:06 pm Not quite: start your qemu-ppc with -snapshot; then from the monitor you can type stop, commit, cont.
Ah no, this is incorrect. The -snapshot parameter tells QEMU to use a temporary snapshot for the qcow2 disk (and yes, it must be qcow2 as raw images don't have the required COW metadata) which means that any changes made to the disk will be lost when you exit qemu-system-ppc. I use this a lot during development for things like disk drivers where it can be all to easy to corrupt the disk: using the snapshot feature ensures I can simply reboot and try again without having to reinstall.
adespoton wrote: Sat Nov 21, 2020 5:21 pm Drive snapshotting works as long as you pause the emulation first. It's just the full savevm/loadvm that hasn't been implemented properly yet.
There's no need to pause the emulation to create a snapshot: QEMU will pause the VM, create the snapshot, and then resume as soon as the process is complete.

The correct sequence to generate a QEMU snapshot is to run qemu-system-ppc as normal, then type "savevm foo" in the monitor. This will snapshot the disk as well as the device data, and store the snapshot within the qcow2 disk image with the label "foo".

When you want to run from a snapshot previous saved within the qcow2 file then run qemu-system-ppc with the extra parameter "-loadvm foo" which will restore the state from the foo image and then start the VM as normal.
Wait... I'm confused now then. I thought true snapshotting with savevm wasn't working for qemu-ppc yet? That's where this sub-thread started. I was providing instructions for how to take a disk snapshot of a qcow2 image while we wait for savevm to work reliably on qemu-ppc. If you're saying it works now, ignore everything I've suggested :) But in the old docs from before snapshotting exists, disk snapshot documentation stated that you should always stop the emulation prior to using commit so that the disk caches are properly flushed prior to creating the qcow snapshot.

That method still works on QEMU-PPC 5 because I continue to do it -- but if savevm and loadvm are working now... that's great! But then we need to figure out what jgreene01 is doing wrong, as it didn't work for him, and it didn't work for me as of QEMU-PPC 4.x (the last time I checked).
mcayland
Mac Mechanic
Posts: 150
Joined: Sun Nov 01, 2015 10:33 pm

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

Post by mcayland »

adespoton wrote: Fri Nov 27, 2020 6:27 pm Wait... I'm confused now then. I thought true snapshotting with savevm wasn't working for qemu-ppc yet? That's where this sub-thread started. I was providing instructions for how to take a disk snapshot of a qcow2 image while we wait for savevm to work reliably on qemu-ppc. If you're saying it works now, ignore everything I've suggested :) But in the old docs from before snapshotting exists, disk snapshot documentation stated that you should always stop the emulation prior to using commit so that the disk caches are properly flushed prior to creating the qcow snapshot.

That method still works on QEMU-PPC 5 because I continue to do it -- but if savevm and loadvm are working now... that's great! But then we need to figure out what jgreene01 is doing wrong, as it didn't work for him, and it didn't work for me as of QEMU-PPC 4.x (the last time I checked).
Yes it should be working - in fact, you can see the thread where I submitted the original fixes upstream in 2015 at https://lists.gnu.org/archive/html/qemu ... 01546.html.

I can't say I've tested it much recently, but I'd be surprised if something had broken. I should add that the screamer device doesn't have a VMState definition so it likely won't restore properly, so unfortunately whilst that branch is still in extended beta, vanilla QEMU should be fine here. If it doesn't then feel free to report a bug.

So yeah, try it and see what happens. For jgreene01 i'd most likely suspect MacOS doing something odd with permissions, but that's not something I can test as I develop on Linux with occasional testing on Windows 10.
Post Reply