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

darthnvader
Mac Mechanic
Posts: 178
Joined: Sun Feb 07, 2016 4:40 pm

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

Post by darthnvader »

QEMU is superior to SheepShaver in every way, except CPU speed, Disk IO, Sound subsystem, Networking, and Video Subsystem. :mrgreen:
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 »

Just wanted to report my research. Since Rosetta fails more floating point tests than QEMU I thought it would be interesting to see what happens when the PowerPC version of Quicktime is ran in Rosetta. I was actually hoping for poor audio playback. What actually happened was MP3 audio played back perfectly.

I used Quicktime 7.6.4 copied from a PowerPC Mac running Mac OS 10.4. I set this copy of Quicktime to run using Rosetta via the Get Info window. While Quicktime was running I could see that Activity Monitor was report it as being PowerPC.

I'm pretty disappointed by this result. It looks as if the floating point unit isn't the reason why audio plays so poorly in QEMU. But this isn't proven true so it still could be the floating point unit. I just wish we knew what was exactly wrong with QEMU.
MetalSnake
Granny Smith
Posts: 120
Joined: Fri Nov 09, 2007 5:42 pm

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

Post by MetalSnake »

mcayland wrote:QEMU is an emulator and therefore is not concerned with 100% accuracy
First time I hear this. So you are saying higan (aka. bsnes) is not an emulator because it strives for 100% accuracy?
kataetheweirdo
Master Emulator
Posts: 313
Joined: Sun Feb 01, 2009 4:55 pm

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

Post by kataetheweirdo »

mcayland worded it pretty badly. Sometimes, emulators do try to get 100% accuracy. The big thing though is that BSNES/higan is emulating a games console with hardware that can be accurately emulated, though it's requirements are also very high as a consequence of this. Not only that, but the SNES uses hardware significantly easier to emulate than a PowerPC Mac ever had.

BSNES tries to get as cycle-accurate as possible to the original hardware, but QEMU does not intend to do so as having it that way would slow the emulation way too much for it to be usable. Not only that, but while there is extensive documentation on how the 65c816 uses a certain amount of cycles for an instruction, it's not quite as extensive for PowerPC processors. Fresscale's document do at least give hints as to how many cycles each instruction takes. Also, no one has decapped a Mac's chips before, while the SNES has had its chips decapped.

This is probably the best source I've found on this so far for the PPC. (Here's an updated link to the 7410 User Manual, btw)
User avatar
adespoton
Forum All-Star
Posts: 4226
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 »

There are lots of arguments over what is an emulator and what is a simulator.

But in this context, emulation refers to virtualizing specific hardware in software, and the simulator would be attempting to create software that behaves like an overall system -- so SheepShaver functions with a specific OS, specific hardware set, and patches it all together to make software run quickly and somewhat accurately. What QEMU, MESS, MAME and friends do is create a library of emulated chips, and then have a minor set of simulation code that glues them all together to function like a specific computer. The software running on that computer isn't really taken into consideration at all.

So something like Executor is emulating the OS, and simulating the environment. WINE likewise (despite its name) is emulating the OS and simulating the environment. Higen/BSNES is emulating all of the hardware and using the real OS (which is on the supplied ROMs). QEMU is emulating the hardware and simulating a computer, on which a real OS is run. VirtualBox uses some real hardware, uses an old version of QEMU to emulate the rest, and uses the host architecture instead of simulating a computer for the most part -- but has options to simulate some parts of the system if needed as well. Mini vMac is somewhere between Higen and Basilisk II, patching some parts of the hardware and toolbox chain, but trying to emulate the entire computer architecture for the rest, and trying to become cycle exact for the components being emulated (some bits aren't there yet).
b0mbel
Space Cadet
Posts: 7
Joined: Thu May 18, 2017 9:55 pm

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

Post by b0mbel »

Hej guys,

I would like to use a printer in my QEMU OS9.2.2 machine.

Network works great.
I tried to pass through the USB-printer. I was able to see it under "system profiler" - but how do I add this device as a printer?

As soon as I start "Apple printer utility PPC" it says I have to activate AppleTalk - but it's already activated.

I don't care if it is a network printer or a local device. But I don't know how to add this thing to my OS9?

Any ideas?

Cheers,
-b0mb
CharlesS
Granny Smith
Posts: 107
Joined: Thu Aug 14, 2008 9:05 am

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

Post by CharlesS »

To use the built-in networking to connect straight from OS 9 to the printer, you'd need an OS 9-compatible printer driver, which unless the printer is very old is unlikely to exist these days.

What I do know is that the LaserWriter 8 driver is very flexible. Back when Classic was still a thing, I had a crazy hack involving a 'PAPA' resource with its TYPE set to '=Cst' (as documented here), which sent a PostScript file to an application which was actually an AppleScript droplet. The droplet then sent the PS file to the OS X side and printed it. I wish I'd documented exactly how all this worked, but it's been a decade and a half (jeez...), and my memory is fuzzy.

So, if you have a little programming skill, you could rig up something like that. The main trick (well, after figuring out how to add a custom print job to LaserWriter 8) would be to break out of the emulated environment to send the PostScript file to OS X. You could probably use the network to do it—write a little daemon on the OS X side that the OS 9 droplet could connect to and send the file. You'd of course want to make sure that the firewall on your router was set up such that the port you open wouldn't be visible outside the LAN.
There's no earthly way of knowing, which direction we are going, for the rowers keep on rowing, and they're certainly not showing any signs that they are slowing.
User avatar
mabam
Master Emulator
Posts: 497
Joined: Wed Apr 10, 2013 9:32 am

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

Post by mabam »

b0mbel wrote:I tried to pass through the USB-printer.
What do you mean by that? Did you give QEMU direct access to the device or did you share it to the network from your host?

AppleTalk is not involved. Neither in the first case, as AppleTalk has nothing to do with USB; nor in the second case, as your host is surely not capable of AppleTalk and therefore can't share the printer via that protocol.

In any case I suppose you would need a MacOS 9 driver from the manufacturer of the printer. During installation that driver software should be able to find the printer, I suppose (as you wrote System Profiler could find it as well).

If there is no MacOS 9 driver for your printer (or your printer happens to be a PostScript printer), you might be able to set up the printer similar to one of the ways described in the printing guide for Basilisk II and SheepShaver:http://www.emaculation.com/doku.php/she ... k_printing

What host system are you on?
User avatar
Cat_7
Expert User
Posts: 6145
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 would like to use a printer in my QEMU OS9.2.2 machine.
Have you tried finding a solution that fits your situation in our Basilisk/SheepShaver printing guide?
http://www.emaculation.com/doku.php/she ... k_printing

Qemu (-net user) and SheepShaver/Basilisk (slirp) basically use the same networking implementation.
Passthrough is certainly interesting and needed when drivers are only available for OS 9.2, but perhaps connecting the printer to you host (if it has appropriated drivers) is easiest.

Best,
Cat_7

EDIT: OOPS
Last edited by Cat_7 on Wed May 24, 2017 3:19 pm, edited 1 time in total.
Reason:  
User avatar
mabam
Master Emulator
Posts: 497
Joined: Wed Apr 10, 2013 9:32 am

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

Post by mabam »

I imagine poor B0mbel desperately refreshing this page in his browser since hours in anticipation of a reply, and suddenly receiving three of them within nine minutes … ;-)

I hope we (I) didn't confuse you.
b0mbel
Space Cadet
Posts: 7
Joined: Thu May 18, 2017 9:55 pm

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

Post by b0mbel »

mabam wrote:I imagine poor B0mbel desperately refreshing this page in his browser since hours in anticipation of a reply, and suddenly receiving three of them within nine minutes … ;-)

I hope we (I) didn't confuse you.
Nope you haven't .. I'll be back later to you with all my replys.
Thanks a lot so far!
Cheers,
-bomb
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

CharlesS wrote:What I do know is that the LaserWriter 8 driver is very flexible. Back when Classic was still a thing, I had a crazy hack involving a 'PAPA' resource with its TYPE set to '=Cst' (as documented here), which sent a PostScript file to an application which was actually an AppleScript droplet. The droplet then sent the PS file to the OS X side and printed it. I wish I'd documented exactly how all this worked, but it's been a decade and a half (jeez...), and my memory is fuzzy.
This is a brilliant hack and entirely new to me. More details here:

http://mirror.informatimago.com/next/de ... n1113.html

I had to remind myself how to use ResEdit, but once I got it right, it took about five minutes to create a sample AppleScript application that copied the dropped file to the desktop (I did this simply to test things), and then I created a custom printer definition that sent the print job to that AppleScript. This will be really useful, and will simply things enormously. Thank you!
User avatar
adespoton
Forum All-Star
Posts: 4226
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 can see the way this simplifies printing to host via SheepShaver; is there some way we can use AppleScript in the guest on qemu to do something similar? Or do we have to do some workaround like send it via FTP to the host and have a folder action script on the host that prints and deletes it?
CharlesS
Granny Smith
Posts: 107
Joined: Thu Aug 14, 2008 9:05 am

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

Post by CharlesS »

adespoton wrote:So I can see the way this simplifies printing to host via SheepShaver; is there some way we can use AppleScript in the guest on qemu to do something similar? Or do we have to do some workaround like send it via FTP to the host and have a folder action script on the host that prints and deletes it?
Well, my original Classic hack didn't have to worry about that, because IIRC, due to the weird hybrid nature of Classic, having LaserWriter 8 launch a Carbon applet actually caused the applet to launch on the OS X side, so at that point I could just open the PostScript file with Print Center and it'd print. With QEMU, we won't be able to do that, of course. I don't know enough about it to know if there's any way to break out of the emulated environment like there is with Mini vMac and SheepShaver, but if not, networking is probably the way to go. I had been thinking of writing one's own server to listen for and accept the PS file and print it, but folder actions do seem like a much less labor-intensive way to go.
There's no earthly way of knowing, which direction we are going, for the rowers keep on rowing, and they're certainly not showing any signs that they are slowing.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

CharlesS wrote:I don't know enough about it to know if there's any way to break out of the emulated environment like there is with Mini vMac and SheepShaver, but if not, networking is probably the way to go. I had been thinking of writing one's own server to listen for and accept the PS file and print it, but folder actions do seem like a much less labor-intensive way to go.
It's probably going to require SFTP to send the file to the OS X host, and then use a launch daemon (faster and more reliable than a folder action script) to print the file on the host. My SheepShaver-based WPMacApp uses a launch daemon to print to the OS X default printer:

http://wpdos.org/mac-intel.html
CharlesS
Granny Smith
Posts: 107
Joined: Thu Aug 14, 2008 9:05 am

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

Post by CharlesS »

How does your existing solution do it? Just curious.

(BTW: There really is/was an app called Color MacCheese. It was Delta Tao's first product: http://macintoshgarden.org/apps/color-maccheese )
There's no earthly way of knowing, which direction we are going, for the rowers keep on rowing, and they're certainly not showing any signs that they are slowing.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

CharlesS wrote:How does your existing solution do it? Just curious.

(BTW: There really is/was an app called Color MacCheese. It was Delta Tao's first product: http://macintoshgarden.org/apps/color-maccheese )
Briefly: In Sheepshaver, print to a PostScript driver that saves a file to a folder that has a folder action script attached to it; the folder action script moves the file to "Unix:.WPTransfer" which is a hidden folder in OS X. That folder has a launch daemon running that (like a folder action script) prints the file. Of course, it's a lot more complicated than that, but you can download the system and see the details.

I just looked at my system again, and I see that some features have stopped working, but the printing system works well, and I'll figure out how to fix the things that aren't working now.

BTW: Color MacCheese?!! Amazing.
User avatar
adespoton
Forum All-Star
Posts: 4226
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 »

SFTP/SCP sounds like a reasonable way to do it... I suppose since qemu allows for attaching named pipes as devices, it should also be possible to use applescript to redirect the PDF file to a pipe and directly consume it on the host side using a daemon. We may even be able to pipe directly to a folder that's read-only on the host, and use a launch daemon to print it when it shows up. The problem with that is signalling to the guest that the file has been dealt with and can be deleted.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

Meanwhile, I've updated my SheepShaver system to use this terrific hack. I created a Desktop Printer that sends the PS file to an AppleScript application; the AppleScript adds a ".ps" extension to the temporary PS file (so OS X/macOS will recognize it as a PostScript file) and copies the file to a hidden folder in the Unix folder, and then deletes the temporary file. On the OS X/macOS side, a launch daemon detects the file and prints it (or converts it to a PDF if you choose an option to do so).

The updated version of system won't be available for a while, because I'm on a slow connection and DropBox uploading takes time, but I'm very glad to have this. Thanks again!
LightBulbFun
Tinkerer
Posts: 50
Joined: Mon Jul 13, 2015 11:32 am

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

Post by LightBulbFun »

Just a quick heads up I compiled QEMU from the latest source code on the main branch today and it looks like the VGA patches have made it in :) i can change rez etc in OS X (not tested any other OSs yet but id expect those work too) this is the g3beige machine btw, im sure mac99 will work too
Image
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 »

It looks like because of 4 patches concerning MacDrivers added by Marc Cave-Ayland on 10th of May...
Interesting, does the official qemu boot MOS < 10.2 now?
User avatar
Cat_7
Expert User
Posts: 6145
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 »

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 »

Oh,great!Thanks!
User avatar
celebi23
Granny Smith
Posts: 101
Joined: Wed Jun 18, 2008 5:53 am

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

Post by celebi23 »

LightBulbFun wrote:Just a quick heads up I compiled QEMU from the latest source code on the main branch today and it looks like the VGA patches have made it in :) i can change rez etc in OS X (not tested any other OSs yet but id expect those work too) this is the g3beige machine btw, im sure mac99 will work too
Image
Does this mean Public Beta can be installed?
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 think yes it can I've tried my Developer Preview 1 image -- works fine (with usb keyboard/mouse).

I have tried booting Mac OS X Server 1.2 v.3 and found that this version does it noticeably slower than that I compiled on 10th of Jan.I wonder why is it so?Tested on MOS 10.12.4.

Leopard won't boot with "Still waiting for root device". It means Ben's IDE patches aren't there yet.
Last edited by alex195812 on Sat Jun 17, 2017 8:58 am, edited 1 time in total.
Post Reply