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

Post Reply
PeterHolbrook
Apple Corer
Posts: 247
Joined: Fri Oct 26, 2007 7:56 am

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

Post by PeterHolbrook »

CharlesS wrote:You do realize that this isn't a final end-user-facing product, right?
Yes, of course I realize it. Cormac said as much when he stated that "there's enough visible progress into the boot process that users may actually derive some satisfaction from booting the operating system. If you want to see our current progress, I've provided instructions on getting a testing environment set up." Hey, I was simply trying to "derive some satisfaction from booting the operating system" through "getting a testing environment set up". Unfortunately, Cormac's instructions were not directly translatable to an OS X that simply had Xcode and its line tools in place, as some of the instructions were missing or simply wrong. I'm not criticising Cormac's dedication to the GSoC project nor his expertise in effecting OS 9 qemu compatibility. I simply wanted to contribute minimally to the goal Cormac himself had mentioned. Now, if that isn't possible at this time because compiling qemu under OS X is fraught with difficulty, that's too bad.

Presumably, there'll be better times for attempting compilation again; for instance, when GSoC 2015 achieves its ultimate goals. However, is there ANY guarantee AT ALL that, magically, all hidden/unknown dependencies will be solved at that time? If qemu can't be compiled right now in OS X, what tells me it'll be compilable then? Will one ultimately have to resort to Linux to get qemu to compile?
CharlesS
Tinkerer
Posts: 97
Joined: Thu Aug 14, 2008 9:05 am

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

Post by CharlesS »

FWIW, here's a set of commands that just worked for me to build QEMU on a clean machine. This is for Mavericks, because that's all I had that didn't have a bunch of dev stuff already on it, but it will probably work on Yosemite as well. If it doesn't or if I made a typo/omission somewhere, keep your head screwed on and ask for help.

Install Homebrew:

Code: Select all

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
This will bug you to install the Xcode command-line tools if you don't have them. Just let it do what it wants.

Make the directories:

Code: Select all

cd ~
mkdir -p os9-test/qemu-build
mkdir -p os9-test/qemu-install
Get the project:

Code: Select all

cd os9-test
git clone -b macos9 https://github.com/agraf/qemu.git
Make the dummy file:

Code: Select all

touch qemu/pc-bios/vgabios-virtio.bin
Change into the build directory:

Code: Select all

cd qemu-build/
Install pkg-config:

Code: Select all

brew install pkg-config
Install glib:

Code: Select all

brew install glib
Install pixman:

Code: Select all

brew install pixman
Install DTC:

Code: Select all

brew install dtc
Configure:

Code: Select all

../qemu/configure --target-list=ppc-softmmu --prefix=$HOME/os9-test/qemu-install
Make and install:

Code: Select all

make
make install
Change out of the build directory:

Code: Select all

cd ..
Download the BIOS and test ISO:

Code: Select all

curl 'https://dl.dropboxusercontent.com/content_link/wr7QUGn6P5vVB8aicFhYdCYroqhnF6XkSiAezSWGcyzPVHoLRL2eU2xBRKqjQ9qb?dl=1">https://dl.dropboxusercontent.com/content_link/wr7QUGn6P5vVB8aicFhYdCYroqhnF6XkSiAezSWGcyzPVHoLRL2eU2xBRKqjQ9qb?dl=1' -o openbios-qemu.elf.xz

curl 'https://dl.dropboxusercontent.com/content_link/I3H2jZo3JzftlkSItOGLC6ubrGlBModrUDaZbUdmH25retUDMlOcHXfNYGg7WCTP?dl=1">https://dl.dropboxusercontent.com/content_link/I3H2jZo3JzftlkSItOGLC6ubrGlBModrUDaZbUdmH25retUDMlOcHXfNYGg7WCTP?dl=1' -o os9.iso.xz
Install xz:

Code: Select all

brew install xz
Unpack the files:

Code: Select all

unxz openbios-qemu.elf.xz
unxz os9.iso.xz
Now, run it:

Code: Select all

qemu-install/bin/qemu-system-ppc -bios openbios-qemu.elf -boot d -cdrom os9.iso -M mac99 -m 512 -cpu 750
Voilà:
Image

Note: You'll probably have to run it a few times to get as far as the screen above. A lot of the time it hangs earlier than that in the boot process.
Last edited by CharlesS on Wed Aug 12, 2015 1:16 pm, edited 1 time in total.
There's no earthly way of knowing, which direction we are going, for the rowers keep on rowing, and they're certainly not showing any signs that they are slowing.
User avatar
adespoton
Forum All-Star
Posts: 3068
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 »

We should do another applescript of that like I did for a basic qemu build :D
PeterHolbrook
Apple Corer
Posts: 247
Joined: Fri Oct 26, 2007 7:56 am

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

Post by PeterHolbrook »

CharlesS wrote:FWIW, here's a set of commands that just worked for me to build QEMU on a clean machine. This is for Mavericks, because that's all I had that didn't have a bunch of dev stuff already on it, but it will probably work on Yosemite as well. If it doesn't or if I made a typo/omission somewhere, keep your head screwed on and ask for help.

Install Homebrew:

Code: Select all

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
[...]

Code: Select all

qemu-install/bin/qemu-system-ppc -bios openbi-qemu.elf -boot d -cdrom os9.iso -M mac99 -m 512 -cpu 750
[...]

Note: You'll probably have to run it a few times to get as far as the screen above. A lot of the time it hangs earlier than that in the boot process.
Many thanks. Those instruction are, indeed, complete and they work fine in Yosemite. Just two things: The last quoted instruction should be, instead,

Code: Select all

qemu-install/bin/qemu-system-ppc -bios openbios-qemu.elf -boot d -cdrom os9.iso -M mac99 -m 512 -cpu 750


Launching the compiled qemu worked immediately as expected. Thanks again.

Edit: Later launches of the compiled qemu got to the same place or went astray much earlier in the boot process. I can't really understand why the execution path seems to be so erratic.
User avatar
sentient06
Mac Mechanic
Posts: 187
Joined: Tue Mar 29, 2011 8:57 pm
Location: London, UK

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

Post by sentient06 »

adespoton wrote: One last thing for Alex/Cormac and company: as SoC winds down, is there someone in place that could dole out specific issues to investigate/fix? I personally don't have the time to spend on running the project, but if there was a list somewhere of outstanding issues/roadblocks, I could definitely chip away at it from time to time. Understandably, the OpenBIOS stuff is a bit more involved, as the structure, logic and I/O needs to be just-so before any of it will work, and there are tons of dependencies. But I think there are a number of us who know that side well enough to help regression test and debug too :)
I wish I could help. :cry:

Anything an average developer can do to help investigate? By 'average' I mean, someone who knows the daily C/C++ programming but never got involved in emulation and big projects in these languages.
User avatar
Cat_7
Expert User
Posts: 5017
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 »

Well,

I've finally been able to produce working openbios-qemu.elf files by installing OpenSUSE 10.3 on my G4.
I built versions from both cormac's and alexander graf's latest branches, but with both Qemu hangs in the same spot as earlier.

Best,
Cat_7
kikyoulinux
Tinkerer
Posts: 83
Joined: Sun Sep 28, 2014 11:53 am
Location: China

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

Post by kikyoulinux »

It hasn't been updated since July 1st...
CharlesS
Tinkerer
Posts: 97
Joined: Thu Aug 14, 2008 9:05 am

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

Post by CharlesS »

It's just been updated today (albeit with Tuesday's post date).

Looks like they've submitted what they are labeling as the "hopefully final" changes to OpenBIOS, suggesting that whatever problems OpenBIOS had, they are now solved.
There's no earthly way of knowing, which direction we are going, for the rowers keep on rowing, and they're certainly not showing any signs that they are slowing.
PeterHolbrook
Apple Corer
Posts: 247
Joined: Fri Oct 26, 2007 7:56 am

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

Post by PeterHolbrook »

CharlesS wrote:It's just been updated today (albeit with Tuesday's post date).

Looks like they've submitted what they are labeling as the "hopefully final" changes to OpenBIOS, suggesting that whatever problems OpenBIOS had, they are now solved.
In case they've actually updated https://www.dropbox.com/s/pfsv04vl7stcx ... emu.elf.xz, the result is indistinguishable (as far as the crash is concerned) from the previous build. Hopefully, we'll get some clarification or new build instructions soon.

Edit: On second thought, it seems O'Brien implies that it HASN'T been updated yet. Proposed changes are still pending.
User avatar
Cat_7
Expert User
Posts: 5017
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 »

I built elf files from:
https://github.com/cormac-obrien/openbi ... e/upstream (updated 3 days ago)
and from:
https://github.com/agraf/openbios-devel/tree/macos9 (updated 9 days ago)

and qemu from:
https://github.com/agraf/qemu/tree/macos9 (updated 1st of July)

But both elf files show the same behaviour when booting OS9. Suggesting that, if openbios problems are fixed, the problem now is in Qemu.

Best,
Cat_7
PeterHolbrook
Apple Corer
Posts: 247
Joined: Fri Oct 26, 2007 7:56 am

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

Post by PeterHolbrook »

Mark these words (by Cormac O'Brien, I think), written yesterday in http://www.openfirmware.info/pipermail/ ... 08778.html

"I guess something is different with the Mac OS X build process that prevents Mac OS 9 from working."

It would appear that if the project is compiled entirely in Linux, the boot process goes beyond what we've seen so far.
CharlesS
Tinkerer
Posts: 97
Joined: Thu Aug 14, 2008 9:05 am

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

Post by CharlesS »

That was by "programmingkid", not Cormac O'Brien.

With the sources that have been available to us (minus the new updates to OpenBIOS), it seems to have gotten exactly the same distance on Linux, given that people posted screenshots earlier in the thread of it getting the bomb box at the exact same point where I see it.
There's no earthly way of knowing, which direction we are going, for the rowers keep on rowing, and they're certainly not showing any signs that they are slowing.
PeterHolbrook
Apple Corer
Posts: 247
Joined: Fri Oct 26, 2007 7:56 am

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

Post by PeterHolbrook »

CharlesS wrote:That was by "programmingkid", not Cormac O'Brien.
It's likely you are mistaken. "programmingkid" seems to be the author of all or some of the lines beginning with ">". The previous quotation comes from a line WITHOUT ">", so it seems to have been authored by Cormac O'Brien, referred at the top of the file (also without a ">").
CharlesS
Tinkerer
Posts: 97
Joined: Thu Aug 14, 2008 9:05 am

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

Post by CharlesS »

Other way around.

Image
There's no earthly way of knowing, which direction we are going, for the rowers keep on rowing, and they're certainly not showing any signs that they are slowing.
PeterHolbrook
Apple Corer
Posts: 247
Joined: Fri Oct 26, 2007 7:56 am

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

Post by PeterHolbrook »

CharlesS wrote:Other way around.
What does that prove? It still seems it's Cormac writing that last, crucial line.
CharlesS
Tinkerer
Posts: 97
Joined: Thu Aug 14, 2008 9:05 am

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

Post by CharlesS »

PeterHolbrook wrote:
CharlesS wrote:Other way around.
What does that prove? It still seems it's Cormac writing that last, crucial line.
The author of the post (and hence of the lines without ">" in front) is programmingkid. Cormac is the person who was quoted, so he is the author of the lines with one ">" in front of them.

He may have gotten the idea from reading your posts in this thread :razz:
There's no earthly way of knowing, which direction we are going, for the rowers keep on rowing, and they're certainly not showing any signs that they are slowing.
PeterHolbrook
Apple Corer
Posts: 247
Joined: Fri Oct 26, 2007 7:56 am

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

Post by PeterHolbrook »

CharlesS wrote:The author of the post (and hence of the lines without ">" in front) is programmingkid. Cormac is the person who was quoted, so he is the author of the lines with one ">" in front of them.

He may have gotten the idea from reading your posts in this thread :razz:
It's too bad you're still mistaken on BOTH accounts. The author of the post I quoted is Cormac, not "programmingkid", as you wrongfully insist. The quested person in the post I quoted is "programmingkid", not Cormac. As for my comments on Qemu, they were related to the difficulties involved in COMPILING it, not in EXECUTING it. So, no.

Edit: I stand corrected on the first account. You are, indeed, right. Sorry.
CharlesS
Tinkerer
Posts: 97
Joined: Thu Aug 14, 2008 9:05 am

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

Post by CharlesS »

The "difficulties in executing" it are just because it's not done yet. Cormac's blog mentions that there's still work to be done on the QEMU end—it doesn't support a register that OS 9 needs. He's been doing a great job so far, so I'm sure he's working on it.

Why all the negativity?
There's no earthly way of knowing, which direction we are going, for the rowers keep on rowing, and they're certainly not showing any signs that they are slowing.
PeterHolbrook
Apple Corer
Posts: 247
Joined: Fri Oct 26, 2007 7:56 am

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

Post by PeterHolbrook »

CharlesS wrote:Why all the negativity?
What "negativity" is that? "Negativity" that it wouldn't compile? Well, you see, believe it or not, it WOULDN'T compile with O'Brien's instructions. Are you referring to that "negativity" or have you imagined something else?
User avatar
adespoton
Forum All-Star
Posts: 3068
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 thought it might be worth posting Cormac's log from the 18th:
2015.08.18

It appears that OS 9 is attempting to write to the OHCI HcDoneHead register, which QEMU doesn't support. This doesn't seem like a common operation, and most documentation marks the register read-only.

We've also determined that it's possible to skip into Macsbug by holding the control key when the splash screen appears.
That explains an issue I found (no idea how to fix it), and shows promise for easier debugging with Macsbug :)
PeterHolbrook
Apple Corer
Posts: 247
Joined: Fri Oct 26, 2007 7:56 am

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

Post by PeterHolbrook »

When is GSoC 2015 supposed to end? Has anyone seen any further progress in the OS 9.2 boot process?
User avatar
adespoton
Forum All-Star
Posts: 3068
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 »

PeterHolbrook wrote:When is GSoC 2015 supposed to end? Has anyone seen any further progress in the OS 9.2 boot process?
Official close date was yesterday; Fri, September 25 is the GSoC 2015: "Soft" deadline for student code sample submission. Students who want their t-shirts and certificates in the first wave of shipments must submit their code sample by this date.

There's then a Mentor Summit on November 7-8. But the bulk of the work expected for this GSoC should now be complete.

In the case of qemu-os-9, this has been (predictably) held up by merging and testing the OpenBIOS code. Once those issues are straightened out, a lot of the heavy lifting will be complete for the project. Hopefully enough functional units can be rolled back into qemu and OpenBIOS that regular contributors can add fixes to bring full function closer to reality. But the legwork done this summer is the stuff we've been trying to get done for the past 4 years without success. Yay!
PeterHolbrook
Apple Corer
Posts: 247
Joined: Fri Oct 26, 2007 7:56 am

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

Post by PeterHolbrook »

Thanks. Let's hope we hear of some more progress in the near future.
airat78
Inquisitive Elf
Posts: 25
Joined: Fri Feb 15, 2013 3:27 pm

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

Post by airat78 »

The new another good side of this progress, one man tried to launch 10.5.4 Leopard in QEMU PPC, with the big success.

http://forums.macrumors.com/threads/leo ... u.1907447/

His note about performance speed of emulated Leopard:
this is the host machine... (its a hackintosh) performance in the emulated machine is quite slow... (but at the same time the CPU utilisation in the host isn't much) I would peg it around about leopard on a 450Mhz G4 or so in speed (I think this would also work for pearpc and currently pearpc is faster irc) the HDD throughput in qemu is also quite slow so that hits leopard some what
User avatar
adespoton
Forum All-Star
Posts: 3068
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 »

Cool!

For those of you who don't know, PearPC only does 10.1 through 10.4 -- 10.5 PPC has never worked in an emulator before, and 10.5 PPC only works in VirtualBox 4.3.6 IIRC (later versions changed some things that break 10.4 and 10.5 virtualization).

Sounds like I may finally be able to emulate 10.5 PPC :D
Post Reply