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: 285
Joined: Sun Feb 01, 2009 4:55 pm

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

Post by kataetheweirdo »

Don't forget to add -L pc-bios to the command line if you're using Cat7's 64-bit Windows build.
User avatar
Cat_7
Expert User
Posts: 5019
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 tried to install 10.3 and also failed. The problem seems to be in the openbios file. As suggested earlier in this thread, use this one: https://www.ilande.co.uk/tmp/openbios/openbios-ppc-rtas
With that openbios, my installation succeeded.

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

Amiganaut wrote: With the Public Beta you have to set the date back to before May 15th 2001 and prevent it from getting online as it will do a network time check during boot. If it does, you'll get this when you log in. You can either pull the network connection for the host machine, or remove the -device sungem,netdev=network0 switch from the command line. Depending on your os, you can add a date command to the batch file to change it before it runs qemu and another afterwards to fix it.
Image

I got it installed! :D It looks like the option to have a date command in the emu.command file is:

-rtc base=2000-09-13

This would pass the date of September 13th, 2000 (the day the Public Beta was released). To start at a specific point in time, provide date in the format "2006-06-17T16:01:21" or "2006-06-17".

Even though I included -rtc in the command file I still get that expired message if I don't delete "-netdev user,id=network0 -device sungem,netdev=network0".
kataetheweirdo
Apple Corer
Posts: 285
Joined: Sun Feb 01, 2009 4:55 pm

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

Post by kataetheweirdo »

I thought you could disable the timer check in the preferences, even with the Public Beta. Also, using the July 19, 2016 OpenBIOS with Cat7's build, I was able to get my blank disk initialized in 9.2.2. I was able to use the Software Restore to install my OS, which is cheesing it a bit, but it works.

However, I've now encountered a problem with the keyboard, where I can't enter anything and Key Caps doesn't recognize the keyboard unless I specify the BIOS as openbios-qemu-wip.elf. However, using the other OpenBIOS files included or openbios_ppc_rtas allows me to do disk writes.

Code: Select all

qemu-system-ppc-wip -bios openbios-ppc-rtas -L pc-bios -boot d -drive file=Mac_OS_9.2.2_Uni.iso,index=0,media=cdrom -drive file=testimg.img,index=1,media=disk,format=raw -M mac99 -m 256 -prom-env 'auto-boot?=true' -g 800x600x32 -net none -usb -device usb-mouse -device usb-kbd
Also, I appear to have issues trying to start up the boot up disk I made. I'm trying to boot up the image on index 1, but I don't know how to do it.

EDIT: Never mind, just had to remove the CD ROM image, then replace "boot d" with "boot c' and testimg.img is in index 0. Or...more like, it's now stuck displaying the desktop background, but can't show the Finder, the icons, or the windows.

EDIT 2:
My new command line:

Code: Select all

qemu-system-ppc-wip -bios openbios-ppc-rtas -L pc-bios -boot c -drive file=testimg.img,index=0,media=disk,format=raw -M mac99 -m 256 -prom-env 'auto-boot?=true' -g 800x600x32 -net none
With this setup, QEMU can now recognize the keyboard, but the mouse is a little stranger. Now, when you try to resize the windows, the mouse gets a little crazy and tries to size up the window along the borders of the screen rather than allowing the user to change the window size by dragging on the window's bottom left corner.
Last edited by kataetheweirdo on Mon Aug 29, 2016 4:42 am, edited 1 time in total.
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 »

For Public Beta: boot with "-rtc base=2000-08-29" without -net option.In System Preferances>Date & Time>Network Time, disable Network Time Synchroniization.Next,shutdown PBeta and boot again with -rtc and -net options.Thus you bypass expiration issue and have internet.This works for me.
Thanks very much for the great progress in Mac OS emulation!
By the way,in Sheep Shaver Rhapsody DP1 cd boots into Mac OS 8,later versions(Server included)refuse to boot.
What can be done for booting Amiga 4 and MorphOS?
kataetheweirdo
Apple Corer
Posts: 285
Joined: Sun Feb 01, 2009 4:55 pm

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

Post by kataetheweirdo »

For Amiga OS 4, there is a version of WinUAE with PPC emulation. I thought that was able to boot up Amiga OS 4, but I thought that also was able to boot up MorphOS. Also, MorphOS relies on the system booting up with the MMU off at first, then turning it on during the booting process. OpenBIOS has the MMU enabled all the time, which hinders MorphOS booting up.

Also, I'm trying to install language kits, but it doesn't work since the installer can't access the System file on my hard drive. This is true regardless of which language kits were selected.

The NVRAM still doesn't seem to work, as it won't save my settings after specifying the time in the Time and Date control panel.

So...8-bit color mode is still corrupted in Cat7's 64-bit Windows build. I also couldn't get the resolution switching to work for some reason, meaning that I still have to specify in the command prompt the resolution I want to use.
Last edited by kataetheweirdo on Mon Aug 29, 2016 7:07 am, edited 1 time in total.
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 »

alex195812 wrote:For Public Beta: boot with "-rtc base=2000-08-29" without -net option.In System Preferances>Date & Time>Network Time, disable Network Time Synchroniization.Next,shutdown PBeta and boot again with -rtc and -net options.Thus you bypass expiration issue and have internet.This works for me.
Worked great! Thanks! Might anyone know how to set the Mac OS 9 color depth to 256 colors? Trying out some of my old Living Books games and it complains about needing 256 colors.
kataetheweirdo
Apple Corer
Posts: 285
Joined: Sun Feb 01, 2009 4:55 pm

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

Post by kataetheweirdo »

celebi23 wrote: Might anyone know how to set the Mac OS 9 color depth to 256 colors? Trying out some of my old Living Books games and it complains about needing 256 colors.
Change -g 800x600x32 to -g 800x600x8 or -g 640x480x8 to get 8-bit color mode. It doesn't display properly for me, though.
Last edited by kataetheweirdo on Mon Aug 29, 2016 7:08 am, edited 1 time in total.
peter_j
Tinkerer
Posts: 49
Joined: Sat Jul 02, 2016 12:28 pm

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

Post by peter_j »

celebi23 wrote: I got it installed! :D It looks like the option to have a date command in the emu.command file is:

-rtc base=2000-09-13

This would pass the date of September 13th, 2000 (the day the Public Beta was released). To start at a specific point in time, provide date in the format "2006-06-17T16:01:21" or "2006-06-17".

Even though I included -rtc in the command file I still get that expired message if I don't delete "-netdev user,id=network0 -device sungem,netdev=network0".
Works a dream! Thanks. :smile:
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 »

For me,IExplorer crashes just after loading home page.I had to do the folowing:
1)launch IE
2)Before it crashes,close the window
3)In IE Preferances change home page to empty one
4)restart IE
perhaps some sites check your system time and if it's wrong...
emaculation.com loads fine -:) also MSN,Apple.com...
If we manage to disable expiration check altogether,it would be possible to keep the true date and those sites would load normally.(google crashes,too)
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 »

iDG wrote:
hyoenmadan wrote:Seeing the answers, probably the first thing we could do is enable QEMU to load g3beige ROMset via [-bios] QEMU parameter, so we can see how QEMU emulation behaves with it, and check if we can boot older MacOSs with the hardware emulation g3beige already offers.
it's quite trivial to load a 4MB (beige Powermac G3) rom at 0xFFC00000, but it locks up really early during the startup:

0xfff06fdc: lbz r13,32(r12)
0xfff06fe0: rlwinm. r13,r13,0,29,29
0xfff06fe4: beq+ 0xfff06fdc

it's likely trying to do something with some unimplemented hardware.
I tried to load oldworld ROM (for Sheep Shaver) via -bios option,but it fails.Was the ROM wrong?How did you load you ROM?
User avatar
Amiganaut
Student Driver
Posts: 21
Joined: Fri Jul 24, 2009 2:44 pm

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

Post by Amiganaut »

Dunno why I didn't think of disabling the network time check after install... Thanks! Now we can run the PB with networking.

And with the -rtc command I don't have to mess about with the host date anymore :)
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:I tried to install 10.3 and also failed. The problem seems to be in the openbios file. As suggested earlier in this thread, use this one: https://www.ilande.co.uk/tmp/openbios/openbios-ppc-rtas
With that openbios, my installation succeeded.

Best,
Cat_7
Well, I tried a config with this BIOS, a 6GB hard disk image, 256MB of RAM and a G3 processor with the mac99 machine. I also made sure to only install the components that are absolutely required. Now, the install proceeds fine, but the emulated Mac stays forever at this screen:

Image

Maybe I'll just wait for a newer build. On a brighter note, though, I have managed to get and install the Public Beta and the 10.0.2 update successfully.

Image

Image
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 »

Hmm... I finally got to building OpenBIOS. Good news: it builds fine :)

Bad news: having difficulty figuring out what to modify to get 1280x720 resolution -- mmolvideo.c hints at it, but I haven't quite figured it out yet. The vga and video files don't appear to have a hard-coded list of resolutions in them, and yet OS X presents such a list. Without the VGA compiled in, the OpenBIOS values get passed right to the OS, which indicates that these aren't getting passed to the VGA driver, but I can't figure out what's going on in there that's preventing it. Anyone have an idea here?

[edit] Well, I found the place to edit the default 800x600x8 value for the Windows build -- it's in the ppc config xml file.

Maybe I need to edit the OS X EFI values, not the qemu OpenBIOS? That's how Clover and friends work.
User avatar
Cat_7
Expert User
Posts: 5019
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 »

Take a look at the vga driver source....

https://github.com/ozbenh/QemuMacDriver ... /QemuVga.c

Best,
Cat_7
kataetheweirdo
Apple Corer
Posts: 285
Joined: Sun Feb 01, 2009 4:55 pm

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

Post by kataetheweirdo »

I can confirm a regression in the mouse control between QEMU 2.7.0 rc5 (built by Stefan) and QEMU 2.8-devel (built by Cat7). The mouse is harder to control in fullscreen, particularly when the user is trying to click and drag on an anything, including a window for the OS.

In this case, I am using Mac OS 9.2.2 with 64-bit Windows builds of QEMU. I am using an old laptop (>5 years old) with 64-bit Windows 10.

Trying to resize a windows in QEMU 2.8-devel is very difficult. Normally, in Mac OS 9.2.2, you can resize a Finder window by dragging its bottom-left corner. However, doing so in QEMU 2.8-devel jerks the mouse all over the screen (possibly because of CUDA or the PMU). The mouse seems to have this tendency of trying to move to the corners. I'll definitely have to get a QEMU environment set up to test this out.

By contrast, QEMU 2.7.0 rc5 allows me to set the size windows by dragging along the bottom-left corner of a windows.

Setting the mouse speed with the mouse control panel does not affect this either.

In neither build does the mouse work correctly when windowed in either GTK or SDL.

I suspect this could also do with the refresh rate in QEMU, although I don't see any parameters that allow me to set this.

EDIT: Yes, the mouse does act dysfunctional in windowed mode, regardless of the command line arguments, in both versions.

Here's the command prompt used for 2.7.0 rc5:

Code: Select all

qemu-system-ppcw -bios openbios-ppc-rtas -boot c -drive file=testimg.img,index=0,media=disk,format=raw -M mac99 -m 256 -prom-env 'auto-boot?=true' -g 800x600x32 -net none -usb -device usb-mouse -sdl
Here's the command prompt used for 2.8-devel:

Code: Select all

qemu-system-ppc-wip -L pc-bios -bios openbios-ppc-rtas -boot c -drive file=testimg.img,index=0,media=disk,format=raw -M mac99 -m 256 -prom-env 'auto-boot?=true' -g 800x600x32 -net none -usb -device usb-mouse -sdl
EDIT 2:I changed the speed of my mouse pointer to the slowest possible speed and to the fastest possible speed and that did not affect QEMU either. So, it definitely is not my mouse either.

On another note, I also changed my OpenBIOS build to the July 19, 2016 and July 31, 2016 version, which exhibit the broken dragging in 2.8-devel. However, the mouse behavior is corrected by the August 13, 2016 build of OpenBIOS in 2.8. This still leaves the problem of writing to the hard drive in Mac OS 9 with the August 13, 2016 build. However, even the July 31, 2016 build of OpenBIOS has problems trying to apply the language kit installations.
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 »

Cat_7 wrote:Take a look at the vga driver source....

https://github.com/ozbenh/QemuMacDriver ... /QemuVga.c

Best,
Cat_7
Heh... my first reaction was "Great! That's an easy fix!" Which I promptly made.

Then I looked at the IDE file... CodeWarrior 5 !?!? I guess I could try and dig out my copy of CodeWarrior, but that's an XML file, and I don't recall my copy of CodeWarrior 10 using XML -- which means this must be something more recent.

Is there a compatible linker and library set somewhere for this, or would I be better off just to edit the compiled object to hack in alternate resolutions?

[edit] I cheated and opened it up in a hex editor... the resolution values are right at the end, after Video Params, written in hex. There's 7 pairs, followed by the null pair. I might experiment and see if I can add in extras before the null pair, but for now it's just modifying the 7 values to the ones I want.
User avatar
Cat_7
Expert User
Posts: 5019
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 »

Then I looked at the IDE file... CodeWarrior 5 !?!? I guess I could try and dig out my copy of CodeWarrior, but that's an XML file, and I don't recall my copy of CodeWarrior 10 using XML -- which means this must be something more recent.
Ben Herrenschmidt will get his builds included in the qemu source as a submodule. And now you know why. If I recall correctly from the discussion on the board, he currently builds the vga driver in Mac OS, not OSX ;-) But that might change, seeing this:
http://lists.nongnu.org/archive/html/qe ... 00024.html

Best,
Cat_7
User avatar
Cat_7
Expert User
Posts: 5019
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 »

On another note, I also changed my OpenBIOS build to the July 19, 2016 and July 31, 2016 version, which exhibit the broken dragging in 2.8-devel. However, the mouse behavior is corrected by the August 13, 2016 build of OpenBIOS in 2.8. This still leaves the problem of writing to the hard drive in Mac OS 9 with the August 13, 2016 build. However, even the July 31, 2016 build of OpenBIOS has problems trying to apply the language kit installations.
I have had mouse/initialisation/installation problems with all windows builds, including all 2.7 rcX builds by stefan weil. I built a Windows binary using SDL2 , but that worsens the mouse problems no end...
I'll definitely have to get a QEMU environment set up to test this out.
The following is based on this page: http://wiki.qemu.org/Hosts/W32#Fedora_b ... s_builds_2

It is actually quite easy to install a cross-compiler environment. I use Fedora 24 64 bit in VirtualBox. After a clean install, install the following packages to compile 64 bit windows versions:
dnf install python
dnf install mingw64-pixman
dnf install mingw64-glib2
dnf install mingw64-gmp
dnf install mingw64-SDL
dnf install mingw64-pkg-config

Make this into a script:
git clone https://github.com/qemu/qemu qemu-master
cd qemu-master
git submodule update --init dtc
./configure --cross-prefix=x86_64-w64-mingw32- --target-list="ppc-softmmu" --enable-sdl --with-sdlabi=1.2
make
strip ./ppc-softmmu/qemu-system-ppc.exe
strip ./qemu-img.exe

Next, copy all of the following into a single folder:
qemu-system-ppc.exe
qemu-img.exe
The pc-bios folder
All dll's from /usr/x86_64-w64-mingw32/sys-root/mingw/bin/

Move the folder to Windows, and there you go!

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

Heh, just thinking out loud.. I don't get all the fuss aboud Old World ROMs copyrights. Sure, they are copyrighted, but who cares? It was abandoned a long time ago, it is abandonware. As long as the ROMs are not in the codebase of the project, are not automatically downloaded or somehow copied into the software, nobody is breaching any kind of legal agreement. We've been using it with other emulators for ages now and Apple never gives a flying f###. I think if there is a way to use copyrighted ROMs, this way should be considered. Even if the ROM was used in the source of the emulator, I don't think Apple could be successful demanding millions in court for computers out of use for 20 years or more.

If that's an engineering obstacle, then, by all means, let's discuss a better solution, but if it is not, being copyrighted should not be the point.
User avatar
Amiganaut
Student Driver
Posts: 21
Joined: Fri Jul 24, 2009 2:44 pm

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

Post by Amiganaut »

As a followup on the Public Beta, I wanted to run the few WWDC builds I have in QEMU as well.

10.2 - 10.3 - 10.4 - 10.5

And a bonus shot playing around with the scalable UI in Tiger. On a real Mac this works in real-time, but in QEMU I have to reboot for the change to take effect. Presumably due of the lack of video acceleration. This build also runs very slow compared to the others.

Dreaming a bit here, but when QEMU gets sound, will it be possible to specify the input and output devices? It would nice if it could be used to run old music software and possibly have the audio (and maybe even MIDI?) piped into a modern DAW. For example, running something like Rebirth in a QEMU-ed OS9 and having the audio routed into Logic, Cubase etc via Soundflower. OS X could send MIDI data over and back via IAC to control the emulated software from the host. I'm not sure what the latency would be like though.
hyoenmadan
Student Driver
Posts: 11
Joined: Sun Jul 31, 2016 2:55 am

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

Post by hyoenmadan »

sentient06 wrote:Heh, just thinking out loud.. I don't get all the fuss aboud Old World ROMs copyrights. Sure, they are copyrighted, but who cares? It was abandoned a long time ago, it is abandonware. As long as the ROMs are not in the codebase of the project, are not automatically downloaded or somehow copied into the software, nobody is breaching any kind of legal agreement. We've been using it with other emulators for ages now and Apple never gives a flying f###. I think if there is a way to use copyrighted ROMs, this way should be considered. Even if the ROM was used in the source of the emulator, I don't think Apple could be successful demanding millions in court for computers out of use for 20 years or more.

If that's an engineering obstacle, then, by all means, let's discuss a better solution, but if it is not, being copyrighted should not be the point.
Isn't about us here, being copyrightnazis or such. Is about QEMU and Apple. QEMU isn't like the other emulators or MAME/MESS. They actually have strict rules about their emulated hardware targets requiring copyrighted code to even initialize, let alone boot. Doesn't help a lot that actually QEMU is part of commercial projects and drives actually the core of many commercial VM solutions. Sure, you can fork and do your own work outside moding the code for your needs, but you really don't want to do that in this case, because mac99 and g3beige are still targets in development.

The other side is that Apple actually can be as Nintendo with relation to their copyrighted works if you annoy them enough, or they think you are doing them a sort of damage. Sure, Apple doesn't care about niche emulators and fan communities, but this could change if this sort of resource appears in a widespread product like QEMU, which actually has commercial VM solutions based on it.
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 managed to have a copy of the Jaguar WWDC build lying around, so I tried to upgrade my 10.1 copy to it, and this is what happened:

Image

This is with the mac99 machine, 256MB RAM, G3 processor and with all the OpenBIOS builds available in this post (also the one that came in the Windows version's zip file):

http://www.emaculation.com/forum/viewto ... 848#p52104

Any help here?

Trying to boot in safe mode, verbose mode, single-user mode or any combination of the three does not help, either.
User avatar
Amiganaut
Student Driver
Posts: 21
Joined: Fri Jul 24, 2009 2:44 pm

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

Post by Amiganaut »

What happens if you do a clean install rather than upgrade? I clean installed all mine without a hitch, but I'm using the OS X build.
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 »

Cat_7 wrote:
Then I looked at the IDE file... CodeWarrior 5 !?!? I guess I could try and dig out my copy of CodeWarrior, but that's an XML file, and I don't recall my copy of CodeWarrior 10 using XML -- which means this must be something more recent.
Ben Herrenschmidt will get his builds included in the qemu source as a submodule. And now you know why. If I recall correctly from the discussion on the board, he currently builds the vga driver in Mac OS, not OSX ;-) But that might change, seeing this:
http://lists.nongnu.org/archive/html/qe ... 00024.html

Best,
Cat_7
Hmm... I need to get on the mailing list I think. What that points to is that Paul Pratt had it right all along; we need to get the build chain for this into Mini vMac, which is designed with MPW in mind. At that point, as long as you have some ROM image from a classic Mac (and System 7.5.5 and MPW), you've got an app that'll run on pretty much anything and can build and link the source.

That said, the format doesn't look too complex; we could probably compile the code to objects and write a linker in Python.
Post Reply