MorphOS runs on QEmu
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Georg
    Posts: 111 from 2004/4/7
    Quote:

    Piru wrote:
    Quote:

    The goal was to use kvm-pr mode and use powerpc at full speed.
    With a Sam460ex it was not possible due it's book3e cpu.


    You can configure arbitrary CPU while using QEmu. I often use 750cxe and 7448 when testing (this is in combination with -machine mac99). I don't know how kvm-pr works exactly but it'd be mighty silly if it would somehow restrict the emulated CPU type.



    There would not be any emulation of CPU as same (PowerPC) CPU which runs Qemu natively would run MorphOS natively (through Qemu). Like VirtualBox + co. in x86 world. Or AROS/hosted on Linux.
  • »28.08.21 - 06:26
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 12195 from 2003/5/22
    From: Germany
    > I don't know how kvm-pr works exactly but it'd be mighty
    > silly if it would somehow restrict the emulated CPU type.

    See comments #149 and #161. KVM is not about (slow) CPU emulation but about (fast) CPU virtualization. With Power(PC) on Power(PC), KVM-PR lets user mode instructions be run directly but emulates supervisor/privileged instructions, as explained here and there. However, this only works with Book III-S on Book III-S (called just 'Book III' in PowerPC ISA and again as of Power ISA v3.0+), not with Book III-S on Book III-E (called 'Book E' during PowerPC ISA era), not with Book III-E on Book III-S, and interestingly also not with Book III-E on Book III-E.

    > if the kvm-pr can't emulate a MorphOS compatible CPU it won't work.

    It can, see link in comment #174. The issue lies elsewhere.

    > Pegasos II machine emulation doesn't give you any better options regarding this. […]
    > I see no way how Pegasos II machine emulation would improve the situation there.

    See above.
  • »28.08.21 - 10:05
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    ppcamiga1
    Posts: 215 from 2015/8/23
    There is almost no money in Morphos.
    Made Morphos open source and let everbody use it as they want.
    kvm why not?
    proces under ppc linux why not?
    emulator why not?
  • »28.08.21 - 10:06
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 12195 from 2003/5/22
    From: Germany
    > There would not be any emulation of CPU as same (PowerPC) CPU
    > which runs Qemu natively would run MorphOS natively (through Qemu).

    This would be KVM-HV, which virtualizes as guest CPU the very same CPU as the host CPU. KVM-PR provides partly direct execution, partly emulation, depending on instruction privilege level.
  • »28.08.21 - 10:24
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Flash
    Posts: 105 from 2019/11/1
    Quote:

    Piru wrote:
    Granted, I don't use kvm-pr myself so I have no intimate knowledge about the limitations it poses. Yet, I see no way how Pegasos II machine emulation would improve the situation there.


    Pegasos II virtual machine was addressed mainly to run OS4 on PowerMacs in KVM mode.
    The whole project is a work in progress, I'll have to give some feedback to Zoltan to enable KVM.
  • »28.08.21 - 11:48
    Profile Visit Website
  • MorphOS Developer
    jacadcaps
    Posts: 3114 from 2003/3/5
    From: Canada
    Quote:

    ppcamiga1 wrote:
    kvm why not?
    proces under ppc linux why not?
    emulator why not?



    Nobody stops you doing either of those.

    Quote:

    Made Morphos open source and let everbody use it as they want.


    My WebKit port is open source... nobody has even forked the repo so far. The people who would know what to do with those sources are already inside the MorphOS Team.
  • »28.08.21 - 13:27
    Profile Visit Website
  • MorphOS Developer
    Piru
    Posts: 587 from 2003/2/24
    From: finland, the l...
    I am well aware how KVM virtualization works in general. My point was that no amount of Pegasos II system emulation helps with whatever issues there are with it.
  • »28.08.21 - 16:37
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 12195 from 2003/5/22
    From: Germany
    > no amount of Pegasos II system emulation helps with whatever issues there are with it.

    Yes, but the basis to use QEMU for running MorphOS/OS4 on speedy POWER9 or OS4 on cheap G5 Macs, all without (full) CPU emulation, is now already there with the Pegasos II emulation, so that as soon as the issue that prevents running MorphOS or OS4 with KVM-PR is solved, the fun can begin for those inclined.

    Edit: some corrections

    [ Edited by Andreas_Wolf 29.08.2021 - 09:54 ]
  • »28.08.21 - 18:36
    Profile
  • MorphOS Developer
    Piru
    Posts: 587 from 2003/2/24
    From: finland, the l...
    Quote:

    Andreas_Wolf wrote:
    > no amount of Pegasos II system emulation helps with whatever issues there are with it.

    Yes, but the basis to use QEMU for running MorphOS/OS4 on speedy POWER9 or OS4 on cheap G5 Macs, all without (full) CPU emulation, is now already there with the Pegasos II emulation, so that as soon as the issue that prevents running MorphOS or OS4 with KVM-PR is solved, the fun can begin for those inclined.

    I still fail to see what this Pegasos II emulation brings to running MorphOS in QEmu. I see no benefits whatsoever over Mac99.

    If this is about some other OSes that's a completely different topic that I'm not interested in.
  • »29.08.21 - 00:19
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    ppcamiga1
    Posts: 215 from 2015/8/23
    Quote:

    The people who would know what to do with those sources are already inside the MorphOS Team.


    Maybee not.
    MOS Team loses nothing by made Morphos open source.
  • »29.08.21 - 06:12
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 12195 from 2003/5/22
    From: Germany
    > I still fail to see what this Pegasos II emulation brings to running MorphOS
    > in QEmu. I see no benefits whatsoever over Mac99. If this is about some
    > other OSes that's a completely different topic that I'm not interested in.

    Yes, you are right. The basis of running MorphOS with KVM-PR is already covered by the mac99 system emulation (but not by Sam460 emulation you mentioned in comment #162 and originally in comment #170, i.e. before you added Mac99 in an edit). So this is about an OS you're not interested in (as already said by Flash in comment #180).
  • »29.08.21 - 07:49
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Posts: 158 from 2019/4/6
    I was trying to recognize the "audio stick"
    I like to take tests :-)

    "the stick I use is regularly recognized by the real morphos hardware"

    I was wondering if this "poseidon" error is probably due to because I have not yet created a UDEV rule or is it possible to solve it within morphos?

    here is the log:
    13: 50: 01 | 0-poseidon.library: Welcome to poseidon 4.4 (15.3.18) © 2002-2018 by Chris Hodges (20090807)!
    13: 50: 01 | 0-poseidon.library: This is the PPC native MorphOS version.
    13: 50: 01 | 0-poseidon.library: Event broadcaster started.
    13: 50: 01 | 0-poseidon.library: Say hello to massstorage.class V4.9 (Supports storage devices via usbscsi.device (MOS)).
    13: 50: 01 | 0-poseidon.library: Whoah! hub.class V4.4 surprised as Root / external hub base class (MOS).
    13: 50: 01 | 0-poseidon.library: The door bell rang for hid.class V4.6 (Generic support for human interface devices (MOS)).
    13: 50: 01 | 0-poseidon.library: New hardware pciusb.device / 0 added (PCI OHCI USB 1.1 Host Controller (NEC)).
    13: 50: 01 | 0-poseidon.library: Root hub has been enumerated.

    13: 50: 01 | 20-poseidon.library: Opening pciusb.device unit 1 failed device / unit failed to open (-1).

    13: 50: 01 | 0-hub.class: Hub with 3 ports successfully configured.
    13: 50: 01 | 0-hub.class: I'm in love with hub 'PCI Root Hub Unit 0'.
    13: 50: 02 | 0-hub.class: Detected device 'QEMU USB Keyboard' at port 1. I like it.
    13: 50: 02 | 0-hub.class: Detected device 'QEMU USB Mouse' at port 2. I like it.
    13: 50: 02 | 0-hub.class: Detected device 'QEMU USB Hub' at port 3. I like it.
    13: 50: 02 | 0-hub.class: Hub has added 3 device (s). That'll be fun!
    13: 50: 02 | 0-hid.class: Using HID Descriptor from initial configuration run.
    13: 50: 02 | 0-hid.class: HID the road, 'QEMU USB Keyboard'!
    13: 50: 02 | 0-hid.class: Using HID Descriptor from initial configuration run.
    13: 50: 02 | 0-hid.class: HID the road, 'QEMU USB Mouse'!
    13: 50: 02 | 0-hub.class: Hub with 8 ports successfully configured.
    13: 50: 02 | 0-hub.class: I'm in love with hub 'QEMU USB Hub'.
    13: 50: 43 | 5-Trident: Forcing a DirScan for (new) classes, as you probably updated to a newer version.

    thanks for any suggestions :-)

    [ Edited by white 17.09.2021 - 22:17 ]
  • »17.09.21 - 20:09
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Posts: 158 from 2019/4/6
    I created a UDEV rule for the usb-audio device now qemu (morphos) is able to access the device and the device is recognized as audio-usb-device and recognizes the device with the correct name.
    Not everything is perfect but it is a small step forward.
    If I try to rescan the device stops working.
    Qemu probably needs to be recompiled for usb support (maybe)
    here the log of morphos:

    15: 20: 03 | 0-poseidon.library: Welcome to poseidon 4.4 (15.3.18) © 2002-2018 by Chris Hodges (20090807)!
    15: 20: 03 | 0-poseidon.library: This is the PPC native MorphOS version.
    15: 20: 03 | 0-poseidon.library: Event broadcaster started.
    15: 20: 03 | 0-poseidon.library: Say hello to massstorage.class V4.9 (Supports storage devices via usbscsi.device (MOS)).
    15: 20: 03 | 0-poseidon.library: Whoah! hub.class V4.4 surprised as Root / external hub base class (MOS).
    15: 20: 03 | 0-poseidon.library: The door bell rang for hid.class V4.6 (Generic support for human interface devices (MOS)).
    15: 20: 03 | 0-poseidon.library: New hardware pciusb.device / 0 added (PCI OHCI USB 1.1 Host Controller (NEC)).
    15: 20: 03 | 0-poseidon.library: Root hub has been enumerated.
    15: 20: 03 | 20-poseidon.library: Opening pciusb.device unit 1 failed device / unit failed to open (-1).
    15: 20: 03 | 0-hub.class: Hub with 3 ports successfully configured.
    15: 20: 03 | 0-hub.class: I'm in love with hub 'PCI Root Hub Unit 0'.
    15: 20: 04 | 0-hub.class: Detected device 'QEMU USB Keyboard' at port 1. I like it.
    15: 20: 04 | 0-hub.class: Detected device 'QEMU USB Mouse' at port 2. I like it.
    15: 20: 04 | 0-hub.class: Detected device 'QEMU USB Hub' at port 3. I like it.
    15: 20: 04 | 0-hub.class: Hub has added 3 device (s). That'll be fun!
    15: 20: 04 | 0-hid.class: Using HID Descriptor from initial configuration run.
    15: 20: 04 | 0-hid.class: HID the road, 'QEMU USB Keyboard'!
    15: 20: 04 | 0-hid.class: Using HID Descriptor from initial configuration run.
    15: 20: 04 | 0-hid.class: HID the road, 'QEMU USB Mouse'!
    15: 20: 04 | 0-hub.class: Hub with 8 ports successfully configured.
    15: 20: 04 | 0-hub.class: I'm in love with hub 'QEMU USB Hub'.
    15: 20: 04 | 0-hub.class: Detected device 'USB Audio Device ??????????????' at port 1. I like it.
    15: 20: 04 | 0-hub.class: Hub has added 1 device (s). That'll be fun!
    15: 20: 04 | 10-poseidon.library: GET_INTERFACE (1) failed: response timeout (6)
    15: 20: 04 | 10-poseidon.library: GET_INTERFACE (2) failed: response timeout (6)
    15: 20: 04 | 0-hid.class: Using HID Descriptor from initial configuration run.
    15: 20: 04 | 10-hid.class: GET_REPORT_DESCRIPTOR (60) failed: response timeout (6)!
    15: 20: 04 | 20-hid.class: Error parsing report descriptors!
    15: 20: 04 | 10-poseidon.library: GET_INTERFACE (1) failed: response timeout (6)
    15: 20: 04 | 10-poseidon.library: GET_INTERFACE (2) failed: response timeout (6)
    15: 20: 04 | 0-hid.class: Using HID Descriptor from initial configuration run.
    15: 20: 04 | 10-hid.class: GET_REPORT_DESCRIPTOR (60) failed: response timeout (6)!
    15: 20: 04 | 20-hid.class: Error parsing report descriptors!
    15: 20: 08 | 5-poseidon.library: Device USB Audio Device ?????????????? probably dropped dead!
    15: 20: 08 | 5-usbaudio.class: Recording mode with 1 ch @ 16b was assigned to 2 ch @ 16b output mode.
    15: 20: 08 | 10-poseidon.library: GET_INTERFACE (1) failed: response timeout (6)
    15: 20: 08 | 10-poseidon.library: GET_INTERFACE (2) failed: response timeout (6)
    15: 20: 08 | 10-hid.class: GET_REPORT_DESCRIPTOR (60) failed: response timeout (6)!
    15: 20: 08 | 20-hid.class: Error parsing report descriptors!

    here a small video of the test:
    https://www.youtube.com/watch?v=wTLi_UQfUro
  • »19.09.21 - 12:11
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Posts: 158 from 2019/4/6
    here instead how the usb-audio stick on the powerbook g4 is recognized:
    https://www.youtube.com/watch?v=4wvQ7ClU-5E
  • »19.09.21 - 15:02
    Profile
  • MorphOS Developer
    jacadcaps
    Posts: 3114 from 2003/3/5
    From: Canada
    I've tried experimenting with this and my bet would be that QEmu simply does not emulate the USB hardware well enough for MorphOS drivers to work.
  • »19.09.21 - 16:11
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    Posts: 158 from 2019/4/6
    @jacadcaps
    Yes, it's just fun for me
    I am very happy to use morphos on real machine and am having a lot of fun.
    I went back in time only now I have a much more powerful "amiga" that works with everything I try :-)

    I noticed that on a real machine the USB-audio and associated have:
    usb.audioclass and hid.class with poseidon

    while on qemu:
    usb.audioclass only

    also at the moment i get this error in the qemu window:
    qemu-system-ppc libusb_set_interface_alt_settings -5: notfound

    even if in the compilation of qemu the support is active for:
    libusb-1.0-0 libusb-1.0-0-dev

    it would be nice to make it work
    but if you've tried it and it doesn't work
    then most likely my hopes are nil :-)
  • »19.09.21 - 17:41
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Posts: 158 from 2019/4/6
    I tried to get close to the actual hardware setup.
    Now somehow the audio stick seems to "work"
    poseidon recognizes the hardware and rescan morphos works fine too.
    the device no longer receives "device death" but is not classified for example with: hid.class or other
    and also in qemu the libusb error disappears
    The only drawback is that in the audio settings it is not recognized as "usb audio" and therefore I cannot select it to enable it.

    If, on the other hand, someone wants to try this is the new UDEV rule I used:
    SUBSYSTEM == "usb", DRIVER == "snd-usb-audio", ATTRS {idVendor} == "0d8c", ATTRS {idProduct} == "0014", ATTR {authorized} = "0"

    then not to use sudo:
    ACTION == "add", SUBSYSTEM == "usb", ATTR {idVendor} == "0d8c", ATTR {idProduct} == "0014", OWNER = "white"

    this instead the previous UDEV that was recognized directly in MUSIC as USB-AUDIO:
    ACTION == "add", ATTR {idVendor} == "0d8c", ATTR {idProduct} == "0014", RUN + = "/ bin / sh -c 'echo 0> / sys / \ $ devpath / authorized'"

    but he had problems with the "death of the device"

    now I'm not an expert in this maybe someone can help.
    Thanks :-)

    maybe some parameters are missing in UDEV but I can't do better

    here instead the new log:
    16: 38: 19 | 0-poseidon.library: Welcome to poseidon 4.4 (15.3.18) © 2002-2018 by Chris Hodges (20090807)!
    16: 38: 19 | 0-poseidon.library: This is the PPC native MorphOS version.
    16: 38: 19 | 0-poseidon.library: Event broadcaster started.
    16: 38: 19 | 0-poseidon.library: Say hello to massstorage.class V4.9 (Supports storage devices via usbscsi.device (MOS)).
    16: 38: 19 | 0-poseidon.library: Whoah! hub.class V4.4 surprised as Root / external hub base class (MOS).
    16: 38: 19 | 0-poseidon.library: The door bell rang for hid.class V4.6 (Generic support for human interface devices (MOS)).
    16: 38: 19 | 0-poseidon.library: New hardware pciusb.device / 0 added (PCI OHCI USB 1.1 Host Controller (NEC)).
    16: 38: 19 | 0-poseidon.library: Root hub has been enumerated.
    16: 38: 19 | 20-poseidon.library: Opening pciusb.device unit 1 failed device / unit failed to open (-1).
    16: 38: 19 | 0-hub.class: Hub with 3 ports successfully configured.
    16: 38: 19 | 0-hub.class: I'm in love with hub 'PCI Root Hub Unit 0'.
    16: 38: 20 | 0-hub.class: Detected device 'QEMU USB Keyboard' at port 1. I like it.
    16: 38: 20 | 0-hub.class: Detected device 'QEMU USB Mouse' at port 2. I like it.
    16: 38: 20 | 0-hub.class: Detected device 'QEMU USB Hub' at port 3. I like it.
    16: 38: 20 | 0-hub.class: Hub has added 3 device (s). That'll be fun!
    16: 38: 20 | 0-hid.class: Using HID Descriptor from initial configuration run.
    16: 38: 20 | 0-hid.class: HID the road, 'QEMU USB Keyboard'!
    16: 38: 20 | 0-hid.class: Using HID Descriptor from initial configuration run.
    16: 38: 20 | 0-hid.class: HID the road, 'QEMU USB Mouse'!
    16: 38: 20 | 0-hub.class: Hub with 8 ports successfully configured.
    16: 38: 20 | 0-hub.class: I'm in love with hub 'QEMU USB Hub'.
    16: 38: 20 | 10-poseidon.library: SET_CONFIGURATION failed: endpoint stall (4)
    16: 38: 20 | 10-poseidon.library: No current configuration, huh?
    16: 38: 20 | 0-hub.class: Detected device 'USB Audio Device ??????????????' at port 1. I like it.
    16: 38: 20 | 0-hub.class: Hub has added 1 device (s). That'll be fun!
    16: 38: 20 | 10-poseidon.library: SET_CONFIGURATION failed: endpoint stall (4)
    16: 38: 20 | 10-poseidon.library: No current configuration, huh?
    16: 38: 20 | 10-poseidon.library: SET_CONFIGURATION failed: endpoint stall (4)
    16: 38: 20 | 10-poseidon.library: No current configuration, huh?
    16: 38: 24 | 10-poseidon.library: Forced device binding of USB Audio Device ?????????????? to hub.class failed.


    I put a video maybe the concept is clearer maybe you can configure it manually and be of help to those who want to try:
    https://www.youtube.com/watch?v=jJSZilWXe-Y

    [ Edited by white 20.09.2021 - 15:52 ]
  • »20.09.21 - 13:13
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    cip060
    Posts: 142 from 2010/7/30
    tanto non SUONA
  • »20.09.21 - 13:52
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Georg
    Posts: 111 from 2004/4/7
    I would first try getting this to work by running some Linux live cd with qemu. As long as that causes similiar problems you know it's not related to MorphOS/Poseidon.

    If you get it to work with Linux live cd, but still not with MorphOS, maybe try some AROS Live CD (uses Poseidon USB Stack, too).
  • »20.09.21 - 14:55
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Posts: 158 from 2019/4/6
    @Georg
    Thanks for the advice,
    i tried "aros 440 live" with sam460ex
    actually the problem is the same "death of the device"
    or it is recognized but no class.hid is associated for example.
    at this point it seems to be UDEV the problem I probably have the parameters are wrong or the USB-audio is not completely disabled on the host.
    I had also tested morphos with sam460ex and pegasos2 but the problems are the same,
    or it's simply not possible I don't know :-)

    [ Edited by white 20.09.2021 - 19:01 ]
  • »20.09.21 - 16:55
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Posts: 158 from 2019/4/6
    I am tenacious I wanted to get back on the test
    now works
    I have disabled all UDEV rules
    and I just did:
    "stop pulseaudio.socket"
    this is what creates the problem with libusb as well
    the only drawback is that qemu remains frozen
    once the usb-audio is recognized
    if instead I remove the usb-audio stick everything works again
    and is perfectly recognized with:
    usbaudio.class and hid.class as in "real hardware"

    here the video with the test:
    https://www.youtube.com/watch?v=nH1_b3gwxc0

    I hope it will be useful for qemu and add any improvements
  • »23.09.21 - 14:21
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    liquidbit
    Posts: 407 from 2003/10/12
    I want to buy MOS and use it through QEmu... does anyone know if this is possible ?
    ..there will be only one left.
  • »27.09.21 - 14:49
    Profile
  • MorphOS Developer
    jacadcaps
    Posts: 3114 from 2003/3/5
    From: Canada
    You can use it in demo mode. It is not possible to register MorphOS running on QEmu.
  • »27.09.21 - 15:38
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    Minuous
    Posts: 161 from 2010/2/12
    And consequently, since the SDK will not install in the allowed time, programmers wishing to support MorphOS can't use such a system for development.

    [ Edited by Minuous 28.09.2021 - 23:19 ]
  • »28.09.21 - 12:19
    Profile Visit Website
  • MorphOS Developer
    jacadcaps
    Posts: 3114 from 2003/3/5
    From: Canada
    Quote:

    Minuous wrote:
    And consequently, since the SDK will not install in the allowed time, programmers wishing to support MorphOS can't use such a system for development.


    I can install it just fine though. Perhaps your CPU is too slow for emulation. Then again, you really want to cross-compile in such case. QEmu's PPC emulation just isn't good enough and GCC will ICE / crash / crash QEmu eventually when compiling bigger projects.
  • »28.09.21 - 13:09
    Profile Visit Website