qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v7 6/7] mac_newworld: Deprecate mac99 "via" option


From: BALATON Zoltan
Subject: Re: [PATCH v7 6/7] mac_newworld: Deprecate mac99 "via" option
Date: Tue, 24 Jan 2023 16:31:13 +0100 (CET)

On Tue, 24 Jan 2023, Howard Spoelstra wrote:
On Tue, Jan 24, 2023 at 3:15 PM BALATON Zoltan <balaton@eik.bme.hu> wrote:
I thought MacOS 8 needed old world ROM but looks like it can also load it
from disk on new world machines. Then what version of the ROM it has?
It seems there was some change at ROM 5.2.1 then which solves the problem
with usb and older versions may have done something differently and
expect it to work unlike it's emulated now.

The rom on the 8.6 Cd is version ....
The disk utility on the CD cannot initialise a hard disk (something we had
with some 9.0.4 versions too)

This sentence seems to be unfinished, also the disk utility problem is maybe unrelated so just ignore that for now and focus on usb first.

So it seems versions before 10.2 have a problem (except 9,1 and 9.2 which
may have a newer usb driver maybe? also 9.0.4 with ROM 5.2.1 and I assume
later 9.x versions have at least this or newer Toolbox ROM) I think it's
esasier to debug with OS X because it's easier to get logs and the drivers
may also be open source so easier to check what's happening so let's just
forget about MacOS9 for now and try to find out what changed between 10.1
and 10.2 in usb handling.

It seems via=pmu provides usb mouse first, usb kbd second.
With Mac OS 9.0.4 the second device will not work.
With 10.0 / 10.1 both usb mouse and kbd do not work.

These are added here:


https://gitlab.com/qemu-project/qemu/-/blob/master/hw/ppc/mac_newworld.c#L435

you could change the order but it does not matter if both needs to work.
If it makes the first one work then maybe the older USB drivers only
handle one port per bus? But then the problem in OS X may be different.

Real hardware provides two USB buses: USB 0 and USB 1. In Qemu by
default I
only see one bus: USB 0 into which both mouse and kdb are plugged.
On the real G4 the mouse and kbd are each plugged into another bus, so I
see the kbd on e.g. USB 0 and the mouse on e.g. USB 1.

With -M mac99,via=cuda one USB bus is always created. It has id "usb-bus"
We can add a second USB bus with e.g. -device pci-ohci,id=usb1  (this is
the Apple USB controller).

Then add mouse and kbd to different buses with:
-device usb-mouse,bus=usb-bus.0    (attaches to first and default bus)
-device usb-kbd,bus=usb1.0 (attaches to second bus).

This then mimics what I see on real hardware. Should qemu-system-ppc by
default provide the same?

Does this solve the problem you have?


No.

OK so then we should not do that by default either unless we find it's needed for some reason.

(You talk about via=cude above but I
think it should be via=pmu. Is that a typo?)


No, even with via-cuda the first usb bus is created:
dev: pci-ohci, id ""
       masterbus = ""
       num-ports = 3 (0x3)
       firstport = 0 (0x0)
       addr = 0d.0
       romfile = ""
       romsize = 4294967295 (0xffffffff)
       rombar = 1 (0x1)
       multifunction = false
       x-pcie-lnksta-dllla = true
       x-pcie-extcap-init = true
       failover_pair_id = ""
       acpi-index = 0 (0x0)
       class USB controller, addr 00:0d.0, pci id 106b:003f (sub 1af4:1100)
       bar 0: mem at 0x80080000 [0x800800ff]
       bus: usb-bus.0
         type usb-bus

I now think in some cases the mouse falls back to adb when usb does not
work. Hence the wiggling/clicking that is needed to get 9.0.4 to get to the
desktop.
Can we disable usb-bus creation for via=cuda?

Yes, try:

qemu-system-ppc -M mac99,usb=no

(I had to look at the code to find that out).

If this helps mac_newworld.c
could add another usb bus or do somerthing different to match real
hardware but you have to convince Mark about that first... Also Mac
keyboards have a hub where the mouse is usially connected. Does modeling
that setup with QEMU help?

No, same issues with that.

Then it's probably not about how these ports are arranged but something about modeiling the hardware maybe (i.e. QEMU does something differently than real hardware and this confuses the driver).

Other idea you could try is to boot 10.1 and 10.2 and compare the ioreg
outputs for the USB devices to see if there are some differences or get
the USB driver versions and try to find out what changed in them.


I attempted to take a look, but without mouse/kbd it is difficult to get to
ioreg ;-)

You can set up tap or vmnet network, boot it with cuda, enable ssh then you can access it from there after booting usb config. (It may even work with user network somehow, I think there's an option to forward a port from the guest to host then you could access ssh that way without having to set up bridged networking but you'll need to find that option as I don't remember what it was but I think I've seen it somewhere. Maybe in qemu-system-ppc -help or some docs on QEMU networking somewhere.)

Regards,
BALATON Zoltan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]