Qemu Pegasos II board - ready for a next release
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Flash
    Posts: 105 from 2019/11/1
    I subscribed Qemu dev ML some time ago to follow at best any improvement about emulation/virtualization of amiga hardware via software.
    In latest days seems Balaton Zoltan, major contributor for "Amigalike" support in Qemu, is ready to release a new virtual board.
    So after the Sam460ex will be released finally another Amiga board -> Pegasos II Qemu virtual board.
    Looking inside proposed patches you can see its capability to already boot correctly in MorphOS.
    So in a next time we will have a double choice to run AmigaNG systems: Sam460ex and Pegasos II.
    And both supports MorphOS :-)

    So.. I'd like to ask MOS Team if there is interest in this kind of solutions and, more in general, what they think about this kind of projects.
    I have read some developer uses already qemu for debugging purposes (via mac emulation I suppose).
  • »04.01.21 - 13:11
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    eliot
    Posts: 564 from 2004/4/15
    How is 3D acceleration supported in qemu?
    regards
    eliot
  • »04.01.21 - 13:53
    Profile
  • MorphOS Developer
    zukow
    Posts: 642 from 2005/2/9
    From: Poland
    It depends on emulated gfx card so no support for amigalike systems. Such release will be more important for AmigaOS4.x users as they will finally be able to run OS4 on PowermacG5s with full cpu speed.

    [ Edited by zukow 04.01.2021 - 15:04 ]
  • »04.01.21 - 13:59
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 12058 from 2003/5/22
    From: Germany
    > I subscribed Qemu dev ML some time ago to follow at best
    > any improvement about emulation/virtualization of amiga
    > hardware via software.

    Just FYI, the ML archive is public, so subscribing isn't mandatory for passively following.

    > Looking inside proposed patches you can see its capability
    > to already boot correctly in MorphOS.

    Yes, that's also what the author wrote on the QEMU PPC ML a month ago.
  • »04.01.21 - 21:44
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Flash
    Posts: 105 from 2019/11/1
    So finally we have a "pegasos2" machine in qemu, this is the update message in qemu ml

    "Add new machine called pegasos2 emulating the Genesi/bPlan Pegasos II, a PowerPC board based on the Marvell MV64361 system controller and the VIA VT8231 integrated south bridge/superio chips. It can run Linux, AmigaOS and a wide range of MorphOS versions. Currently a firmware ROM image is needed to boot and only MorphOS has a video driver to produce graphics output. Linux could work too but distros that supported this machine don't include usual video drivers so those only run with serial console for now."
    Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>

    All should be ready for next QEmu 6.0 release.
  • »07.01.21 - 07:36
    Profile Visit Website
  • Butterfly
    Butterfly
    kas1e
    Posts: 97 from 2005/10/31
    @zukov

    > It depends on emulated gfx card so no support for amigalike systems. Such release will be more important for AmigaOS4.x users as they will finally be able to run OS4 on PowermacG5s with full cpu speed.

    I do not know the details well, but do you mean there will be no QEMU emulator dropdowns in speed even if it will use the host's CPU? I mean, it still will be slower than native IMHO. Besides, it probably lucks audio driver and RadeonR92xx driver (with all compositing things working) and that probably will be never implemented or well-tested in an acceptable time? Or there already some audio/video drivers support being done?


    EDIT: I read that KVM can run a guest OS at 95-98% of the host’s native performance, so if that indeed true, and pegasos2 emulation can bring the same kind of speed on some latest G5 Macs, then it's about time to buy some latest G5 to have botch MOS and OS4 on it.. Through QEMU should be run from something, so it will mean MacOS probably necessary too.

    [ Edited by kas1e 07.01.2021 - 10:57 ]
  • »07.01.21 - 10:46
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Flash
    Posts: 105 from 2019/11/1
    On Powermacs I use linuxppc to run qemu.
    For latest 5.2 release I had to resolve many new dependencies to let it compile, anyway it works but it's too slow in sam460ex and powerpc emulation.
    With pegasos2 board "should" be finally possible to virtualize cpu via KVM and run at full speed.

    NB:
    Both powermacs and pegasos2 share the same cpu (book3s) so virtualizations is possible, sadly with sam460ex the emulated cpu belongs to a different family (book3e) and thus it had to be emulated with a huge slowdown.
  • »07.01.21 - 12:02
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 12058 from 2003/5/22
    From: Germany
    > do you mean there will be no QEMU emulator dropdowns in speed
    > even if it will use the host's CPU? I mean, it still will be slower than
    > native IMHO. [...] EDIT: I read that KVM can run a guest OS at 95-98%
    > of the host’s native performance

    Running a guest OS in QEMU KVM-PR mode makes the user mode instructions run directly on the host CPU and the supervisor/privileged mode instructions run emulated. Thus, the overall performance depends on the distribution of the executed instructions, i.e. the less supervisor/privileged instructions the better the performance.

    > QEMU should be run from something, so it will mean MacOS
    > probably necessary too.

    I'm not sure that current/future QEMU versions can run on 11½ years old MacOS.

    > it probably lucks audio driver and RadeonR92xx driver (with all compositing
    > things working) [...]? Or there already some audio/video drivers support being done?

    Audio: QEMU can emulate Ensoniq AudioPCI ES1370 chipset (deployed on Sound Blaster PCI128 card), which OS4 has drivers for. So if QEMU can't emulate the Pegasos II onboard audio, you can always insert a virtual SB128 sound card into the virtual Pegasos II.
    Graphics: Correct, no Radeon or compositing etc. yet. However, I think it should be possible to insert a virtual SM501/SM502 graphics card into the virtual Pegasos II (as had to be done for running MorphOS on QEMU PowerMac3,1/mac99 emulation before the Rage 128 Pro emulation emerged).
  • »07.01.21 - 20:49
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    ernsteiswuerfel
    Posts: 545 from 2015/6/18
    From: Funeralopolis
    Qemu may gain Pegasos II support, whereas the kernel may loose Pegasos II support (klick). :-o
    Talos II. [Gentoo Linux] | PMac G5 11,2. PMac G4 3,6. PBook G4 5,8. [MorphOS 3.18 / Gentoo Linux] | Vampire V4 SA [ApolloOS / Amiga OS 3.2.2]
  • »10.01.21 - 18:24
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Flash
    Posts: 105 from 2019/11/1
    Another reason to go on pegasos2 integration in qemu.
    Virtual board will never broke and will improve speed, compatibility and features over years.
    Better than a good old wine :-)
  • »10.01.21 - 21:12
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 12058 from 2003/5/22
    From: Germany
    > the kernel may loose Pegasos II support

    THE kernel? Ah, fortunately just the Linux kernel, not the MorphOS/PPC kernel (Quark) ;-)

    > klick

    I read this a little differently:

    "Some of these look like they are no longer actively maintained or used, but I'm not doing anything about those unless the maintainers would like me to: [...]
    * powerpc/chrp (32-bit rs6000, pegasos2): last updated in 2009
    "

    As I read it, this means that support will stay in for the time being unless the maintainer (who?) wants it removed. The supporters are already starting to line up :-)
    Overall, I don't think that the future (non-)ability to run a then-current Linux on QEMU-emulated/virtualized Pegasos II has a relevance. Why emulate/virtualize a Pegasos II in QEMU to run Linux on it when QEMU is already running on Linux on the host?
  • »10.01.21 - 23:45
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 12058 from 2003/5/22
    From: Germany
    >> the kernel may loose Pegasos II support

    > Another reason to go on pegasos2 integration in qemu.

    This I don't get. Why should an inability to run new Linux versions on a system be "another reason" to have that system emulated?
  • »11.01.21 - 00:06
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Flash
    Posts: 105 from 2019/11/1
    Time always consumes and try to kickoff all things what are considered obsolete.
    I understand but really dont' like it.
    The stop of drop of new linux kernels for pegasos2 is an example in that direction and IMHO a sort of mistake.
    It can be rebalanced in some way by adding pegasos2 in qemu, letting it still survive in a next future.
  • »11.01.21 - 08:18
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    ernsteiswuerfel
    Posts: 545 from 2015/6/18
    From: Funeralopolis
    Quote:

    Andreas_Wolf schrieb:
    THE kernel? Ah, fortunately just the Linux kernel, not the MorphOS/PPC kernel (Quark) ;-)

    True. ;-)

    Quote:

    As I read it, this means that support will stay in for the time being unless the maintainer (who?) wants it removed. The supporters are already starting to line up :-)

    True. But no one lined up for the AOne or the Peg2 yet, only for some of the ARM boards and for the Alpha.

    My guess is that this 'deprecation request' will be made again in some time, annually (?) perhaps. PPC Maintainer btw is Michael Ellerman. Most probably all CCed people in the 1st post are arch maintainers. Recently PowerPC 601 support got thrown out, which I don't miss - but some people will probably miss the AOne or Peg2. ;-)

    Quote:

    Overall, I don't think that the future (non-)ability to run a then-current Linux on QEMU-emulated/virtualized Pegasos II has a relevance. Why emulate/virtualize a Pegasos II in QEMU to run Linux on it when QEMU is already running on Linux on the host?

    A good use of such QEMU-emulated machines is for bisecting/working on bugs on specific archs. Not every maintainer of some software has ppc/ppc64/arm/aarch64/mips/etc. hardware lying around to test his stuff on, but he can use QEMU.

    This has been quite handy for some Linux bugs I reported on ppc/ppc64. The devs often use ppc64 workstations in Little Endian mode and may not be able to reproduce many bugs which happen on my PowerMac G4. Most certainly not when it's about (Linux) kernel bugs.

    The question is how much longer the Peg2 'hardware' will stay in QEMU when there is no Linux kernel for the Peg2 to boot? I dunno. Are there existing conventions for that case?
    Talos II. [Gentoo Linux] | PMac G5 11,2. PMac G4 3,6. PBook G4 5,8. [MorphOS 3.18 / Gentoo Linux] | Vampire V4 SA [ApolloOS / Amiga OS 3.2.2]
  • »11.01.21 - 08:33
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 12058 from 2003/5/22
    From: Germany
    >> The supporters are already starting to line up :-)

    > no one lined up for the AOne or the Peg2 yet [...]. [...]
    > some people will probably miss the AOne or Peg2. ;-)

    Maybe you should have clicked my link to encounter one of them. Here's another supporter.

    > A good use of such QEMU-emulated machines is for bisecting/working
    > on bugs on specific archs. Not every maintainer of some software has
    > ppc [...] hardware lying around to test his stuff on, but he can use QEMU.

    I doubt Pegasos II emulation is needed for this purpose as QEMU already emulates well other Linux-supported PPC32 hardware, among them also other G4-based hardware (like PowerMac3,1/mac99). Zoltan Balaton has been making no secret of his motivation to create a Pegasos II emulation, and it's not Linux-related. Furthermore, bug hunting of Linux software doesn't require QEMU system emulation as QEMU user-mode emulation is to be preferred for this.
    Bottom line: I'm still not convinced regarding the correlation between QEMU's Pegasos II emulation and the (non-)ability of the Pegasos II (emulation) to run Linux.

    > The question is how much longer the Peg2 'hardware' will stay in
    > QEMU when there is no Linux kernel for the Peg2 to boot? I dunno.
    > Are there existing conventions for that case?

    I'm not aware of Linux capability being a prerequisite for a machine to be allowed in QEMU. Zoltan always recommends the most recent MorphOS ISO image for testing the emulation anyway :-)
  • »11.01.21 - 22:38
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    ernsteiswuerfel
    Posts: 545 from 2015/6/18
    From: Funeralopolis
    Quote:

    Andreas_Wolf schrieb:
    [...] Furthermore, bug hunting of Linux software doesn't require QEMU system emulation as QEMU user-mode emulation is to be preferred for this.

    [...]
    Bottom line: I'm still not convinced regarding the correlation between QEMU's Pegasos II emulation and the (non-)ability of the Pegasos II (emulation) to run Linux.

    Not regular software bugs yes, but Linux kernel bugs.

    Didn't want to convince you. ;-) Anyway, meanwhile several devs stood up for the Peg2 so it is safe to stay for the time being.

    Quote:

    I'm not aware of Linux capability being a prerequisite for a machine to be allowed in QEMU. Zoltan always recommends the most recent MorphOS ISO image for testing the emulation anyway :-)

    Ah, didn't knew that. Nice! :-D
    Talos II. [Gentoo Linux] | PMac G5 11,2. PMac G4 3,6. PBook G4 5,8. [MorphOS 3.18 / Gentoo Linux] | Vampire V4 SA [ApolloOS / Amiga OS 3.2.2]
  • »13.01.21 - 14:37
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 12058 from 2003/5/22
    From: Germany
    >> QEMU already emulates well other Linux-supported PPC32 hardware,
    >> among them also other G4-based hardware (like PowerMac3,1/mac99).
    >> [...] Furthermore, bug hunting of Linux software doesn't require QEMU
    >> system emulation as QEMU user-mode emulation is to be preferred for this.

    > Not regular software bugs yes, but Linux kernel bugs.

    As said, that's what long-existing PowerMac3,1/mac99 emulation or other PPC32 system emulations are perfectly fine for.

    > meanwhile several devs stood up for the Peg2
    > so it is safe to stay for the time being.

    Yes, Arnd Bergmann's summary for "powerpc/chrp (32-bit rs6000, pegasos2)" and others:

    "a couple of users replied, but no architecture maintainer added any information, so I won't take any action."
    https://www.lkml.org/lkml/2021/1/13/746
  • »13.01.21 - 20:59
    Profile