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
adespoton
Forum All-Star
Posts: 4285
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'll second that -- there are documented security bugs in 10.6 that even the exploit kit landing pages check for. If you're playing movies through VLC on 10.6, this is another attack vector currently in the wild.

10.4 PPC on the other hand... at this point it's basically safe from malware attack. Most OS X malicious software doesn't even run on it (either too old, or only targets Intel).
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 »

LightBulbFun wrote:so quick one here today I saw QEMU 2.6RC0 had been released on QEMUs page so I downloaded it compiled it quickly and tested it with my standard 10.4 image and the issue with the Mouse curser vanishing and about this mac crashing when using -cpu G4 is still around (it used to exist in older QEMU versions got fixed around 2.2 then got broken again in 2.5 :( it only happens in emulation mode on say my Mac pro, when using KVM with QEMU on a native PPC machine, my G5 running Linux i dont have this issue) i have yet to test OS9 etc ill do that shortly
Have you test Mac OS 9 in KVM yet?
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 »

No not yet sorry ill have to get round to it at some point. but as i think i have said in the past with past versions of QEMU while with the right OpenBIOS OS9 would boot in Non KVM QEMU (say on an intel mac) if i tried the same setup on my G5 Linux with KVM it would hang in OpenBIOS trying to load the MacOS ROM IIRC
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 »

So... nothing happening? I check this post every week or so and it seems things are stagnant for quite a while.

Is there anything MacOS-wise for GSOC 2016? I saw something about USB support, but it seems there are not many hands on deck to look into the Open Transport issues. =(
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 »

sentient06 wrote:So... nothing happening? I check this post every week or so and it seems things are stagnant for quite a while.

Is there anything MacOS-wise for GSOC 2016? I saw something about USB support, but it seems there are not many hands on deck to look into the Open Transport issues. =(
Well I am always working on QEMU. Right now I am working on a front-end for the Mac OS. It will be just like Q and Virt-manager.

I have also invested in a PowerPC Macintosh that can run QEMU in KVM mode. I'm hoping any emulation bugs might show up on it.
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 »

sentient06 wrote:So... nothing happening? I check this post every week or so and it seems things are stagnant for quite a while.

Is there anything MacOS-wise for GSOC 2016? I saw something about USB support, but it seems there are not many hands on deck to look into the Open Transport issues. =(
Right now, I can't find anything about the serial hardware Apple used in their PowerPC Macs. I can tell that they used it for ROM Debugging. The USB connection stuff is documented, though I can't remember which specific hardware they used.

Fortunately, Apple left all their function names in some of their newer Old World Macs' ROMs untouched, likely for easier debugging. They also left a Serial Test Manager inside the ROM, but how to access it is a mystery. I actually found out about the latter last year, but no one on there appeared to show even the slightest interest.

I'm not sure about the New World Macs, though.

However, for boot parameters in New World Macs, these are some parameters expected by one ROM:

escc-legacy chrp,es1
escc-legacy ch-a
escc-legacy chrp,es2
serial ch-b chrp,es3
serial ch-a chrp,es4
serial ch-b chrp,es5
serial adb
serial chrp,adb0
adb adb
pmu adb
adb adb
keyboard keyboard
via via
via-cuda via-cuda
via-pmu via-pmu

ethernet scsi chrp,mesh0
ethernet scsi
interrupt-controller chrp,iic
interrupt-controller chrp,open-pic
interrupt-controller open-pic
interrupt-controller mac-io

hydra AAPL,Hydra
interrupt-controller heathrow-ata (?)
interrupt-controller keywest-ata (?)

interrupt-controller heathrow
interrupt-controller paddington
interrupt-controller programmer-switch

fdc swim3
sound awacs
sound davbus
power-mgt cuda
power-mgt pmu
pccard ti1130
cardbus ti1210
cardbus usb
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 »

kataetheweirdo wrote: Right now, I can't find anything about the serial hardware Apple used in their PowerPC Macs. I can tell that they used it for ROM Debugging. The USB connection stuff is documented, though I can't remember which specific hardware they used.
Can people like me help? What sort of information are you looking for? Do you need hardware documentation (of the same kind some companies do about how their processors work?)? Or perhaps you need specific details of system calls, libraries, etc?

Alas, I am not very skilled with hardware and I am utterly ignorant about ROMs and their inner procedures, but I can put some decent effort on research.

I am glad to know some people are out there putting their mind to it, that's inspiring!
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 »

Ideally, I'd like hardware documentation on the serial and/or networking hardware used in these Macs. I really would like to figure out how these work in relation to the PowerPC Macs and what is required for a piece of hardware to use OpenTransport with the Macs. You may have to search deep for this documentation though.

It's kind of important to know how the functions of OpenTransport libraries work too, but Apple luckily managed to archive this document for it. However, that document is for the 68k side and not the PPC side we need to know. The document is likely buried deep within developer.apple.com though.
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 »

kataetheweirdo wrote:Ideally, I'd like hardware documentation on the serial and/or networking hardware used in these Macs. I really would like to figure out how these work in relation to the PowerPC Macs and what is required for a piece of hardware to use OpenTransport with the Macs. You may have to search deep for this documentation though.
Okay, I unearthed some stuff using web archive, tell me if I am on the scent. Some URLs here are particularly interesting.

Classic Mac Networking (check the downloads session, might be something useful):
http://www.applefool.com/se30/

Open Transport 1.1.1 and 1.1.2 Readme (mostly details about modems.. is that useful at all?):
http://www.gla.ac.uk/~gwm1h/macos7.6/otppp.html
http://www.gla.ac.uk/~gwm1h/ot/ot1.1.2/ ... Part1.html

Apple Technical Note 1117: Open Transport STREAMS FAQ:
http://web.archive.org/web/200102220438 ... n1117.html

Apple Technical Note 1119: Serial Port Apocrypha - "This Technote describes a number of problems often encountered by developers when dealing with serial ports under Mac OS":
http://web.archive.org/web/200104140407 ... n1119.html

OT Advanced Client Programming:
http://web.archive.org/web/200103201229 ... index.html
http://web.archive.org/web/200104132331 ... tProg.html

Mac OS Networking:
http://web.archive.org/web/199905081547 ... transport/

This page has a reference to an old Open Transport SDK. They say that "this SDK also includes information on programming with the Apple Remote Access and OT/PPP APIs. There is an updated Apple Enet Driver Development Kit (DDK) for developing Ethernet drivers to function with Mac OS 9.":
http://web.archive.org/web/200102100419 ... e.com/sdk/

The SDK was in an FTP server which is down. Do you think this information that comes with the SDK can be useful? I can search for this SDK in that case.

There is an "Inside Macintosh: Networking" floating in the web, but I think it must be too old, so I didn't bother.
There is also another book called "Inside Macintosh: PowerPC Numerics" which is harder to find. I have no idea if this book contains anything about serial hardware, networking or OT, do you know it?

Then I found this book called "Macintosh Technology in the Common Hardware Reference Platform". I can't really describe it, but it is available in Amazon. I thought it could be useful because it seems to describe PowerPC machines.
PDF:
http://www.cpu.lu/~mlan/ftp/MacTech.pdf
Amazon (from Italy?):
https://www.amazon.it/MacIntosh-Technol ... ffsb-it-21

Book: "OS X Internals: A Systems Approach", it seems to be about Mac OS X, but there should be some New World ROM information here (pages 221, 222):
http://venom630.free.fr/pdf/OSXInternals.pdf

I will continue my research, I will try to find something similar to this "Networking With Open Transport". Tell me if anything here is of use or if something is completely pointless, so I can avoid similar results in the near future. =D

Update:

Open Transport site?
http://web.archive.org/web/200011090721 ... transport/

(Check the links at the bottom of the Tech Notes)

And more tech notes:
http://www.fenestrated.net/mirrors/Appl ... index.html
User avatar
adespoton
Forum All-Star
Posts: 4285
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 »

kataetheweirdo wrote:Ideally, I'd like hardware documentation on the serial and/or networking hardware used in these Macs. I really would like to figure out how these work in relation to the PowerPC Macs and what is required for a piece of hardware to use OpenTransport with the Macs. You may have to search deep for this documentation though.

It's kind of important to know how the functions of OpenTransport libraries work too, but Apple luckily managed to archive this document for it. However, that document is for the 68k side and not the PPC side we need to know. The document is likely buried deep within developer.apple.com though.
As far as I recall, most of the official OT documentation was for 68k; the PPC code just ran an abstraction layer on top. IIRC, there are a few tech notes dealing with the abstraction; I'll see if I can dig them up -- if someone else beats me to it, all the better :)

If you have any questions about how the 68k docs map to PPC, let me know, I might still recall some stuff. Most of what I did with it was with 68k though.
User avatar
adespoton
Forum All-Star
Posts: 4285
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 just found an interesting discussion thread which might throw some light on the issues here:
http://www.xlr8yourmac.com/OS9/os_9_2_1 ... _mods.html

There's mainly discussion of the new OpenGL that's incompatible with older graphics cards, but there's also some fiddling that had to be done with Open Transport.
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 »

The OpenGL stuff is really graphics card related. Since QEMU isn't likely to support graphics card acceleration in the near future, it's probably best to stock up on all the vintage computer graphics development stuff we can find.

That post above involved deleting the preferences files made for OS 9.2.x (Open Transport Preferences, AppleShare Prep, and AppleTalk Preferences). I'll be willing to look into these preferences files, but I can't imagine those being the issue.

As for the modem stuff, it will be info that might be interesting when we get to networking with Mac OS 9/X PPC, but not so relevant when it comes to the boot-up process.

I'd definitely like to know how the 68k code for OT works in relation to the PPC Macs. I did see the mirrored tech notes, though, and I am fortunate that someone backed those up before Apple deleted them en masse. They contain a lot of useful info for Mac OS Classic, as well as early versions of OS X. Check out Tech Notes 1059 and 1128 for some good info on OpenTransport there.

There are some strings hidden inside the Open Transport extension. These appear to be for debugging purposes and are inside epcf resource forks. Don't forget to check the Serial (Built-in) extension too. The SDK for OpenTransport would be quite useful and I suspect there are a couple of unused/undocumented functions.

Finally, Macintosh Technology in the Common Hardware Reference Platform does describe PPC Macs, but pre-G3 PPC Macs. It's still very useful info, though, even if it doesn't include the information about OpenTransport.

I should point out the ROMs for New World Macs are a barebones loader, the OpenFirmware code, and a couple of misc. drivers stuck in there to display anything. These ROMs load in a ROM from the Mac's system hard drive (Mac OS Classic) or firmware (Mac OS X), but I recall the limit being 4 MB for these. There's a 4 MB memory module in New World Macs that is separate from the rest of the OS.
mcayland
Mac Mechanic
Posts: 152
Joined: Sun Nov 01, 2015 10:33 pm

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

Post by mcayland »

sentient06 wrote:So... nothing happening? I check this post every week or so and it seems things are stagnant for quite a while.

Is there anything MacOS-wise for GSOC 2016? I saw something about USB support, but it seems there are not many hands on deck to look into the Open Transport issues. =(
Well I do try and chip away at parts of this as time allows, but debugging can be particularly hard especially if like me you have no previous MacOS experience :)

At the moment my time has been taken up working with the block developers to switch QEMU's emulated macio controller over to use the new byte-aligned DMA interfaces. Previously QEMU block IO worked on 512 byte sectors which is generally fine, except for MacOS which uses byte-aligned DMA. So for example to perform a write not on a 512 byte boundary (which is the normal for Darwin/OS X, silly Apple) you have to read the previous partial sector, the next partial sector and then write everything back to disk so a single write becomes 2 x blocking reads and 1 x bigger write.

Now the groundwork has been done at the QEMU block layer, I've posted a WIP patch today which converts macio over to use the new byte-aligned API. Initial performance is impressive, with a Darwin PPC install on my laptop dropping from ~25 mins to ~9 mins for a complete install. So once this has been finalised and applied to git, everyone should get a noticeable speed-up on their emulated Mac machines.
mcayland
Mac Mechanic
Posts: 152
Joined: Sun Nov 01, 2015 10:33 pm

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

Post by mcayland »

FWIW if people have time to spare, one thing that would really help is to try and isolate and debug the ADB mouse problems that people have been experiencing.

Note that now NetBSD-ppc can boot in QEMU, if I boot the install CD to a shell and hit the keyboard randomly for a few seconds then I can trigger some kind of failure where CUDA/ADB keeps repeating the last key until I hit the virtual big red button. This helps because it becomes possible to use a debugger both inside the VM and in QEMU to work out exactly where the problem is.

This is a good first project for someone with previous coding experience since CUDA/ADB is reasonably well documented in various sources, there's lots of debugging present in QEMU, and the recent rework to the emulated CUDA interface should make things a lot simpler.
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 »

I'll be checking this one out tomorrow. Apparently, the TLS problems in 64-bit Windows have been fixed, but I'm not entirely sure about this. I'll be checking out any problems there and post up whatever I can.
mcayland
Mac Mechanic
Posts: 152
Joined: Sun Nov 01, 2015 10:33 pm

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

Post by mcayland »

kataetheweirdo wrote:The OpenGL stuff is really graphics card related. Since QEMU isn't likely to support graphics card acceleration in the near future, it's probably best to stock up on all the vintage computer graphics development stuff we can find.

That post above involved deleting the preferences files made for OS 9.2.x (Open Transport Preferences, AppleShare Prep, and AppleTalk Preferences). I'll be willing to look into these preferences files, but I can't imagine those being the issue.

As for the modem stuff, it will be info that might be interesting when we get to networking with Mac OS 9/X PPC, but not so relevant when it comes to the boot-up process.

I'd definitely like to know how the 68k code for OT works in relation to the PPC Macs. I did see the mirrored tech notes, though, and I am fortunate that someone backed those up before Apple deleted them en masse. They contain a lot of useful info for Mac OS Classic, as well as early versions of OS X. Check out Tech Notes 1059 and 1128 for some good info on OpenTransport there.

There are some strings hidden inside the Open Transport extension. These appear to be for debugging purposes and are inside epcf resource forks. Don't forget to check the Serial (Built-in) extension too. The SDK for OpenTransport would be quite useful and I suspect there are a couple of unused/undocumented functions.

Finally, Macintosh Technology in the Common Hardware Reference Platform does describe PPC Macs, but pre-G3 PPC Macs. It's still very useful info, though, even if it doesn't include the information about OpenTransport.

I should point out the ROMs for New World Macs are a barebones loader, the OpenFirmware code, and a couple of misc. drivers stuck in there to display anything. These ROMs load in a ROM from the Mac's system hard drive (Mac OS Classic) or firmware (Mac OS X), but I recall the limit being 4 MB for these. There's a 4 MB memory module in New World Macs that is separate from the rest of the OS.
I did some digging using the links at the weekend and found a really useful article about Port Scanners here: http://web.archive.org/web/200101212224 ... rtScanners.

The theory seems to support what I would expect, but trying to get any supporting information out of MacsBug is tricky. As a starting point if I try and set a PPC breakpoint at OTRunPortScanners using BRP then it never hits and upon the next entry to MacsBug I see a message indicating that some breakpoints have been moved - but why?! Of course it is possible to break using the QEMU gdbstub but of course there is no context in terms of variables/functions.

The output of SC7 always seems to be failing in the memory fragment routines so I'm starting to think that this is either an instruction emulation bug or incorrect memory properties in OpenBIOS - after adding debugging to QEMU I'm fairly sure that none of the DBDMA routines other than disk I/O are being hit. At least the latter option is strongly suggested whilst trying to boot OpenBSD in -M mac99 mode here: http://virtuallyfun.superglobalmegacorp ... 9-to-qemu/. All further ideas in this area are welcome :)
mcayland
Mac Mechanic
Posts: 152
Joined: Sun Nov 01, 2015 10:33 pm

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

Post by mcayland »

kataetheweirdo wrote:I'll be checking this one out tomorrow. Apparently, the TLS problems in 64-bit Windows have been fixed, but I'm not entirely sure about this. I'll be checking out any problems there and post up whatever I can.
Excellent! If you're actively working on this, I'll make a point to come and check this thread more often.
djblastyfone
Space Cadet
Posts: 5
Joined: Tue Nov 17, 2015 11:53 pm

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

Post by djblastyfone »

kataetheweirdo wrote:Fortunately, Apple left all their function names in some of their newer Old World Macs' ROMs untouched, likely for easier debugging. They also left a Serial Test Manager inside the ROM, but how to access it is a mystery. I actually found out about the latter last year, but no one on there appeared to show even the slightest interest.
Does this help at all? This seems to be an unit for 68k macs, but the serial test in the newer ROMs are likely intended to be accessed in the same way.
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 »

djblastyfone wrote:Does this help at all? This seems to be an unit for 68k macs, but the serial test in the newer ROMs are likely intended to be accessed in the same way.
That's actually what made me look inside the PowerPC ROMs to see if something similar was there. There are serial ports hidden in Macs after all (the iMac G3 is an example I can remember), but I'm probably going to have to find a USB-to-serial port or other.

That link is interesting, but that specific hardware device is for 68k Macs. It would be interesting for Mini vMac, MESS, and Basilisk II. I don't have much of a clue as to what devices Apple used for testing the serial on PPC macs. Apparently, you can actually get the Serial Test Manager by holding the NMI button for at least 5 seconds and having the Mac connected to a serial testing device. Here are all the known commands for that:

? - Help menu
x - Exit debugger (using a PowerPC rfi command, to continue booting)
td - Dump all the registers

Any command here that begins with d displays a value at that address, while any command that begins with s sets that value. This first set of commands is for the Mac's memory. m is a memory range, b is a byte, w is a word (2 bytes), and l is a long (4 bytes)

dm (address) (length)
db (address)
dw (address)
dl (address)
sb (address) (value)
sw (address) (value)
sl (address) (value)

This second section is for NVRAM space.

dmn (address) (length)
dbn (address)
dwn (address)
dln (address)
sbn (address) (value)
swn (address) (value)
sln (address) (value)

And these two are for the PCI Bus Config Space cycles.

dlc (address)
slc (address) (value)

mcio - Display Paddington IO register
grkl - Display Grackle register

t0 through t9 - Do a test on the ROM
...
t0 - ROM Checksum
t1 - Address Line
t2 - Data Line
t3 - Simple RAM Test
t4 - Mod3 Forward
t5 - Mod3 Reverse
t6 - NVRAM
t7 - L2 Cache (Newer PPCs only - G3s, G4s)
t8 - Address Pattern
t9 - NTA Word

tb - Quick memory test
a - All tests
q - Quick
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 »

kataetheweirdo wrote:There are some strings hidden inside the Open Transport extension. These appear to be for debugging purposes and are inside epcf resource forks. Don't forget to check the Serial (Built-in) extension too. The SDK for OpenTransport would be quite useful and I suspect there are a couple of unused/undocumented functions.
Gentlemen, behold a mirror of Apple's FTP server with the Open Transport SDKs:

http://staticky.com/dl/ftp.apple.com/de ... Transport/

There is some documentation available as well, I wonder if there's anything useful there?

http://staticky.com/dl/ftp.apple.com/de ... mentation/

And maybe some useful debugging tools?

http://staticky.com/dl/ftp.apple.com/de ... Debugging/
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 »

Using 64-bit Windows 10, I can now boot up Mac OS 9.2.1. However, mouse control is incredibly erratic. You have to carefully and manually align the guest mouse with the host mouse, as the host mouse and guest mouse do not match up. It seems like it doesn't recognize the host mouse's position in comparison to the guest mouse on Windows. Double-clicking on icons can also be quite a feat in of itself. Going fullscreen does not help it in the slightest. I had to use Task Manager to quit out of QEMU.

Additional Relevant Stats:
QEMU 2.6.50 - May 23, 2016 build
OpenBIOS - Oct 23 2015 12:44 build (This also worked for openbios-ppc-test4)

Command Line Prompt Used:
qemu-system-ppc -bios openbios-qemu.elf -boot d -drive file=os92_test.iso,index=0,media=cdrom -M mac99 -m 256 -prom-env 'auto-boot?=true' -g 800x600x32 -cpu G3 -net none

Specifying "-device adb-mouse" with Oct. 23rd build of OpenBIOS causes Mac OS 9 to bring up the illegal instruction error window during boot-up. OpenBIOSPPC Tests 1 through 3 didn't boot up, resulting in the same error. Specifying "-device virtio-mouse" in Openbios-ppc-test4 causes the same error.

It can't boot in G3 Beige mode, as doing so results in this:

MacOS: Boot Failure (0xF3C481F6)
MacOS: unable to find an interrupt controller node

I'd like to know what type of mice are supported by PPC QEMU, as it seems to default to the USB mouse support.

I've been trying to use compat_monitor0 to see if I can trace the ADB mouse movements.

I see some discussion on the OpenBIOS mailing list on the unimplemented registers (though these are warning as of now) and I think it would be nice to see those finally implemented.
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 »

kataetheweirdo wrote:Using 64-bit Windows 10, I can now boot up Mac OS 9.2.1. However, mouse control is incredibly erratic. You have to carefully and manually align the guest mouse with the host mouse, as the host mouse and guest mouse do not match up. It seems like it doesn't recognize the host mouse's position in comparison to the guest mouse on Windows. Double-clicking on icons can also be quite a feat in of itself. Going fullscreen does not help it in the slightest. I had to use Task Manager to quit out of QEMU.

Additional Relevant Stats:
QEMU 2.6.50 - May 23, 2016 build
OpenBIOS - Oct 23 2015 12:44 build (This also worked for openbios-ppc-test4)
Could you try your test again using a more recent version of OpenBIOS? According to the creation date, it is from October. Many changes have taken place since then.
Command Line Prompt Used:
qemu-system-ppc -bios openbios-qemu.elf -boot d -drive file=os92_test.iso,index=0,media=cdrom -M mac99 -m 256 -prom-env 'auto-boot?=true' -g 800x600x32 -cpu G3 -net none

Specifying "-device adb-mouse" with Oct. 23rd build of OpenBIOS causes Mac OS 9 to bring up the illegal instruction error window during boot-up. OpenBIOSPPC Tests 1 through 3 didn't boot up, resulting in the same error. Specifying "-device virtio-mouse" in Openbios-ppc-test4 causes the same error.

It can't boot in G3 Beige mode, as doing so results in this:

MacOS: Boot Failure (0xF3C481F6)
MacOS: unable to find an interrupt controller node
Mac OS 9 is not compatible with QEMU's beige G3 emulator.
I'd like to know what type of mice are supported by PPC QEMU, as it seems to default to the USB mouse support.
USB mouse and keyboard seem to work a lot better than their ADB counterparts. I always add this to my Mac OS 9.2 QEMU arguments: -usb -device usb-mouse -device usb-kbd
I've been trying to use compat_monitor0 to see if I can trace the ADB mouse movements.

I see some discussion on the OpenBIOS mailing list on the unimplemented registers (though these are warning as of now) and I think it would be nice to see those finally implemented.
mcayland
Mac Mechanic
Posts: 152
Joined: Sun Nov 01, 2015 10:33 pm

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

Post by mcayland »

kataetheweirdo wrote:Using 64-bit Windows 10, I can now boot up Mac OS 9.2.1. However, mouse control is incredibly erratic. You have to carefully and manually align the guest mouse with the host mouse, as the host mouse and guest mouse do not match up. It seems like it doesn't recognize the host mouse's position in comparison to the guest mouse on Windows. Double-clicking on icons can also be quite a feat in of itself. Going fullscreen does not help it in the slightest. I had to use Task Manager to quit out of QEMU.
I don't use Windows as my main OS but this sounds like something is wrong. With the default GTK front-end, clicking on the display window causes it to capture all mouse events so that they get delivered directly to the guest rather than having this alignment problem.
kataetheweirdo wrote:Additional Relevant Stats:
QEMU 2.6.50 - May 23, 2016 build
OpenBIOS - Oct 23 2015 12:44 build (This also worked for openbios-ppc-test4)

Command Line Prompt Used:
qemu-system-ppc -bios openbios-qemu.elf -boot d -drive file=os92_test.iso,index=0,media=cdrom -M mac99 -m 256 -prom-env 'auto-boot?=true' -g 800x600x32 -cpu G3 -net none

Specifying "-device adb-mouse" with Oct. 23rd build of OpenBIOS causes Mac OS 9 to bring up the illegal instruction error window during boot-up. OpenBIOSPPC Tests 1 through 3 didn't boot up, resulting in the same error. Specifying "-device virtio-mouse" in Openbios-ppc-test4 causes the same error.
Yeah that image is old - grab the latest from https://www.ilande.co.uk/tmp/openbios/openbios-ppc although AFAICT at the moment this doesn't make any difference.
kataetheweirdo wrote:It can't boot in G3 Beige mode, as doing so results in this:

MacOS: Boot Failure (0xF3C481F6)
MacOS: unable to find an interrupt controller node
That's not strictly true. The firmware image provided on the MacOS CD image is for New World machines and bails out when the device tree doesn't match. I'm sure there have been reports from others on this forum that they've taken Old World images and run them fine under g3beige. Alternatively someone might like to cook up a patch for QEMU which allows you to pass your own Toolbox ROM file on the command line for people who want to install this directly.
kataetheweirdo wrote:I'd like to know what type of mice are supported by PPC QEMU, as it seems to default to the USB mouse support.

I've been trying to use compat_monitor0 to see if I can trace the ADB mouse movements.

I see some discussion on the OpenBIOS mailing list on the unimplemented registers (though these are warning as of now) and I think it would be nice to see those finally implemented.
The default mouse for the Mac machines is ADB, whilst USB should be supported on mac99 machines. For tracing mouse events, you'll need to uncomment some #defines in the ADB driver to see the packets going between the ADB/CUDA interfaces so for this level of development you'll need to set up development environment so that you can build from source yourself.
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 »

With "-usb -device usb-mouse -device usb-kbd" (w/o quotes) added to the command prompt, the mouse does indeed control better, although it does have mouse jerking problems still.

I'll try out QEMU with the new ROM mcayland provided. I'm also going to try out qemu-system-ppcw to see if the mouse control is any better there. Another possibility would be to see how Mac OS 9 works with third-party mouse drivers, mostly to see how different the mouse reacts compared to the regular mouse driver.

I'll be trying to get the ADB driver up with the debugging options running, so that I can see how these packets are being transferred.
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 »

mouse jerking only happens when using GTK output under Windows. It's a bug of qemu windows port itself. Try SDL output instead, just add "-sdl".
Post Reply