On Tue, Jan 24, 2023 at 3:15 PM BALATON Zoltan <bala...@eik.bme.hu> wrote:
> On Tue, 24 Jan 2023, Howard Spoelstra wrote: > > On Tue, Jan 24, 2023 at 2:49 AM BALATON Zoltan <bala...@eik.bme.hu> > wrote: > >> On Tue, 24 Jan 2023, Howard Spoelstra wrote: > >>> From a Mac OS guest perspective, via=cuda is needed for Mac OS 9.0.4 > due > >> to > >>> the 2 usb devices (mouse/kbd) issue. And for 10.0/10.1 (my guess would > be > >>> that these suffer the same usb issue) > >>> The real powermac3,1 AGP has no adb. > >> > >> And do these OSes run on real PowerMac3,1? If so then we likely have a > bug > >> in USB emulation so maybe that could be fixed? In any case my patch does > >> not change mac99 and this should continue to work. > >> > >>> via=cuda supports Mac OS 9.0.4 up to OS X 10.4. via=pmu is strictly > only > >>> needed for Mac OS X 10.5 guest (for which the speed reported was hacked > >> to > >>> 900Mhz to fool the installer), but should support all Mac OS/OS X that > >> are > >>> now supported. > >> > >> Since via=pmu is what should be a real machine does it run OS X >=10.2 > >> already? > >> > > > > A real powermac3,1 (G4 400Mhz/AGP) runs 8.6 up to10.4.11 > > > > qemu-system-ppc status: > > 8.6 will not boot from CD or HD. > > 9.0.4* with via=pmu only supports mouse, not kbd. Needs via=cuda due to 2 > > usb device problem > > 9.1 and 9.2 with via=pmu > > 10.0 and 10.1 with via=pmu: no mouse and kdb. Needs via=cuda. (so also > with > > an usb problem) > > 10.2 with via=pmu (but has serious graphics speed problem, also with > > via=cuda) > > 10.3 and 10.4 with via=pmu > > 10.5 only with via=pmu (but needs the 900Mhz speed hack). > > > > *9.0.4 will only run with Mac OS Rom version 5.2.1 and above. > > 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) > 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. > (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? 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. > 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 ;-) > >> or even better updating the main docs in > >> > >> https://www.qemu.org/docs/master/system/ppc/powermac.html > >> > > That would have to be taken up by someone else. > > That page is generated from this file in QEMU source: > > > https://gitlab.com/qemu-project/qemu/-/blob/master/docs/system/ppc/powermac.rst > > you can submit a patch to that like I did: > > https://lists.nongnu.org/archive/html/qemu-ppc/2023-01/msg00006.html > > Regards, > BALATON Zoltan >