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

User avatar
Cat_7
Expert User
Posts: 6557
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 that new vga driver, not using the resolutions argument, I get strange additional entries in the Display list in Tiger:
-1 x -1
0 x 0

Using the resolutions argument with or without quotes
-prom-env 'resolutions=512x342,640x400,640x480,800x600,1024x768,1152x864,1440x900' or
-prom-env resolutions=512x342,640x400,640x480,800x600,1024x768,1152x864,1440x900
they do not seem to get picked up.

Best,
Cat_7
Programmingkid
Apple Corer
Posts: 245
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:With that new vga driver, not using the resolutions argument, I get strange additional entries in the Display list in Tiger:
-1 x -1
0 x 0

Using the resolutions argument with or without quotes
-prom-env 'resolutions=512x342,640x400,640x480,800x600,1024x768,1152x864,1440x900' or
-prom-env resolutions=512x342,640x400,640x480,800x600,1024x768,1152x864,1440x900
they do not seem to get picked up.

Best,
Cat_7
Yeah, I noticed that problem myself. I was a little too eager to share my results. Here is the newest one: http://www.mediafire.com/download/3nwpl ... 82%29.ndrv. Remove the '(2)' from the file name so it is 'qemu_vga.ndrv'.

The 0x0 and -1x-1 resolutions are gone. I also noticed that Mac OS X does not want you to use just any resolution. It only wants you using its officially supported resolutions. :sad: It looks like it would take changes to a kernel extension to add more resolutions.
Last edited by Programmingkid on Sun Sep 18, 2016 2:45 pm, edited 1 time in total.
Programmingkid
Apple Corer
Posts: 245
Joined: Sun Jan 31, 2016 6:01 pm

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

Post by Programmingkid »

adespoton wrote:Wow... that's more than one better than my solution. Now to see if we can make it Classic compatible :)
The only reason to make it compatible in the classic environment is for testing out the driver. Since it is done, this work would be unnecessary.
Programmingkid
Apple Corer
Posts: 245
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:
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!
Thank you very much. Ben has been sent the patch. You can see it here: https://lists.nongnu.org/archive/html/q ... 04054.html
romper
Space Cadet
Posts: 9
Joined: Fri Aug 28, 2015 12:47 am

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

Post by romper »

does anyone know when the network bridge will work under windows for os 9.2.2 ?

also, does anyone have one of the OS 9 versions running under linux ?
User avatar
Cat_7
Expert User
Posts: 6557
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 »

Bridging works with 9.x in windows. Currently you need the wip build to have networking support out of the box with the sungem network device. Using the realtek 8139 device requires you to install the realtek drivers in OS 9.

http://www.emaculation.com/doku.php/ppc ... nd_windows

To run Qemu with OS 9, you need to run a later version of 9.04 for e.g., the cube.
And yes, Qemu runs 9.04 in Linux.

Best,
Cat_7
mcayland
Mac Mechanic
Posts: 155
Joined: Sun Nov 01, 2015 10:33 pm

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

Post by mcayland »

Hi all,

A quick update on where we are with upstream QEMU git master right now:

- David's ppc-for-2.8 branch with Ben's first round of fixes is now merged
- Fix for "Can't find root device" with OS X DPs
- Updated OpenBIOS binaries have been merged with the following:
* CPU context overhaul
* OS X DP fixes: kbd alias, 4+ implementation
* HFS+ startup folder fix
* RTL8139 support (with bus mastering enabled)

Ben's remaining wip patches still need to be tidied up and submitted upstream, however he has been tied up with other things over the past couple of weeks.
romper
Space Cadet
Posts: 9
Joined: Fri Aug 28, 2015 12:47 am

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

Post by romper »

Cat_7 wrote:Bridging works with 9.x in windows.
...
And yes, Qemu runs 9.04 in Linux.
great news on networking and linux support! I see that there is a qemu download for osx and for windows linked from the forum. should linux users use qemu for windows under wine?

once again, big thanks to cat7 and other contributors for keeping this project going!
User avatar
sentient06
Apple Corer
Posts: 250
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 »

I've been thinking about that slow floating point unit mentioned a while ago. Do you know if there's a simple fix for it? I don't know, but it feels like sort of a big deal for an emulator, especially one like QEMU. Is there any work being done there that you gentlemen are aware of?
Programmingkid
Apple Corer
Posts: 245
Joined: Sun Jan 31, 2016 6:01 pm

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

Post by Programmingkid »

sentient06 wrote:I've been thinking about that slow floating point unit mentioned a while ago. Do you know if there's a simple fix for it? I don't know, but it feels like sort of a big deal for an emulator, especially one like QEMU. Is there any work being done there that you gentlemen are aware of?
I have given it a lot of thought. How it is set up now, it goes from PowerPC -> Tiny Code Generator -> x86. This sounds like it would use a whole lot more CPU cycles to execute a single instruction than a PowerPC to x86 translator would use. My idea is to make a PowerPC to C function translator. It would be simple and maybe a lot faster than what we have now - I think.

The PowerPC instruction AND would be implemented like this:

void AND(int *dest_reg, int regA, int regB)
{
*dest_reg = regA & regB;
}

It looks almost too easy to do.

The emulated PowerPC CPU would read an instruction in memory, then use a switch-case structure to to execute the right function.

switch(instruction)
{
case AND:
AND(rD, rA, rB);
break;
}

Maybe a function hash table would be faster... That might be beyond the scope of this discussion ...or it might be what we need to talk about. Don't know.

This is just my guess at how things could be better.
User avatar
adespoton
Forum All-Star
Posts: 4727
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com

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

Post by adespoton »

I was thinking that a function hash table would be the most efficient way to go; all three common compilers can optimize tables like that, although they'd probably optimize a function case statement to the same byte code.
romper
Space Cadet
Posts: 9
Joined: Fri Aug 28, 2015 12:47 am

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

Post by romper »

Can files be shared between the host (windows 10) and OS 9.2.2? thanks
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 »

If anyone's curious, this is as far as you can get with Mac OS X DP1 with QEMU right now:

Image
kataetheweirdo
Master Emulator
Posts: 336
Joined: Sun Feb 01, 2009 4:55 pm

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

Post by kataetheweirdo »

I'm not entirely surprised. Mac99 is equivalent to a PowerMac G4, but I thought it would boot up with g3beige.
kikyoulinux
Tinkerer
Posts: 92
Joined: Sun Sep 28, 2014 11:53 am

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

Post by kikyoulinux »

sidoh wrote:If anyone's curious, this is as far as you can get with Mac OS X DP1 with QEMU right now:

Image
I tried DP2, the iso used a Mac OS 9 to start the installer however it doesn't boot and crash the emulator.
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 »

kataetheweirdo wrote:I'm not entirely surprised. Mac99 is equivalent to a PowerMac G4, but I thought it would boot up with g3beige.
You already know it will not work, because g3beige lacks OldWorld ROM loading, absolutely necessary to boot MacOS in g3beige OldWorld architecture (NewWorld boot isn't possible in OldWorld machines, existent MacOS ROM files don't have any code to support them).
Programmingkid
Apple Corer
Posts: 245
Joined: Sun Jan 31, 2016 6:01 pm

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

Post by Programmingkid »

Possibly found out why my VGA driver does not work under Mac OS X. For some reason the options node in OpenBIOS is not accessible. To see this problem, just open IORegistryExplorer and try to see the options node. When you open the options node, IORegistryExplorer quits immediately.

The options node is located here: IODeviceTree:root:device-tree:options. IORegistryExplorer comes with XCode and Project Builder. It would probably be in the /Developer/Applications folder.

I only have guesses as to what the problem could be. Maybe the properties are suppose to be in a certain order. Maybe some unicode snuck in. Maybe the value of a property is too big.
User avatar
Cat_7
Expert User
Posts: 6557
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 »

@programmingkid:

Some time ago your adb key fixes went in the ppc-for-28 tree. Can you tell us what they fixed for us?
In the code you mentioned that you could not find a keyboard equivalent for the eject key. On my apple keyboard without this key, this function is mapped to the F12 key.

Best,
Cat_7
Programmingkid
Apple Corer
Posts: 245
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:@programmingkid:

Some time ago your adb key fixes went in the ppc-for-28 tree. Can you tell us what they fixed for us?
In the code you mentioned that you could not find a keyboard equivalent for the eject key. On my apple keyboard without this key, this function is mapped to the F12 key.

Best,
Cat_7
It fixes several key mappings. The right command and keypad equals keys are the ones I remember.
User avatar
adespoton
Forum All-Star
Posts: 4727
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com

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

Post by adespoton »

Programmingkid wrote:
Cat_7 wrote:@programmingkid:

Some time ago your adb key fixes went in the ppc-for-28 tree. Can you tell us what they fixed for us?
In the code you mentioned that you could not find a keyboard equivalent for the eject key. On my apple keyboard without this key, this function is mapped to the F12 key.

Best,
Cat_7
It fixes several key mappings. The right command and keypad equals keys are the ones I remember.
The right command is now the power button. I haven't been able to figure out what the right option key is mapped to, but it's not option :) Is this before or after your changes?
Programmingkid
Apple Corer
Posts: 245
Joined: Sun Jan 31, 2016 6:01 pm

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

Post by Programmingkid »

adespoton wrote:
Programmingkid wrote:
Cat_7 wrote:@programmingkid:

Some time ago your adb key fixes went in the ppc-for-28 tree. Can you tell us what they fixed for us?
In the code you mentioned that you could not find a keyboard equivalent for the eject key. On my apple keyboard without this key, this function is mapped to the F12 key.

Best,
Cat_7
It fixes several key mappings. The right command and keypad equals keys are the ones I remember.
The right command is now the power button. I haven't been able to figure out what the right option key is mapped to, but it's not option :) Is this before or after your changes?
Definitely before.
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 »

This is a stupid question here, but what is the command key mapped to on Windows? I've been messing around, and have been unable to find the equivalent keymapping. I have used Ctrl, Alt, Super, Shift and Tab so far.
Programmingkid
Apple Corer
Posts: 245
Joined: Sun Jan 31, 2016 6:01 pm

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

Post by Programmingkid »

sidoh wrote:This is a stupid question here, but what is the command key mapped to on Windows? I've been messing around, and have been unable to find the equivalent keymapping. I have used Ctrl, Alt, Super, Shift and Tab so far.
Not at all a bad question to ask.

By Super do you mean the Windows key? If you did I would think that would work as the command key.

What user interface are you using? GTK, SDL, remotely?

What kind of keyboard are you using? PC/2, Microsoft USB keyboard?
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 »

Programmingkid wrote:
sidoh wrote:This is a stupid question here, but what is the command key mapped to on Windows? I've been messing around, and have been unable to find the equivalent keymapping. I have used Ctrl, Alt, Super, Shift and Tab so far.
Not at all a bad question to ask.

By Super do you mean the Windows key? If you did I would think that would work as the command key.

What user interface are you using? GTK, SDL, remotely?

What kind of keyboard are you using? PC/2, Microsoft USB keyboard?
* I'm using the latest Windows build available on this forum, with the SDL interface, with a Logitech keyboard I got in 2013 (can't remember the model, sorry). I have it mapped to the standard en-us bindings.

* By 'Super', I do mean the Windows key. Yes, that button does not work in my QEMU config.
Programmingkid
Apple Corer
Posts: 245
Joined: Sun Jan 31, 2016 6:01 pm

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

Post by Programmingkid »

sidoh wrote:
Programmingkid wrote:
sidoh wrote:This is a stupid question here, but what is the command key mapped to on Windows? I've been messing around, and have been unable to find the equivalent keymapping. I have used Ctrl, Alt, Super, Shift and Tab so far.
Not at all a bad question to ask.

By Super do you mean the Windows key? If you did I would think that would work as the command key.

What user interface are you using? GTK, SDL, remotely?

What kind of keyboard are you using? PC/2, Microsoft USB keyboard?
* I'm using the latest Windows build available on this forum, with the SDL interface, with a Logitech keyboard I got in 2013 (can't remember the model, sorry). I have it mapped to the standard en-us bindings.

* By 'Super', I do mean the Windows key. Yes, that button does not work in my QEMU config.
I'm not a SDL-Windows user but I'm sure there are a few around. Do any of you have this same problem?

I think the file sdl2-input.c is what could help identify the problem. If you are able to build your own version of QEMU, I would put a printf statement in this code:

switch (ev->keysym.scancode) {
#if 0
case SDL_SCANCODE_NUMLOCKCLEAR:
case SDL_SCANCODE_CAPSLOCK:
/* SDL does not send the key up event, so we generate it */
qemu_input_event_send_key_qcode(con, qcode, true);
qemu_input_event_send_key_qcode(con, qcode, false);
return;
#endif
case SDL_SCANCODE_LCTRL:
case SDL_SCANCODE_LSHIFT:
case SDL_SCANCODE_LALT:
case SDL_SCANCODE_LGUI:
case SDL_SCANCODE_RCTRL:
case SDL_SCANCODE_RSHIFT:
case SDL_SCANCODE_RALT:
case SDL_SCANCODE_RGUI:
if (ev->type == SDL_KEYUP) {
modifiers_state[ev->keysym.scancode] = 0;
} else {
modifiers_state[ev->keysym.scancode] = 1;
}
/* fall though */
default:
qemu_input_event_send_key_qcode(con, qcode,
ev->type == SDL_KEYDOWN);

Hopefully the printf statement will indicate what is going on.
Post Reply