GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

About QEMU, 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

User avatar
celebi23
Tinkerer
Posts: 93
Joined: Wed Jun 18, 2008 5:53 am

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

Post by celebi23 »

CharlesS wrote:Is there really that much software for PPC Mac OS X that won't run just fine in Snow Leopard in VMWare, though?
With Snow Leopard in VMWare, Fallout & Fallout 2 would crash right after starting. They play almost perfectly in the latest Mac build with a guest OS of 10.1.5.
darthnvader
Mac Mechanic
Posts: 168
Joined: Sun Feb 07, 2016 4:40 pm

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

Post by darthnvader »

@cat_7

Do you know why the sungem Ethernet doesn't work with 32bit binaries of qemu-system-ppc?

Who's maintaining that?

Also, where is the git for the brach you built for sound support?

Thanks Cat,

The Darth One
User avatar
Cat_7
Expert User
Posts: 5099
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,

qemu with screamer: https://github.com/mcayland/qemu/tree/screamer-ppc-next
(also contains an openbios build with screamer support)

I have no idea why the sungem device wouldn't work on 32 bit builds.
The sungem device was added by Mark Cave-Ayland. So the same person you are talking to about openbios.

Best,
Cat_7
darthnvader
Mac Mechanic
Posts: 168
Joined: Sun Feb 07, 2016 4:40 pm

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

Post by darthnvader »

galgot wrote:Indeed, was not patient enough... waited a good half hour for it to get to desktop :
Image
extremely slow, unusable. But still makes a nice screenshot.

I couldn't find the qemu-kvm package for my debian 8 PPC. I know some could install it but was on Ubuntu PPC i think, so maybe it's not on the Debian PPC repos...
I just went ahead and built the latest stable kernel from kernel.org on Debian 8.10 and added the KVM module, wanted to build the latest nouveau anyway to get 3D support for my GeForceGo5200, as it turns out all I had to do is install Ubuntu Mate 16.04 for 3D supported nouveau, it's a shame, as it was a real pain to build, but my build included support for OpenGLES 1.

Mate's standard nouveau driver doesn't, and I need it later, so I'm going to have to rebuild it any way.

As to KVM, it's not hard to build an up to date kernel, and install it. Works just fine with Debian 8.

I moved to Mate because it's more up to date, working out ok.

On Mate I had to build a new kernel too, as the prebuilt KVM with Mate was only 64bit.

With Mate I built the 4.4.111 LTS kernel from kernel.org, as it was the closest rev. to the one Mate has, and I didn't want to have to rebuild all the things you have to build for nouveau if the new kernel broke support for it.



Image
User avatar
Cat_7
Expert User
Posts: 5099
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 »

Nice!

I built Qemu on my G5 Dual. It runs dead slow, so I tried kvm, but it crashes with some hardware error.

Best,
Cat_7
darthnvader
Mac Mechanic
Posts: 168
Joined: Sun Feb 07, 2016 4:40 pm

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

Post by darthnvader »

Cat_7,

You may want to check if you're running the smp with kvm.

Someone told me smp with kvm is broken somewhere after kernel 3.x.x

I'll be getting a QuickSilver, with Dual 7455's, so I'll be wanting to fix that too.
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 »

Cat_7 wrote:Nice!

I built Qemu on my G5 Dual. It runs dead slow, so I tried kvm, but it crashes with some hardware error.

Best,
Cat_7
Do you have it available for download? I would like to add it to this page: https://wiki.qemu.org/Hosts/Mac
User avatar
Cat_7
Expert User
Posts: 5099
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 »

This is a build on Ubuntu mate 16.04 ppc64 running on the G5. You want that?

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

Sorry I thought you built it on Mac OS X.
User avatar
adespoton
Forum All-Star
Posts: 3099
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 »

Has anyone got KVM or at least LibVirt working under OS X? I still haven’t got anything to compile that would work with QEMU.
darthnvader
Mac Mechanic
Posts: 168
Joined: Sun Feb 07, 2016 4:40 pm

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

Post by darthnvader »

There is a KVM kext for OS X, I built it, but was unable to build the patched version of qemu that it needed to boot the linux kernel.

It was very limited, it could only boot the linux kernel.

https://github.com/geohot/kvm-kext

If you want to work on it, I'm game to help.
User avatar
adespoton
Forum All-Star
Posts: 3099
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 »

Hotz did a great job of porting the basic framework, but there's some significant missing chunks there -- not just to allow booting OS X, but also any advanced software functions under Linux; that implementation appears to port just enough to get the kernel to boot.

I don't think I've got the spare time to implement all the missing features. However, there appears to be significant overlap between what's needed here and what we're re-examining for qemu-ppc; maybe someone working on that code wants to have a peek?
LightBulbFun
Tinkerer
Posts: 49
Joined: Mon Jul 13, 2015 11:32 am

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

Post by LightBulbFun »

im not sure when this fix happened but at some point QEMUs ADB implementation got fixed so that now mouse and keyboard work in OS X Server 1.2v3 so now I can login and do stuff! :)

it only works on the g3beige machine type sadly still.the keyboard and mouse do work on mac99 but OS X server 1.2v3 still has issues with the ATA controller there...

for some reason it runs really slow like much slower then it should. but this is progress :) (this QEMU was built from the git source a few days ago)

Image
darthnvader
Mac Mechanic
Posts: 168
Joined: Sun Feb 07, 2016 4:40 pm

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

Post by darthnvader »

LightBulbFun wrote:im not sure when this fix happened but at some point QEMUs ADB implementation got fixed so that now mouse and keyboard work in OS X Server 1.2v3 so now I can login and do stuff! :)

it only works on the g3beige machine type sadly still.the keyboard and mouse do work on mac99 but OS X server 1.2v3 still has issues with the ATA controller there...

for some reason it runs really slow like much slower then it should. but this is progress :) (this QEMU was built from the git source a few days ago)

Image
Awesome, I did every hack I could think of to get that to work.

BTW, did someone remove USB support from g3beige machine, last time I tried to passthough a USB device it wouldn't work.

Oh, and Sungem does work on 32bit builds, I must have just entered the command wrong.
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

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

Post by alex195812 »

Oh, it's a great news! Some time ago, when I realized that adb issues in g3beige are related to cuda implementation and that Mark Cave-Ayland worked much with it, I supposed that it's up just to him to fix the problem. And really, I can see 7 days ago changes in qemu/hw/misc/macio/cuda.c by mayland and dgibson! Though, it may be due to earlier changes in qemu/input/adb.c, too. In fact, it opens the way to almost all versions of OS X Server and Rhapsody as it was investigated by Steven Troughton-Smith a year ago.
LightBulbFun
Tinkerer
Posts: 49
Joined: Mon Jul 13, 2015 11:32 am

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

Post by LightBulbFun »

thats good to know :) ill have to play with some earlier versions of OS X Server/Rhaposdy :)

it would be nice to get OS X Server 1.2v3 booting on the mac99 (sawtooth) machine option now :)

as well as figure out why it runs so slow I suspect its something to do with the clock as while i can drag windows/the mouse around just fine etc. if im say clicking on an option in a drop down menu, the little animation it does takes Way too long. and also when its booting up I notice it reports a really whacky Bus speed value.

notice the whacky bus frequency value.
Image

this is where OS X server 1.2v3 hangs on the mac99 machine option. (if i do IIRC -hdc, it cant find root device and asks me to enter it and thats how i can tell ADB is now playing nice with OS X server on mac99 as well)
Image

(BTW the Mac OS 8.6 build for sawtooths still crashes QEMU)
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

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

Post by alex195812 »

Well, it's no wonder OS X Server doesn't boot in mac99. Mac OS X 10.0 DP1 didn't boot in it as well and also due to IDE incompatibility.But did they work in real PowerMac3,1?
In fact, qemu mac99 is not a valid sawtooth machine as it has via-cuda for managing ADB bus (like g3beige had), while real PowerMac3,1 used PMU for that purpose. Ben's mac99p is closer to real sawtooth machine.
If Mac OS X Server and MOSX 10 DP1 are supposed to work with sawtooth machines, something should be done about IDE in mac99/mac99p to make it more compatible. Perhaps it would affect MOS 8.6 boot process, too.
It seems to me that qemu's g3beige is more ready to boot MOS 8.6 than mac99/mac99p. Unfortunately, Old World boot method is not implemented in qemu (yet?).
Last edited by alex195812 on Fri Feb 23, 2018 6:06 pm, edited 1 time in total.
User avatar
Cat_7
Expert User
Posts: 5099
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,

There is work being done all over the place. The PMU code is being revised along with timer stuff: a "real" Via CUDA chip is now emulated. This might lead to the mac99p becoming the default machine for Qemu. There are still some timer/video issues.

Best,
Cat_7
LightBulbFun
Tinkerer
Posts: 49
Joined: Mon Jul 13, 2015 11:32 am

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

Post by LightBulbFun »

indeed Mac OS X Server 1.2v3 is officially compatible with all PowerMac G4s up to the GigE G4.

good to know better PMU emulation is being worked on :) but last time I saw mac99p it was masquerading as a PowerMac3,6 (MDD) which breaks compatibility with some older Apple OSs like early OS X and some earlier Mac OS 9 versions. as their BootLoader specifically checks for a certain list of compatible machines. changing PowerMac3,6 to PowerMac3,1 (Sawtooth) would be a better idea, especially since we are not emulating Uninorth 2 which is what the MDD has. but we are emulating Uninorth 1 which is what the PowerMac3,1 (sawtooth) has. so im not sure why mac99p was changed to PowerMac3,6 in the first place?


I have a post on MR detailing some of the BootLoader details :) https://forums.macrumors.com/threads/ma ... s.2021922/
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

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

Post by alex195812 »

It's easy to change the model to PowerMac3,1 in OpenBios prompt or in qemu command-line via "-prom-env 'boot-command=...'". Steven did similar things with g3beige to make older MacOS X Server versions starting to boot.
User avatar
adespoton
Forum All-Star
Posts: 3099
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 »

He has a point that reporting as 3,6 doesn't make sense when the emulation isn't 3,6 compatible though. Until that gets fixed, passing it on the command line is the best option to make things work.

So we've got proper CUDA in process, including PMU, we've got a lead on getting accelerator emulation working. CUDA changes seem to fix most of the hardware issues I've run up against.

Things are looking good for 2018!
User avatar
i886
Space Cadet
Posts: 8
Joined: Thu Mar 22, 2018 9:29 am

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

Post by i886 »

Hello !

I just installed Mac OS X 10.0.4 on QEMU without any problem, but when I turned off the emulator to change the batch file to boot on the virtual hard drive, I start the emulator and hang on "Trying hd:,\\:tbxi ..."
About ten minutes later, QEMU crash... :???:

That's the batch file :

Code: Select all

qemu-system-ppc -L pc-bios -boot c -m 260 -M mac99 -prom-env "auto-boot ?=true" -prom-env "boot-args=-v" -prom-env "vga-ndrv ?=true" -drive file=PowerMac_G4_Quicksilver_Mac_OS_X_10.0.4.iso,format=raw,media=cdrom -drive file=DISKOSX1.img,format=raw,media=disk -device usb-mouse -device usb-kbd
How... ?? :roll:
User avatar
Cat_7
Expert User
Posts: 5099
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 »

When you use the -drive as parameters to point to your disks, you should (beside changing -boot d to -boot c) also change the order of the -drive entries, so:

Code: Select all

qemu-system-ppc -L pc-bios -boot c -m 260 -M mac99 -prom-env "auto-boot ?=true" -prom-env "boot-args=-v" -prom-env "vga-ndrv ?=true" -drive file=DISKOSX1.img,format=raw,media=disk -drive file=PowerMac_G4_Quicksilver_Mac_OS_X_10.0.4.iso,format=raw,media=cdrom  -device usb-mouse -device usb-kbd
Will boot your installation.

Best,
Cat_7
User avatar
i886
Space Cadet
Posts: 8
Joined: Thu Mar 22, 2018 9:29 am

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

Post by i886 »

Thanks so much, it works, but not the keyboard... :shock:
User avatar
Cat_7
Expert User
Posts: 5099
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 »

Yes,

remove -device usb-kbd and -device usb-mouse from the command line.

best,
Cat_7
Post Reply