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

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 »

@Mcayland Regarding OS9. I could boot the OS9 image i was playing with at the time fine in QEMU on my OS X machine but if I took the openBIOS rom moved it to my linux PowerPC mac and fired up QEMU with KVM in the mix to virtualize rather then emulate the PowerPC CPU it would fail to load the OS9 rom on the CD image at the time... its been a while since I dabbled in it so i dont remember exactly where it hung but i dont think it made it past the OpenBIOS screen at some point ill have to get the Mac going and play with it some more (iv been doing other Projects atm got some new computers iv been playing with)

regarding the Cd Rom I got it to show up in OS X on the mac99 option by doing this "-drive file=path-to-iso-image,index=1,media=cdrom" then I specified the Hard disk to be index 0 so it was a bit like a HDD as master and the CDROM as slave... it seems index 2 and 3 dont work (ie Darwin/OS X do not see them) I did not need to mess with OS Xs boot args or boot files for it to work.

finally regarding the display Bug I think they fixed the bug in 2.2 I think then it broke when the 2.5RCs came out and is still broken I have not played with VNCing as a display Maybe i should look into it... but yeah before 2.2 (I think), if you specified a G4 CPU then booted OS X the display output was glitchy ie your mouse vanishing and trying to go to about this mac or system profiler would crash the finder/system profiler but the G3 CPU option works fine... also when I use the G4 option on my Linux PPC KVM machine it works fine and i can view everything fine no missing mouse or crashing of system profiler so its something to do with G4 emulation... running QEMU with KVM also let Tiger boot on the 604 CPU option with my patched kernel (witch boots fine on real 604 macs like a 9600 or 8600 but would kernel panic in qemu in emulation mode when you specified a 604 CPU so there is a bug in 604 emulation too (even on OS X versions that "natively" supported the 604 it would still Panic)

I also recommend you check out this thread http://forums.macrumors.com/threads/pow ... e.1939653/ and this youtube vid i did on it https://www.youtube.com/watch?v=lbDj4NGEJEQ

I hope this all makes sense :) I am not very good at putting things down in writing if that makes sense LOL
User avatar
Cat_7
Expert User
Posts: 6177
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 create a new log file using test4 with the debug commands:
SC6 / SC7
HD: Displays the contents of the heap, low memory on the top, high memory at the bottom.
RD: Displays the contents of the Resource Chain (all resources loaded, and to whom they belong).
File: Tells you what is in RAM.

The log file is quite big, so it can be downloaded here: http://www.open.ou.nl/hsp/downloads2/StdLog.zip

Any other suggestions? I have the macsbug reference for version 6.2

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

http://bebop.gtxent.com/MacsBugRef_6.2.pdf

for anyone that would like to reference as well.
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 »

@LightBulbFun: thanks again for the information and video - getting this level of feedback from people who know about Macs is invaluble!

After some digging around, I think I've worked out what the problem with the cdrom is - it seems Darwin only matches the cdrom under -M mac99 if it is attached to the ata-3 bus (as opposed to ata-4 which is QEMU's default attach point). Can anyone confirm that this theory is correct with respect to real Mac hardware?

For those interested you can test this by temporarily "faking" the device tree in QEMU and confirming that the cdrom is then detected upon boot:

qemu-system-ppc -cdrom darwinppc-602.iso -boot d -M mac99 -prom-env 'auto-boot?=false'

and then at the Forth prompt:

cd /pci/mac-io/ata-4
" ata-3" encode-string " model" property
boot

You should then see that the cdrom is detected. If this theory is correct, the proper fix is to switch the OpenBIOS device tree over to use 2 x ata-3 busses rather than 1 x ata-3 and 1 x ata-4 bus and make that the default attach point for the cdrom - I'll see if I can rustle up something over the festive season.
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 »

@Cat_7: wow that's a whole lot of information...!

A quick skim of the MacsBugs manual around p. 111 suggests that the stack frame is managed manually (i.e. no fixed ABI layout) so I think the only way to extract the name of the library is to start adding breakpoints in relevant places and then manually poking through the registers in an interactive session. MacsBugs breakpoints are slow under QEMU (presumably because they are software rather than hardware) so this could take some time...
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 »

@mcayland I played around with it a bit with the stuff you Suggested and indeed faking it does let OS X see the cd rom and find root device but soon after it will give a Read/write error/ata device blocking the bus error and stop booting but it does find the CDROM (I tried 2 versions of tiger and one of 10.2 witch did make it to a GUI but the installer then crashed out) I do Own a Real Sawtooth PowerMac 3,1 at some point (its kinda missing a CPU and sitting in storage) I can dig it out and put a DVD/CD drive on the main HDD ATA bus and see if it boots from it but from vague memory (I think i played with this before) it can boot from the main ATA channel with a optical drive I hope this helps :)
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 »

Well the point of the hack was to show that it was the ATA bus which was affecting the detection and not the cdrom emulation. Even with this hack in place there are still other properties that need to changed too, e.g. AAPL,bus-id, interrupt-map etc. so the real solution is to come up with a patchset for OpenBIOS which generates both sets of nodes correctly. As soon as I have something I'll upload it somewhere for people to test :)
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 »

was doing some more testing and even with me specifying a different index I still get stuck at the Read/Write error so this particular thing seems like a CD ROM bug. this is just things i have observed while playing with QEMU and OS X etc heh. if you dont Mind me asking but are you a developer for QEMU?
User avatar
adespoton
Forum All-Star
Posts: 4286
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's a developer for OpenBIOS, and was one of the mentors for the GSOC emu OS 9 project this summer :) Alex Graf was the corresponding qemu dev, and Cormac was the student.
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 »

oh very cool... I have played around with open firmware, PowerPC macs and emulators my self quite a bit its quite fun ill say that much heh. Most recently I was playing with a G3 blue and white I had acquired and I found a boot option selector that no one knew the G3 BW has heh (i then went to test this discovery on a friends Lombard and discovered it has one too but different from the BW G3 one and the one we normally think of on PPC macs) I also got Mac OS 9.2.2 Ubuntu Mate 15.10 and OS X 10.5.8 leopard installed (with a G4 7400 fitted for the last)
CharlesS
Granny Smith
Posts: 107
Joined: Thu Aug 14, 2008 9:05 am

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

Post by CharlesS »

I've got an old Pismo PowerBook lying around in my closet, and if you have some tests you'd like me to run, let me know and I'll give it a shot, assuming the machine still boots up.
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.
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 »

@LightBulbFun: I'm the current QEMU SPARC maintainer and also OpenBIOS maintainer. It just so happens that as I do a lot of OpenBIOS testing I need a set of PPC images around to make sure regressions don't get introduced and so I tend to find most of the PPC bugs first ;)

I've now put together a set of patches which uses 2 x ata-3 buses for QEMU Mac machines in OpenBIOS (check out the difference in show-devs output). Superficially it seems okay here on g3beige/mac99 for Darwin and OS 9 but I'd be grateful for more feedback from anyone willing to test:

https://www.ilande.co.uk/tmp/openbios/openbios-ppc-ata3
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 »

Well thats very cool :) I downloaded the openBIOS file and tested it in QEMU while The tiger DVD image saw the Root device and tried to load feather it just slowly halted after a few Read/write error messages popped up id post pics (and iv been taking some) but i dont have any real way to host them... and I cant find a upload button here LOL any way back on topic I then went to try a 10.2 CD installer and it booted up all the way to the installer with out crashing! this is defo some awesome progress
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 »

LightBulbFun wrote:Well thats very cool :) I downloaded the openBIOS file and tested it in QEMU while The tiger DVD image saw the Root device and tried to load feather it just slowly halted after a few Read/write error messages popped up id post pics (and iv been taking some) but i dont have any real way to host them... and I cant find a upload button here LOL any way back on topic I then went to try a 10.2 CD installer and it booted up all the way to the installer with out crashing! this is defo some awesome progress
Hmmmm is this under g3beige or mac99? And is it a regression or does it just get further than before? Sadly Tiger is not one of the test images I have available (currently I just have 10.2) so that's not something I can immediately test. If you find a way to post the images I'll have a look though.

(Also just to double-check - you are running something around the latest QEMU 2.5 release?)
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 »

indeed I am using the latest QEMU 2.5 with the Mac99 machine... BTW for OS X installers etc I recommend you check out here http://macintoshgarden.org/apps/mac-osx-mac-os-10-ppc and for other mac OS images check out http://macintoshgarden.org/apps/operating-systems they have a lot of Mac OS system images there its my go to when I need to download a OS installer say Tiger or Leopard etc regarding about tiger hanging it hung earlier in the boot before it made the ram disks (well it made them after the Read/write error popped up but it was very slow to do so where as manually renaming the ATA device id get the same error but later on the boot but it would still hang)
User avatar
Cat_7
Expert User
Posts: 6177
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 »

Test result from booting 10.1, 10.2, 10.3 and 10.4 with openbios-ppc-ata3, Qemu built from source dd 24-12-2015.

Is it correct that your openbios-ppc-ata3 binary is built on the 19th? You provided it on the 24th.

Command line:
-bios openbios-ppc-ata3 -boot d -M g3beige -m 256 -g 1024x768x32 -cpu G3 -prom-env 'auto-boot?=true boot-args=-v' -cdrom /Volumes/OSX_Data/Downloads/OSX_ISOs/……

g3beige, G3
10.1.2: crashes at AppleSCCSerial, IOSerialFamily
10.2: Kernel panic. You need to restart….
10.3: Boots to installer
10.4: (dvd image): crashes Qemu.

mac99, G3:
10.1.2: Beach ball stops after 3 seconds
10.2: The installer has quit due to an unexpected error. Please restart
10.3: Boots to installer
10.4: (dvd image): crashes Qemu.

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

@Cat_7: Hmmm those serial port failures don't look right...?

Hang on a sec, I've built from the incorrect branch - I've accidentally rebased the patches on my experimental ESCC property branch rather than master + interpreter.fs patch required for OS 9, so this binary contains the experimental ESCC DBDMA properties from my previous test images. No wonder some kernels panicked with these changes :(

I'll rebase the patchset onto the correct branch and repost a link to an updated binary shortly - again thanks for testing, and apologies for the slip.
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 »

mcayland wrote:I'll rebase the patchset onto the correct branch and repost a link to an updated binary shortly - again thanks for testing, and apologies for the slip.
And here it is: https://www.ilande.co.uk/tmp/openbios/o ... ppc-ata3-2

This time I double-checked git and booted a couple of images with the binary to make sure it was doesn't contain any trace of commits from my ESCC experimental branch.

@Cat_7: if you are able to run the tests again, could you explicitly mark any tests that regress, i.e. don't get as far as they used to for comparison? Even if the result doesn't quite work, as long as there are no regressions then the patches can be applied upstream.
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 »

ok I did some more tests I got a lot more RW errors in tiger (even after unzipping a fresh image) I Figured a place to put my screen shots may be tempory tho, but here is one of the latest openBIOS the one built on the 24th Image
it hung soon after that Hope this helps (this was booting from a 10.4.6 install Dvd image)
User avatar
Cat_7
Expert User
Posts: 6177
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 »

Qemu from source 24-12-2015
openbios-ppc-ata3-2 -boot d -M g3beige -m 256 -g 1024x768x32 -cpu G3 -prom-env 'auto-boot?=true boot-args=-v' -cdrom /Volumes/OSX_Data/Downloads/OSX_ISOs/……

g3beige, G3
-10.1.2: Now: hangs at beach ball
-10.2: Now: The installer has quit due to an unexpected error. Please restart

-10.3: Additional info: continuing the installer says computer is not compatible with 10.3 (can install on mac99)
-10.4: (dvd image): crashes Qemu.

mac99, G3: No changes
-10.1: Beach ball stops after 3 seconds
-10.2: The installer has quit due to an unexpected error. Please restart
-10.3: boots to installer
-10.4: (dvd image): crashes Qemu.
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 »

@LightBulbFun: I can't seem to reproduce this under Darwin, so will probably need to get hold of a 10.4 image. Possibly an emulation bug related to DVD? Can you provide me the complete QEMU command line you were using?

@Cat_7: looking at your updated test results above, are these still with the faulty openbios-ppc-ata3 rather than the fixed openbios-ppc-ata3-2 binary?
User avatar
Cat_7
Expert User
Posts: 6177
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 »

With the new one (dated 24th).
I just copied the command line from the older post ;-)

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

@Cat_7: It seems really strange, but I can't reproduce your 10.2 results using my local copy:

qemu-system-ppc -prom-env 'auto-boot?=false' -prom-env 'boot-args=-v' -bios /tmp/openbios-ppc-ata3-2 -cdrom osxdisk1.iso -boot d

Under g3beige this boots all the way to the installer with no problems. Under mac99 it very nearly gets to the installer before crashing, however if I also add -cpu G3 then I can get all the way with no problem. At the very least this suggests something is amiss with QEMU's G4 CPU emulation, but I don't see an obvious local regression with g3beige.
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 »

qemu-system-ppc -m 512 -M mac99 -cdrom /Volumes/Storage/Downloads/Tiger_4_6.dmg -boot d -prom-env auto-boot?="false" -prom-env boot-args="-v" -cpu 750 -bios /Volumes/Storage/Downloads/openbios-ppc-ata3-2

that is/was my QEMU command line arguments. btw I was able to boot a 10.2 Install CD ISO to the installer with this new BIOS it no longer quits out
User avatar
Cat_7
Expert User
Posts: 6177
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 »

Update after new download of all disk images from the macintoshgarden
command line:
qemu-system-ppc -bios openbios-ppc-ata3-2 -boot d -M mac99 -m 256 -g 1024x768x32 -cpu G3 -prom-env 'auto-boot?=true boot-args=-v' -cdrom /Volumes/OSX_Data/Downloads/OSX_ISOs/……

mac99, G3:
-10.0: beach ball, stops.
-10.1: beach ball, stops.
-10.2: boots to installer and can install
-10.3: boots to installer and can install
-10.4: (using cd image, not dvd): boots to installer and can install but looses mouse control during install

g3beige, G3
-10.0: beach ball, stops
-10.1: beach ball, stops
-10.2: boots to installer and can install
-10.3: boots to installer. The installer says computer is not compatible with 10.3
-10.4: (using cd image, not dvd): boots to installer. The installer says computer is not compatible with 10.4

It seems we now get the same results. Good progress!

Best,
Cat_7
Post Reply