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

kataetheweirdo
Apple Corer
Posts: 288
Joined: Sun Feb 01, 2009 4:55 pm

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

Post by kataetheweirdo »

I'll give some insight as to why QEMU's VGA hack might not work as well as it may seem. If you look inside a clut resource within a Mac program using a resource editor, you'll notice that colors go from 0 to 65335 instead of 0 to 255. It's still RGB, but it uses 16-bit big-endian entries for cluts. Moreover, they're indexed too, so each entry needs a 16-bit number to indicate the entry (even though only up to 256 entries will usually be present). So, if the first entry is white, the second is black, and the third is a slightly blue green, then the result is:

Code: Select all

0000FFFFFFFFFFFF
0001000000000000
000201BCF0F00F0F
indx redgrenblue
It's possible that this may be too big for VGA. You can safely cut out the eight lsbs for each of the red, green, and blue values in many cases, though probably not all of them. It can be a major problem if a program directly tries to modify those color entries during runtime and isn't just streaming them from the clut resource table like many Mac programs do. There's also the index, which can be used to sort color entries. While this is redundant in many cases, sometimes the entries can be out of order (though you'd need to use the hex editor to see this in action).
User avatar
MacPlussed
Inquisitive Elf
Posts: 25
Joined: Wed Apr 11, 2018 2:42 pm

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

Post by MacPlussed »

QEMU always staying on "Trying hd :,\\: tbxi ..." text. Is there an error in the code?

Code: Select all

qemu-system-ppc.exe -L pc-bios -boot c -m 512 -M mac99 -prom-env "boot-args=-v" -prom-env "auto-boot?=true" -prom-env "vga-ndrv?=true" -sdl -netdev user,id=net0 -device sungem,netdev=net0  -device usb-mouse -device usb-kbd -drive "file=macos_91_ppc.iso,format=raw,media=cdrom" -drive "file=MacOS91.img,format=raw,media=disk" 
I installed Mac OS 9.1 on HD.
User avatar
adespoton
Forum All-Star
Posts: 3105
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 »

Try swapping the last two drive arguments so the internal drive loads first. In fact, you can probably just remove the CDROM argument altogether if you've already successfully installed onto the internal HD.
neozeed
Apple Corer
Posts: 289
Joined: Sun Aug 25, 2013 3:25 am
Location: Hong Kong

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

Post by neozeed »

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
Whoa this is exactly what i'm looking for with all my Darwin experiments... I really need acces to OS X Server 1.2....

What Qemu build are you using? flags? Did it install under Qemu? Is it a pre-installed disk image?

Just to show you what I've been able to do, over at nextcomputers:

http://www.nextcomputers.org/forums/vie ... c&start=45

With help from Ncommander we've been able to build out the vast majority of the early Darwin source, and get a chunk of that running under the Rhapsody DR2 on x86. But having 'working' access to a PowerPC build with the different driver model would let me do some comparisons of the newer driver bus, which would greatly help out stuff on the x86 side...

Not to mention to see if my cobbled up netinfo actually works...!

It'd be super great to try to extend some of the PPC support code, you know platforms and stuff, but I'm not that good, but having known good working stuff, and being able to tear apart OS X 1.0 again would be FAN TASTIC...!!!

So yeah hlp plz!
don't do today what you can put off until tomorrow.
User avatar
Cat_7
Expert User
Posts: 5103
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 Neozeed,

Check out this post:
viewtopic.php?f=34&t=7047&p=55205#p55205

Best,
Cat_7
neozeed
Apple Corer
Posts: 289
Joined: Sun Aug 25, 2013 3:25 am
Location: Hong Kong

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

Post by neozeed »

Code: Select all

qemu-system-ppc.exe -L pc-bios -prom-env "boot-args=-s rd=sd0" -prom-env "boot-device=cd:9,\\:tbxi" -drive file=..\1.vmdk,index=1,format=vmdk,media=disk -drive file=..\12.iso,index=0,format=raw,media=cdrom -M g3beige -cpu g3
I downloaded the latest win64 binary from https://qemu.weilnetz.de/w64/ And this got me into single user mode... And yes I can type!

It's crazy slow, but wow... this is great!


https://imgur.com/a/OIf6H7h

Full album of installation.

So basically boot up the MacOS part of the CD to partition the virtual disk. Nothing special here

Code: Select all

qemu-system-ppc-screamer.exe -L pc-bios  -m 256 -M mac99 -prom-env "boot-args=-v" -prom-env "auto-boot?=true" -prom-env "vga-ndrv?=true" -hda 2.vmdk -cdrom "Mac OS X Server 1.2, MOSX_Booter.iso"  -sdl -device usb-mouse -device adb-keyboard -boot d
Boot up the OS X side of the CD, and it'll format & start the install

Code: Select all

qemu-system-ppc.exe -L pc-bios  -prom-env "boot-args=-v rd=sd0" -drive file=..\2.vmdk,index=1,format=vmdk,media=disk -M g3beige -cpu g3  -drive file=..\"Mac OS X Server 1.2, MOSX_Booter.iso",index=0,format=raw,media=cdrom -prom-env "boot-device=cd:9,\\:tbxi" -m 256 -net none
I wasn't sure where the boot stuff is, so boot off the CD again, but point root to hd0, and it'll complete the install.

Code: Select all

qemu-system-ppc.exe -L pc-bios  -prom-env "boot-args=-v rd=hd0" -drive file=..\2.vmdk,index=1,format=vmdk,media=disk -M g3beige -cpu g3  -drive file=..\"Mac OS X Server 1.2, MOSX_Booter.iso",index=0,format=raw,media=cdrom -prom-env "boot-device=cd:9,\\:tbxi" -m 256 -net none
don't do today what you can put off until tomorrow.
neozeed
Apple Corer
Posts: 289
Joined: Sun Aug 25, 2013 3:25 am
Location: Hong Kong

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

Post by neozeed »

Image

Also I kinda worked around the weird installer thing and got Darwin 0.3 to install!

You need to install OS 9, I used the G4 Cube version, onto a disk. Then get the Darwin 1.0 CD image, and copy the disk imaging tool to the hard disk. Then using that tool, restore the image on the Darwin 0.3 CD onto a empty disk.

And then I used Steve Troughton Smith's BootX loader https://github.com/steventroughtonsmith/BootX


qemu-system-ppc.exe -L pc-bios -drive file=..\darwin03.qcow2,index=0,format=qcow2,media=disk -drive file=BootX_custom.dmg,index=2,format=raw,media=disk -prom-env "boot-device=ide1:2,\BootX" -prom-env "boot-args=-v rd=sd0 debug=0xffe kdp=2" -prom-env "boot-file=ide0:8,\mach_kernel" -M g3beige

Yes it does take a while to boot up, but yay now I can test feature parity between x86 and PowerPC
don't do today what you can put off until tomorrow.
User avatar
sidoh
Tinkerer
Posts: 50
Joined: Sun Aug 21, 2016 12:59 am
Location: Unknown

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

Post by sidoh »

neozeed wrote:*snip*
So I tried this with the original 1.2, not 1.2v3, since that's all i have access to right now. I also used a QCOW2 image instead of VMDK.
First off, the included OS 9 on the 1.2 CD didn't boot in either QEMU version, so I just booted off a 9.2.1 CD and did the OS X partitioning from there. I also got a different NVRAM error, but I put that down to QEMU not emulating NVRAM.

Then I tried booting the OS X partition off the CD, and that is sadly where I came to a dead end:
Image
Yes, i'm using RS5. :P

I can see the boot animation playing a couple of seconds, before it stalls. QEMU is still running fine, but boot does not progress beyond this point (I left it open for 20 minutes just to check). For the record, I tried booting it in single-user mode after this, but it stalls at the same point.
neozeed
Apple Corer
Posts: 289
Joined: Sun Aug 25, 2013 3:25 am
Location: Hong Kong

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

Post by neozeed »

sidoh wrote:

I can see the boot animation playing a couple of seconds, before it stalls. QEMU is still running fine, but boot does not progress beyond this point (I left it open for 20 minutes just to check). For the record, I tried booting it in single-user mode after this, but it stalls at the same point.
That doesn't look right at all...

What flags are you using? And your build looks very different from mine...

I just uploaded the Darwin 0.3 I got booting over @ sourceforge here:

https://sourceforge.net/projects/aapl-d ... z/download

Give that one a shot, see if it runs on your machine.

The version of Qemu Im using is:

QEMU emulator version 2.11.91 (v2.12.0-rc1-11705-g364d3c3807-dirty)
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers
don't do today what you can put off until tomorrow.
User avatar
sidoh
Tinkerer
Posts: 50
Joined: Sun Aug 21, 2016 12:59 am
Location: Unknown

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

Post by sidoh »

neozeed wrote:
sidoh wrote:

I can see the boot animation playing a couple of seconds, before it stalls. QEMU is still running fine, but boot does not progress beyond this point (I left it open for 20 minutes just to check). For the record, I tried booting it in single-user mode after this, but it stalls at the same point.
That doesn't look right at all...

What flags are you using? And your build looks very different from mine...

I just uploaded the Darwin 0.3 I got booting over @ sourceforge here:

https://sourceforge.net/projects/aapl-d ... z/download

Give that one a shot, see if it runs on your machine.

The version of Qemu Im using is:

QEMU emulator version 2.11.91 (v2.12.0-rc1-11705-g364d3c3807-dirty)
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers
I'm using a 2.11.94 binary, also from https://qemu.weilnetz.de/w64/.
I just tried following the exact same steps as you, that includes the flags.
That screenshot was taken when I was using Sets (in the latest Windows 10 insider build) and SDL (instead of GTK), so the titlebar looks wildly different from yours, sorry.

I'm currently getting a copy of 1.2v3, I'll check to see if that works on my system.

UPDATE:
Image

Looks like the problem is with the OS, after all.

And if you don't particularly care for your eyesight, you can always try out the Mac OS 8.6 included in Blue Box! It does seem to work, but.....

Image
neozeed
Apple Corer
Posts: 289
Joined: Sun Aug 25, 2013 3:25 am
Location: Hong Kong

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

Post by neozeed »

Don't get me wrong, the progress is simply amazing on Qemu, but the jumpy mouse is driving me INSANE... It took what felt like an hour to open a terminal in OS X Server 1.2 ...

As for the bluebox looking crazy it'll be the screen depth, much like the boot logo...

Add the resolution / depth flags, and it'll most likely look more mac like..

Code: Select all

-g 1024x768x8
It doesn't look like Darwin has NIC drivers, or they don't pickup the sungem. ... And I had nothing but trouble trying to get to a prompt in OS X 1.2 so I don't know if it picked up anything there.....

Also speaking of Rhapsody/NeXTSTEP v5, if you go into the devices config, remove the floppy driver, it'll shave a good 30 seconds of polling a device that didn't seem to want to work anyways.
don't do today what you can put off until tomorrow.
User avatar
sidoh
Tinkerer
Posts: 50
Joined: Sun Aug 21, 2016 12:59 am
Location: Unknown

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

Post by sidoh »

I find that holding the mouse buttons while moving the cursor makes it a bit less jumpy (but still very annoying to use), so try that out.

Thanks for the screen depth tip! :) Blue Box now works perfectly, so now you can run Mac OS 8.6 in QEMU :P

Image
User avatar
MacPlussed
Inquisitive Elf
Posts: 25
Joined: Wed Apr 11, 2018 2:42 pm

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

Post by MacPlussed »

Help me please. USB Mouse In every QEMU version, Mouse's cursor goes to some places and it is error. If I use ADB Mouse, will not a Mouse failure come?

Here is the code:

Code: Select all

qemu-system-ppc.exe -L pc-bios -M mac99 -m 512 -prom-env "boot-args=-v" -prom-env "vga-ndrv?=true" -boot d -drive file=MacOSXPB.iso,format=raw,media=cdrom -drive file=MacOSX.img,format=raw,media=disk -device usb-mouse -device usb-kbd -netdev user,id=network01 -device sungem,netdev=network01
kataetheweirdo
Apple Corer
Posts: 288
Joined: Sun Feb 01, 2009 4:55 pm

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

Post by kataetheweirdo »

In my personal experience, it runs best when going fullscreen. The mouse may also work better in GTK or SDL depending on the computer's set-up.
User avatar
Cat_7
Expert User
Posts: 5103
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 »

Help me please. USB Mouse In every QEMU version, Mouse's cursor goes to some places and it is error. If I use ADB Mouse, will not a Mouse failure come?
Qemu using the GTK interface by default. With SDL the mouse stays inside the window and jumps less.
Add -sdl to your command line.

For some Mac OS versions (such as 9.0.4) qemu doesn't support 2 usb devices. If you find you cannot type or the mouse doesn't work, you can leave out the usb devices from the command line.

Best,
Cat_7
User avatar
MacPlussed
Inquisitive Elf
Posts: 25
Joined: Wed Apr 11, 2018 2:42 pm

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

Post by MacPlussed »

Cat_7 wrote:
Help me please. USB Mouse In every QEMU version, Mouse's cursor goes to some places and it is error. If I use ADB Mouse, will not a Mouse failure come?
Qemu using the GTK interface by default. With SDL the mouse stays inside the window and jumps less.
Add -sdl to your command line.

For some Mac OS versions (such as 9.0.4) qemu doesn't support 2 usb devices. If you find you cannot type or the mouse doesn't work, you can leave out the usb devices from the command line.

Best,
Cat_7
But I was installing Mac OS X Public Beta.

And one more thing:
Which QEMU version can solve this problem?
Even if I use ADB Mouse in QEMU, the mouse still going different places.
User avatar
adespoton
Forum All-Star
Posts: 3105
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 decided to get on the 1.2v3 bandwagon, now that it sort of actually boots and runs. Oddly, with the modified BootX, I get to here:

Image

Should I just be waiting longer than 15 minutes for it to go further, or am I missing something?
User avatar
Cat_7
Expert User
Posts: 5103
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 »

Two new experimental builds have landed: for OSX and for Windows. Now including the new uninorth code and an experimental openbios setting the machine to powermac3,1

OSX see here: viewtopic.php?f=34&t=8848#p52104
and
Windows see here: viewtopic.php?f=34&t=9028

More to come soon ;-)

Best,
Cat_7
Meow2004
Space Cadet
Posts: 9
Joined: Thu May 03, 2018 3:09 pm

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

Post by Meow2004 »

I'm confused on when you install DP2, you need to partition the hard drive. What do you need to do? Do you need to install 9.2, then install from there?
User avatar
adespoton
Forum All-Star
Posts: 3105
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 »

No, you need to use the drive setup utility from 9.x to partition the hard drive, then boot into OS 9 to run the DP2 installer which will install to the partition you've just created.
User avatar
sidoh
Tinkerer
Posts: 50
Joined: Sun Aug 21, 2016 12:59 am
Location: Unknown

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

Post by sidoh »

I was bored, so I threw every machine-specific version the Sawtooth G4 had at the Windows build with the experimental OpenBIOS. I first tried directly booting from CD, then booting into an OS 9.0.4 image and installing the Sawtooth versions onto a clean HDD. Here are my results:

* 8.6/9.0 don't boot from either HDD or CD, due to obvious reasons. (ie. The Mac OS ROM is too old and crashes QEMU.)

* 9.0.2 starts to boot from HDD and CD, but quickly stops with this:

Image

I'm not sure if the CD problem is due to my source .toast file being faulty, though, but for the HDD problem, I think it suffers from the same problem as 9.0.4 below.

* 9.0.4 boots fine from CD, but when i try to initialize the HDD, I get this error:

Image

Afterwards, Disk Utility does not detect any ATA drives, only ATAPI drives. As for booting from HDD, it stops with the same error as 9.0.2 above.
User avatar
Cat_7
Expert User
Posts: 5103
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 »

Is this with the PMU enable build, using machine model mac99?
If so, then that initialization issue has not yet been resolved.

Best,
Cat_7
User avatar
sidoh
Tinkerer
Posts: 50
Joined: Sun Aug 21, 2016 12:59 am
Location: Unknown

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

Post by sidoh »

Cat_7 wrote:Is this with the PMU enable build, using machine model mac99?
If so, then that initialization issue has not yet been resolved.

Best,
Cat_7
Yup, it's the May 4 experimental Windows build, using the mac99 model and pm3,1 openbios. Hope it gets resolved, this is pretty interesting stuff. :P
User avatar
adespoton
Forum All-Star
Posts: 3105
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 »

So... I got Mac OS X Server 1.2 booting. In my config file, I forgot to convert "boot-device=cd:9,\\:tbxi" to "boot-device=cd:9,\\\\:tbxi" to deal with BASH escaping things with backslashes.

ImageOS X Server 1.2 - Password Too Long by adespoton

The recent OS X build is having no jumpy mouse issues either :)

The screen geometry doesn't seem to matter, but booting into Server seems to panic if I don't set 32 bit depth, and booting into 8.6 draws weirdly if I don't set 8 bits. Unfortunately, the Server monitors settings only lets me do thousands and millions.

How did you get 8 bits in 8.6?
User avatar
Cat_7
Expert User
Posts: 5103
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 »

Are using the 4th of May 2018 213pre build? That contains a 256 colour vga-driver that might help here. Check out the readme in the vga-driver folder.

Best,
Cat_7
Post Reply