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

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 »

Cat_7 wrote:You got the correct openbios?

best,
Cat_7
I am using the one that came with the repo. I am hoping that has all the patches needed.
User avatar
Cat_7
Expert User
Posts: 6172
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 »

Nope, use the one I posted last, with the startup folder fix.

http://www.open.ou.nl/hsp/downloads3/op ... er.elf.zip

Best,
Cat_7
User avatar
adespoton
Forum All-Star
Posts: 4279
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 »

Ta Da!

Image

Here's the drop-in replacement qemu_vga.ndrv for use with builds from this thread.

Here's the entire source, with project files for CW7.
Last edited by adespoton on Fri Sep 16, 2016 4:00 pm, edited 1 time in total.
User avatar
sentient06
Mac Mechanic
Posts: 188
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 »

:shock:

So, only the sound and the OT stuff are missing for OS9.2 on QEMU at the moment?

Sorry, I lost track of it for some time now.

Maybe we should have a "news" page with the stuff done and stuff missing? That google docs sheet must be outdated. :cry:

My point is: I miss some sort of filter in this topic, there's simply too much information.
User avatar
sentient06
Mac Mechanic
Posts: 188
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:That... might be a bit much.
If it is hard-coded, is never too much. I remember moving some Windows games into Wine wrappers to play on my mac and several times I had to use some dodgy program to edit the games binaries because they were done a long time ago for small 4:3 resolutions and I have wide screen. Since most part of time we either have no access to the code to compile a new option or the code is lost, I reckon it is always better to cover all possible options. :smile:

I think we should have all powers of two starting from 2**9 to 2**15 for width and 2**(9-1) to 2**(15-1) for height in different combinations. Well, that list would be huge, perhaps a list of most used resolutions is better. =D

The big ones are interesting to have, so people will keep using in the future.

https://en.wikipedia.org/wiki/List_of_c ... esolutions
Last edited by sentient06 on Fri Sep 16, 2016 4:00 pm, edited 1 time in total.
User avatar
adespoton
Forum All-Star
Posts: 4279
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 »

The VGA and networking bits are implemented, but not checked in yet. Sound is possible through usbaudio, but is crash prone, and extremely choppy, likely due to very (very) slow FPU emulation. USB passthrough is available on Linux only. mac99p hardware profile (needed for booting 10.5) is also not committed to trunk yet.

Creating a hardware profile that will boot pre-9.0.4 hardware is still in the discussion phase.

Did I miss anything?

And yes... both the spreadsheet and qemu-ppc wiki page are out of date, due to development and testing going faster than we can easily keep up. Since most of this stuff isn't officially available yet (it's all for the 2.8 and 2.9 builds, 2.7 just got officially released), it's easier to track against the official builds so that someone doesn't run a WIP build thinking everything is fully emulated, only to find that their HD image gets totally corrupted and their house burns down when they use one of the new features.
User avatar
Cat_7
Expert User
Posts: 6172
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 »

Yep,

Keeping track of a fast-moving target with an unpredictable trajectory is difficult.
Perhaps I should create a topic with only builds from "current" source for OSX/Windows and one for the bleeding edge.

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

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

Post by sidoh »

https://imgur.com/a/kTNuQ

I'm impressed with the new driver. All of my OS's work like a charm in 1920x1080 now.
User avatar
adespoton
Forum All-Star
Posts: 4279
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:Yep,

Keeping track of a fast-moving target with an unpredictable trajectory is difficult.
Perhaps I should create a topic with only builds from "current" source for OSX/Windows and one for the bleeding edge.

Best,
Cat_7
That's a good idea; then we could move a lot of the bleeding edge development discussion out of this thread, as we've left the 2015 GSOC far behind at this point, and people could discuss issues with the stable builds in a thread about stable builds.
User avatar
sentient06
Mac Mechanic
Posts: 188
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:... it's easier to track against the official builds so that someone doesn't run a WIP build thinking everything is fully emulated, only to find that their HD image gets totally corrupted and their house burns down when they use one of the new features.
Wow, that's some violent programming!

Thanks for the update adespoton, truly enlightening. (no pun with the house on fire intended)

This is really exciting though, emulating Mac OS 9.2, imagine that being said 5 years ago. And updates have been faster than my wildest dreams. We should celebrate. :mrgreen:
User avatar
adespoton
Forum All-Star
Posts: 4279
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 »

Interestingly, I think it has been just over 5 years since the initial GSOC foray into doing this :) Where we're at today wouldn't have happened without a lot of hard work over the past five years on getting the hardware emulation improved. I think our collective understanding of what's going on under the hood has improved too :)
User avatar
that-ben
Granny Smith
Posts: 141
Joined: Tue Nov 10, 2015 7:50 pm

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

Post by that-ben »

Programmingkid wrote:
Every common resolution to 8k! https://en.wikipedia.org/wiki/List_of_c ... esolutions

Ok, I came up with my own list of 20 resolutions. Let me know what you think.

640x400
640x480
800x600
1024x600
1024x640
1152x864

[...]
WTF? 1024x768 was probably the single most used resolution on PPC Macs for almost a decade and it's not part of the top 20? Is that a typo you made or am I am having a nightmare? :P
User avatar
adespoton
Forum All-Star
Posts: 4279
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 »

Not sure which, but if you see my screen capture and compare it to his list, you'll see he listed the ones we needed to add to the existing list, and that's what I did :) There's a few other ?GA-standard ones not in his list, and those were the ones originally in the VGA module.
User avatar
that-ben
Granny Smith
Posts: 141
Joined: Tue Nov 10, 2015 7:50 pm

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

Post by that-ben »

Yes I saw that afterwards, it wasn't clear if 1024x768 was forgotten in the list or if it's because it's already there and didn't need to be mentioned! :D I panic'ed! :)
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 »

that-ben wrote:Yes I saw that afterwards, it wasn't clear if 1024x768 was forgotten in the list or if it's because it's already there and didn't need to be mentioned! :D I panic'ed! :)
Sorry, I forgot that one. Here is my "official" :wink: list of resolutions again.

512x342 <---------------------------------------------
640x400 <----
640x480 <----
800x600 <---- What I consider the game resolutions
1024x640 <----
1024x768 <---------------------------------------------
1152x864
1200x700 <---- My favorite for working in both the host and guest
1280x720
1280x768
1280x800
1366x768 <---- causes screen corruption in Mac OS X - might remove
1440x900
1920x1200
2304x1440
2560x1080
2560x1600
2880x1800
4096x2304 <--- 4K
8192x4608 <--- 8K

I'm trying to keep the list to at most 20 so the user can actually see all the options when clicking on the control strip. I removed the 1024x600 and 4096x3072 resolutions because it didn't seem too interesting.

After talking to Ben and showing him the list, he didn't seem to interested in doing any work on the VGA driver any time soon. Maybe he might find some free time soon.

I am currently working on the feature that would allow the user to add resolutions via the command-line. Like this: -prom-env resolutions=500x400,800x700,16000x9000

If anyone is interested in seeing the work in progress, just let me know and I will post it.
User avatar
adespoton
Forum All-Star
Posts: 4279
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've updated my links above; removed a few resolutions that seemed extraneous, and changed a couple of values that were slightly off. New list should fit everyone's requirements.
User avatar
that-ben
Granny Smith
Posts: 141
Joined: Tue Nov 10, 2015 7:50 pm

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

Post by that-ben »

Programmingkid wrote: I am currently working on the feature that would allow the user to add resolutions via the command-line. Like this: -prom-env resolutions=500x400,800x700,16000x9000

If anyone is interested in seeing the work in progress, just let me know and I will post it.
**14K** resolution on Mac OS 9?! HELL YES I'm interested in seeing this WIP. WTF?!

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

that-ben wrote:
Programmingkid wrote: I am currently working on the feature that would allow the user to add resolutions via the command-line. Like this: -prom-env resolutions=500x400,800x700,16000x9000

If anyone is interested in seeing the work in progress, just let me know and I will post it.
**14K** resolution on Mac OS 9?! HELL YES I'm interested in seeing this WIP. WTF?!

JK
Here is the code. It is compiled under CodeWarriors 7.1 in Mac OS 9. This code will not work in the classic environment.

Code: Select all

/*
	Try to read a property from the Name Registery
	See: Designing PCI Cards and Drivers for Power Macintosh Computers
*/

#include <stdio.h>
#include <stdlib.h>
#include <NameRegistry.h>
#include <MacTypes.h>

int main(void)
{	
	RegEntryID *entry_id;
	OSErr err;
	Boolean is_done;
	void *value;
	RegPropertyValueSize property_size;
	int index;
	
	//#define PROPERTY_NAME "resolutions"
	#define PROPERTY_NAME "bootpath"
	#define NODE_PATH "Devices:device-tree:chosen"

	/* init the entry variable */
	err = RegistryEntryIDInit(entry_id);
	if (err != noErr) {
		printf("Error: Failed to init entry variable! (%d)\n", err);
		return err;
	}
	is_done = false;

	/* Get the entry ID value */
	err = RegistryCStrEntryLookup(NULL /* start root */, NODE_PATH, entry_id); 
	if (err != noErr) {
		printf("RegistryCStrEntryLookup() failure (%d)\n", err);
		return err;
	}
	
	/* Print all the fields in the entry_id variable */
	for(index = 0; index < 4; index++) {
		printf("Entry ID's for chosen = %d\n", entry_id->contents[index]);
	}
	
	/* Get the size of the property */
	err = RegistryPropertyGetSize(entry_id, PROPERTY_NAME, &property_size);
	if (err != noErr) {
		printf("Error: Failed to get property size! (%d)\n", err);
		return err;
	}
	printf("property size = %d\n", property_size);
	
	/* allocate memory to the value variable */
	value = (void *) malloc(property_size);
	
	/* Get the value of the property */
	err = RegistryPropertyGet(entry_id, PROPERTY_NAME, value, &property_size);
	if (err != noErr) {
		printf("Error: Failed to find property value %s!\n", PROPERTY_NAME);
		return err;
	}

	/*	
	if (is_done == false) {
		printf("Warning: search might not have finished\n");
	} */
	
	/* print the value of the property */
	printf("value = %s\n", (char*)value);
	
	return 0;
}
The full path of the boot device is displayed when it is ran.

This pdf was very informative and would help anyone interested in working on the VGA driver:
https://developer.apple.com/legacy/libr ... rivers.pdf
User avatar
adespoton
Forum All-Star
Posts: 4279
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 »

You know, what we really need to do is move as much as possible out of the VGA driver and into OpenBIOS. If we could re-do the current code so that all values get passed in, and all it's doing is setting up the image for EFI to interface with, then we may never need to compile again.

That said, I like the ability to put everything together from scratch.

How come your code doesn't work with Classic? Is that just because it's pretending to be external hardware?

I obviously need to read the PDF.
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 »

adespoton wrote:You know, what we really need to do is move as much as possible out of the VGA driver and into OpenBIOS. If we could re-do the current code so that all values get passed in, and all it's doing is setting up the image for EFI to interface with, then we may never need to compile again.
I really like that idea. But would Mark like it? There would have to be a property added to some node that stores all the resolutions. Maybe the options node could do.
How come your code doesn't work with Classic? Is that just because it's pretending to be external hardware?
I'm not sure. I do know the classic environment is known to bring about all sorts of software incompatibility.
I obviously need to read the PDF.
It will show you how to make the VGA driver work the way you want it.
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 »

DONE!

Image

The binary file is here: http://www.mediafire.com/download/2zs9o ... u_vga.ndrv

Add these arguments to try it out:
-L pc-bios -prom-env resolutions=512x342,640x400,640x480,800x600,1024x640,1024x768,1152x864,1200x700,1280x720,1280x768,1280x800,1440x900,1920x1200,2304x1440,2560x1080,2560x1600,2880x1800,4096x2304,8192x4608
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 »

Programmingkid wrote:DONE!

Image

The binary file is here: http://www.mediafire.com/download/2zs9o ... u_vga.ndrv

Add these arguments to try it out:
-L pc-bios -prom-env resolutions=512x342,640x400,640x480,800x600,1024x640,1024x768,1152x864,1200x700,1280x720,1280x768,1280x800,1440x900,1920x1200,2304x1440,2560x1080,2560x1600,2880x1800,4096x2304,8192x4608
what changes were needed to qemu and or openbios?
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 »

gtxaspec wrote:
Programmingkid wrote:DONE!

The binary file is here: http://www.mediafire.com/download/2zs9o ... u_vga.ndrv

Add these arguments to try it out:
-L pc-bios -prom-env resolutions=512x342,640x400,640x480,800x600,1024x640,1024x768,1152x864,1200x700,1280x720,1280x768,1280x800,1440x900,1920x1200,2304x1440,2560x1080,2560x1600,2880x1800,4096x2304,8192x4608
what changes were needed to qemu and or openbios?
I used Ben Herrenschmidt's qemu and openbios repos with no changes done to them. The official openbios and QEMU repos still need a few patches applied before they work with the VGA driver.
User avatar
adespoton
Forum All-Star
Posts: 4279
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 »

Wow... that's more than one better than my solution. Now to see if we can make it Classic compatible :)
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 »

Programmingkid wrote:
gtxaspec wrote:
Programmingkid wrote:DONE!

The binary file is here: http://www.mediafire.com/download/2zs9o ... u_vga.ndrv

Add these arguments to try it out:
-L pc-bios -prom-env resolutions=512x342,640x400,640x480,800x600,1024x640,1024x768,1152x864,1200x700,1280x720,1280x768,1280x800,1440x900,1920x1200,2304x1440,2560x1080,2560x1600,2880x1800,4096x2304,8192x4608
what changes were needed to qemu and or openbios?
I used Ben Herrenschmidt's qemu and openbios repos with no changes done to them. The official openbios and QEMU repos still need a few patches applied before they work with the VGA driver.
ha ha!! solid job, lets see if we can roll those changes back to ben and have him upstream to his repo!
Post Reply