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
adespoton
Forum All-Star
Posts: 3240
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 »

For both Mark and Steven: it seems to me that a panic patch could help to batch index potential issues if it is replaced with a debug print statement instead of a NOP -- we'd get to see all the conditions that *could* cause a panic that don't actually bring down the OS, which would provide in-depth parsing of what the OS expects to see. DP1 is a good place to do this actually, as resolving the issues in DP1 should also resolve them for 9.0.4 and possibly even 8.6. Rhapsody, of course, still needs actual interface drivers that work, which means a deep dive into what it expects (which the kernel panic->debug patch could also streamline, instead of having to go one signal at a time).

Thoughts?
steventroughtonsmith
Student Driver
Posts: 20
Joined: Fri Jan 06, 2017 10:02 pm

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

Post by steventroughtonsmith »

adespoton wrote:If we can trace what devices it is looking for in the tree, we can set up dummy devices in OpenBIOS -- if your panic patch works, then that indicates this should also work, and should even be doable via an OF line or two. So the next task is to find and document what OF devices the kernel is polling :) As we find them, we can just add them in as OF command-line arguments until we're sure we've covered all bases, and then move the entire dummy tree into OpenBIOS -- with appropriate mappings to virtual devices in qemu if possible.
I do have a working OF patch for Rhapsody 5.3+ (Server 1.0), but I've been chainloading things with a custom BootX rather than booting the disc on its own so far so I wasn't gonna post here.
dev /pci/mac-io
new-device " mesh" device-name finish-device
dev /pci/mac-io/mesh
" mesh" encode-string " name" property
" chrp,mesh0" encode-string " compatible" property
0 encode-int " reg" property

dev /pci/mac-io
new-device " sound" device-name finish-device
dev /pci/mac-io/sound
" sound" encode-string " device_type" property
0 encode-int " reg" property

dev /pci/mac-io
new-device " floppy" device-name finish-device
dev /pci/mac-io/floppy
" floppy" encode-string " AAPL,connector" property
0 encode-int " reg" property
This is enough to boot to userland.

For Rhapsody DR2 I'm still investigating—it can be spoofed enough to get to mach by appending this, but the spoofed cuda device will halt the boot process, so I don't think that's gonna work. I assume that will need more work at the qemu side, or maybe even a different hardware target.
dev /pci/mac-io
new-device " dbdma" device-name finish-device
dev /pci/mac-io/dbdma
" dbdma" encode-string " device_type" property
" dbdma" encode-string " name" property
0 encode-int " reg" property
0 encode-int " AAPL,address" property
0 encode-int " assigned-addresses" property

dev /pci/mac-io
new-device " cuda" device-name finish-device
dev /pci/mac-io/cuda
" cuda" encode-string " device_type" property
0 encode-int " reg" property
mcayland wrote:@steventroughtonsmith: have just been catching up on your posts (and Twitter feed!) to see the work you have been doing - amazing!

As OpenBIOS maintainer can I encourage you to submit your patches to the OpenBIOS mailing list with appropriate SoBs so we can try and upstream your work? :)
The only openbios patch I've needed so far is commenting out the one line in the above post—apparently OF on real Macs never checked if a partition had valid status flags, and just let BootX boot from it anyway if manually specified. I don't know the implications of changing this in OpenBIOS for other targets, though? It's a very trivial change to make.
steventroughtonsmith
Student Driver
Posts: 20
Joined: Fri Jan 06, 2017 10:02 pm

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

Post by steventroughtonsmith »

adespoton wrote:For both Mark and Steven: it seems to me that a panic patch could help to batch index potential issues if it is replaced with a debug print statement instead of a NOP -- we'd get to see all the conditions that *could* cause a panic that don't actually bring down the OS, which would provide in-depth parsing of what the OS expects to see. DP1 is a good place to do this actually, as resolving the issues in DP1 should also resolve them for 9.0.4 and possibly even 8.6. Rhapsody, of course, still needs actual interface drivers that work, which means a deep dive into what it expects (which the kernel panic->debug patch could also streamline, instead of having to go one signal at a time).

Thoughts?
Worth noting that you can dump qemu's ram from the monitor and find the panic string pretty easily, even without serial or video output. For Server 1.0, it was `pmemsave 2387272 256 panic.txt`, but you can dump the entire ram's contents and grep for "panic:" if you don't know the offset. For debugging, that's super handy
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 »

alex195812 wrote:This is for use with qemu version I posted Jan 03 instead of included openbios.

Well,I thought as IMO qemu itself is OK,no need to wait till openbios is fixed and here is a version with more extended cocoa3 ui:
https://drive.google.com/open?id=0B69bs ... jZxRkROeVU
For booting/installing OS 9.0 openbios-wip version(w/o screamer) may be used.Maybe someday I'll see how to resolve resource conflict between screamer and vga or someone smarter will pay attention to it...

For @ProgrammingKid Some new warnings appear while building:

Code: Select all

ui/cocoa.m:1612:9: warning: 'NSRunAlertPanel' is deprecated: first deprecated in OS X 10.10 - Use
      NSAlert instead [-Wdeprecated-declarations]
        NSRunAlertPanel(@"Alert", @"No real optical media found.", @"OK", nil, nil);
        ^
/System/Library/Frameworks/AppKit.framework/Headers/NSPanel.h:48:25: note: 'NSRunAlertPanel' has
      been explicitly marked deprecated here
APPKIT_EXTERN NSInteger NSRunAlertPanel(NSString *title, NSString *msgFormat, NSString *defa...
                        ^
ui/cocoa.m:1734:24: warning: sending 'id<NSFileManagerDelegate>' to parameter of incompatible type
      'id<NSMenuDelegate>'
    [menu setDelegate: [NSApp delegate]];
                       ^~~~~~~~~~~~~~~~
/System/Library/Frameworks/AppKit.framework/Headers/NSMenu.h:147:39: note: passing argument to
      parameter 'delegate' here
@property (assign) id<NSMenuDelegate> delegate;
                                      ^
ui/cocoa.m:1818:24: warning: sending 'QemuCocoaAppController *' to parameter of incompatible type
      'id<NSFileManagerDelegate>'
    [NSApp setDelegate:appController];
                       ^~~~~~~~~~~~~
/System/Library/Frameworks/Foundation.framework/Headers/NSFileManager.h:109:47: note: passing
      argument to parameter 'delegate' here
@property (assign) id <NSFileManagerDelegate> delegate NS_AVAILABLE(10_5, 2_0);
Mouse/keyboard seem to work correctly when switchig fullscreen/windowed modes(Tried in Panther).Thank you for your work! :smile:
Glad to see that stuck key issue that was with us for so long is finally conquered. I think it is now time for me to download Mac OS 10.12 and make a new cocoa.m file.
User avatar
Madd the Sane
Student Driver
Posts: 11
Joined: Fri Aug 31, 2012 6:27 pm
Location: Utah

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

Post by Madd the Sane »

The NSRunAlertPanel deprecations can be replaced with creating an NSAlert object and setting the variables, then calling -[NSAlert runModal].

Code: Select all

[menu setDelegate: [NSApp delegate]]
can be replaced with

Code: Select all

[menu setDelegate: (QemuCocoaAppController*)[NSApp delegate]];
Also, my fork: https://github.com/MaddTheSane/qemu/tree/maddsScreamer
Get out of my mind, idea! I already have an idea in there!
User avatar
Meow_2004
Granny Smith
Posts: 108
Joined: Thu Jan 05, 2017 6:24 pm

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

Post by Meow_2004 »

Is there any way where I can get a code to launch DP3 in qemu? That would be awesome!
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 »

Do you mean the command line? If so see http://www.emaculation.com/forum/viewto ... &start=850 and some later posts.Be attentive :smile: .There's something about windows builds,too.Makes sense also to watch all the posts since end of July on.It is important to specify "-prom-env 'auto-boot?=false'" on command line and next,in openbios,"boot cd:9,\\:tbxi".The rest should be simple.
User avatar
Meow_2004
Granny Smith
Posts: 108
Joined: Thu Jan 05, 2017 6:24 pm

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

Post by Meow_2004 »

I'm still a bit confused, I'm a qemu beginner, and I don't know much for qemu, which build would be best for DP3? and how can I boot it up?
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 »

I don't use qemu in Windows myself but I think the build at the page linked in my previous post will do.It's not an official one.Qemu official is still unable to do DP3.Download,unzip,open cmd.exe,cd to unzipped folder.See the posts at that page(and previous pages) to know the command line suitable,how to create a disk image and so on.Of course you need the installation cd image.See macintoshgarden.org to find it.Read the forum,try,search,google(Mac OS X 10.0. DP3 in qemu on Windows).Use qemu --help in cmd.exe to see some tips on qemu usage.It takes some time to get used to all that.
User avatar
Meow_2004
Granny Smith
Posts: 108
Joined: Thu Jan 05, 2017 6:24 pm

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

Post by Meow_2004 »

(sorry if i'm being picky) But i'm still confused, maybe if someone posted a code, i'll try it out in the command prompt where everything is located (using the cd command) then i'll use that code, and hopefully, it will boot up :) :smile:

EDIT: I think I used the 64-bit qemu download from here by the way.

This is the code I will do for cd: (cd C:/Users/**********/Desktop/*****'s-Stuff/Mac/OSX/Developer-Previews/3, then I will do the qemu code provided.

*=Full name/Name, hidden due to not showing true identity, (Safety reasons).
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 »

No,you should cd(cd or chdir is for "Change directory") to the folder where qemu is located and start from there.The command line should be adapted to your system(paths to installation cd image and disk image should be correct).You're almost there :smile: .Use /? or help in cmd.exe to know more about commands used in cmd.exe.
User avatar
Meow_2004
Granny Smith
Posts: 108
Joined: Thu Jan 05, 2017 6:24 pm

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

Post by Meow_2004 »

Ok! I will move qemu (Copy) to where the ISO is.
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 »

Meow_2004 wrote:Ok! I will move qemu (Copy) to where the ISO is.
You don't want to do that. qemu-system-ppc needs other files in order to function. These files are usually located in the pc-bios folder. It would be best to just 'cd' to the folder where qemu-system-ppc is, then try to run it by typing out its command to run, then by dragging the ISO file onto the command prompt window. The ISO's full path should be added to the command.

So you start out like this:
cd qemu * assume your qemu folder is just called qemu
qemu-system-ppc.exe -M mac99 -m 512 -boot d -cdrom

Then drag the ISO file onto the command prompt and the fully path of the file will come after the -cdrom option.

Feel free to alter the above command to add other hardware and options.
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 »

I just went to the Macintosh Garden website and was impressed by the amount of software they have available for free. One question, how are they not sued by the makers of the software they give away for free? I'm amazed Apple hasn't come after them yet.
uyjulian
Apple Corer
Posts: 241
Joined: Fri Aug 27, 2010 1:02 am

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

Post by uyjulian »

Programmingkid wrote:I just went to the Macintosh Garden website and was impressed by the amount of software they have available for free. One question, how are they not sued by the makers of the software they give away for free? I'm amazed Apple hasn't come after them yet.
EA has come after them before, so they removed all the links to EA software.
ShadowMyst
Space Cadet
Posts: 8
Joined: Wed Dec 28, 2016 9:26 pm

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

Post by ShadowMyst »

Programmingkid wrote:I just went to the Macintosh Garden website and was impressed by the amount of software they have available for free. One question, how are they not sued by the makers of the software they give away for free? I'm amazed Apple hasn't come after them yet.
The majority of the software has either reached an age where they fall into the grey area of abandonware, or they received permission from the author to release the software. Presumably, either Apple doesn't care now that Jobs has passed on or they don't know. Considering the source code for GS/OS was released and we now have 6.0.2 and 6.0.3 without Apple having a fit... it's probably the first option.

Also keep in mind that the Garden doesn't host the majority of the software due to bandwidth concerns, that alone makes it difficult.
julialy wrote: EA has come after them before, so they removed all the links to EA software.
Not all of the EA software has been removed. They basically went through and determined which ones EA has a legal claim to and pulled only those.
User avatar
Meow_2004
Granny Smith
Posts: 108
Joined: Thu Jan 05, 2017 6:24 pm

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

Post by Meow_2004 »

Tried to look at the forums but I still can't figure it out. I have the iso, but i still can't get it. Please help! :cry: :oops:
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 »

Your problem is that you don't understand using command prompt(cmd.exe) in Windows and that's why you misunderstand what we say.Watch this:
https://www.youtube.com/watch?v=CrAflgXyX4U or this: https://www.youtube.com/watch?v=L3xxy_kQCdQ ,read this: https://www.google.ru/url?sa=t&rct=j&q= ... FeL6SB9awn . When you get used to,everything appears simple.
User avatar
Meow_2004
Granny Smith
Posts: 108
Joined: Thu Jan 05, 2017 6:24 pm

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

Post by Meow_2004 »

I do understand how to use cmd, it's the qemu command that's confusing. (sorry if i'm sounding like a little kid)

What i mean is that i don't understand the qemu command, not the original windows commnds
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 »

Sorry,but you're wrong :smile: .You definitely misunderstand "cd" command,and it is not a qemu but a cmd command."cd" is not "cdrom" but "change directory".That is "get inside a folder".Just type "cd /?" in cmd and see.And to start qemu you should "cd" to the original folder where qemu is(I don't know its path in your system,you can just drag the folder with mouse and drop it into cmd window ).That is,you type:"cd <qemu folder path>" first.And next you do what ProgrammingKid wrote above(exactly that!).
And,by the way,no need to be shy about your age.It's OK.
User avatar
Meow_2004
Granny Smith
Posts: 108
Joined: Thu Jan 05, 2017 6:24 pm

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

Post by Meow_2004 »

My command:

cd C:/Program Files/qemu

C:/Program Files/qemu: qemu-ppc-system.exe -M mac99 -m 512 -boot d -cdrom C:/Program Files/qemu/DP3.iso ???

?=I don't know what other parts I need to put into it.
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 »

In Windows it must be C:\Program Files\qemu and similar for iso. / is used in Unix systems, \ in Windows.You also need -bios <your openbis>.elf and -prom-env "auto-boot?=false'.Your openbios file must be in qemu folder.When qemu starts, type boot cd:9,\\:tbxi.If C:\Program Files\qemu is just that, unzipped from download,it should work.That is,the whole procedure is:
cd C:\Program Files\qemu
qemu-system-ppc -M mac99 -m 512 -bios <your openbios>.elf -cdrom C:\Program Files\qemu\DP3.iso -prom-env 'auto-boot?=false'
And next,in qemu window: boot cd:9,\\:tbxi
This should be enough for beginning.If you want verbose boot add -prom-env 'boot-args=-v" to qemu command line.
See also http://www.emaculation.com/forum/viewto ... =34&t=9028 about running qemu in Windows 10.It may be important.
Hope you'll get what you want at last :smile: .Good luck!
User avatar
Meow_2004
Granny Smith
Posts: 108
Joined: Thu Jan 05, 2017 6:24 pm

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

Post by Meow_2004 »

Thanks for the tip! should I add cpu -G3 so it detects that it's a G3 Computer?
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 »

Yes,it is even necessary.I've forgotten to mention that.Public Beta and higher versions work with G4.(G4 emulation in qemu is currenty better).
Does it start?
User avatar
Meow_2004
Granny Smith
Posts: 108
Joined: Thu Jan 05, 2017 6:24 pm

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

Post by Meow_2004 »

I haven tried it out yet, I will try it tomorrow and I will say if it works.
Post Reply