Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
58 user(s) are online (37 user(s) are browsing Forums)

Members: 0
Guests: 58

more...

Support us!

Headlines

Forum Index


Board index » All Posts (balaton)




Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


@Maijestro

Yes QEMU supports all kinds of virtio devices already, only guest drivers would be needed to use them so this could be done by somebody who knows AmigaOS and needs no changes in QEMU.

Go to top


Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


@derfs
Quote:
I tried a few things and could not get it to work.


That's not a lot of detail to understand what you tried and how it did not work. Did you get an ok prompt and could continue booting AmigaOS? Did the driver try to talk to the card? You might be able to get some detailed logs with enabling vfio traces with -trace enable="vfio*" to see if it does something at all. Passing through an older and simpler card first may have higher chance of working than starting with the newest most complex one.

Quote:

I would guess its more complicated due to the single SATA sharing the PCIe x1 signals - link.


The linked datasheet also mentions that there are 2 PCIe buses, one 4 lane and one 1 lane. Fortunately the SATA is connected to the 1 lane and the 16x slot to the 4 lane PCIe bus so nothing is shared there. (Also we don't emulate the on board SATA so I would not care.) I think the first problem is that I did not fully implement the PCIe for sam460ex because we did not have use for it so far. I've started looking at cleaning up and enhancing that but as said there are other problems with sam460ex so trying to work with pegasos2 would be better.

Quote:

Thank you for your contributions over the years to get this emulation to a point where its very usable.


There seems to be still a lot to improve despite all that work so this may keep me busy for more years.

Go to top


Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


@Hans

Open sourcing the full Radeon driver may not be needed but publishing sample code for a simple frame buffer driver would definitely help. The docs on P96 API and driver writing docs were published recently by Individual Computers so if that's applicable for AOS4 too then these are available already but the sample code there is for 68k and supports a lot of stuff not needed for a simple driver. So a driver may be written based on that but for somebody without previous knowledge a simple example code might be more helpful to get started quickly.

Another part that would be useful to have open sourced is amigaboot.of which now needs the pegasos2.rom to run but if it was open source I could modify it to work with QEMU's minimal Virtual Open Firmware which can already boot MorphOS so if we had AmigaOS also work with that then we would not need the non-free firmware ROM any more. This could also help avoiding problems with the firmware as we could handle those in amigaboot.of which might even be useful for real machines later. But since I have no access to the source for amigaboot.of I can only reverse engineer and rewrite it from scratch to do that which would be simpler if this was released as open source.

I don't want to mention this further here to not derail this thread and keep it for discussing pegasos2 and sam460ex emulation in QEMU but in my view I could not write these emulations if QEMU was not open source so at least in some cases having open source is better. A large part of Apple's OSes are open source too and MorphOS also used AROS to reduce the work needed to write it so doing everthing closed is much more work than it should be needed otherwise and I'm not sure there's enough market left to support that work. But again let's not discuss this here to keep the thread on topic.

Go to top


Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


@geennaam
Quote:
I've ordered a PCIe to Pci bridge card in the name of science. So tomorrow we'll know if a Radeon 9250 will work.


At least that should work on real hardware according to https://wiki.amigaos.net/wiki/Pegasos_II
In the meantime you could try booting with your PCIe cards ignoring the errors from firmware as I wrote above (try " /failsafe" io to get the ok prompt back on serial where you can type the boot command or try typing the boot command blindly, see explanation in above posts) and see what happens.

Go to top


Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


@derfs

First of all what is gpu.rom, where did you get that and why is it needed? Can't it use the ROM on the card? It may need to be enabled from the host or QEMU run as root, I don't know but I'd just want to make sure the gpu.rom you're using is matching the card and should work at all.

The pegasos2 version at least tries to run the BIOS so it can at least see the card. Did you try to boot anyway and see what happens when the AmigaOS or MorphOS driver starts and if it can init the card itself? Since you have to type the boot command for pegasos2 you need to find out how to get input to the machine with a passed through card. Normally if you type in the window opened by QEMU that goes to the VM but I'm not sure what happens if you only have a passed through graphics card. Do you still have a QEMU window where you can type? If not you may try to add another graphics card such as -device VGA,romfile="" just to have a window where you can type the " /failsafe" io command or the boot command to get past the firmware and see what the OS driver can do with the passed through card, it would ignore the VGA device so that should not be a problem.

The sam460ex case does not seem to work at all, likely because we need more of the PCIe controller emulated. In the info qtree output the ROM is mapped at 0xa0000000 but if you check info mtree there's nothing there. Probably we need similar PCI windows for the PCIe bus that we have for PCI bus but I'm not sure which registers should control that. As I said I have no docs on 460EX so could only consult similar chips and those may work differently. The PCIe controller emulation is implemented at the very end of https://gitlab.com/qemu-project/qemu/- ... r/hw/ppc/ppc440_uc.c#L764 in case sombody wants to try to fix it just drop me an email if you work on it to avoid duplicated work.

Even if the sam460ex PCIe controller emulation would be fixed the CPU emulation on sam460ex is slower than on pegasos2. I've found the reason (related to software TLB emulation) but fixing it would need some more investigation and time so it's not likely it would be fixed in next QEMU release which means it may only be improved in 8.2 due in December so I think if it works with pegasos2 that may be better for now but you may have better luck with a PCI card than a PCIe card on pegasos2

Go to top


Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


@joerg @smarkusg

You are both right. There is a partial rv100 emulation option of ati-vga in QEMU but as almost all Radeon drivers use CCE it's not yet too useful. It only works with simple Linux framebuffer for now not with AmigaOS or MorphOS drivers so it would need more development to be usable that's why I did not advertise it.

Go to top


Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


@white
Quote:

I can't understand the concept of its working with Hostfwd and Port forwarding and this is a problem for me if I don't understand how it works I will never get it to work.


See https://goteleport.com/blog/x11-forwarding/ for some explanation. I think you should replace hostfwd=tcp::2222-:22 with hostfwd=tcp::6010-:6000 in your command line and then use DISPLAY=localhost:10

Go to top


Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


@Hans
Quote:

The Pegasos II UBoot issue is a show-stopper. It won't look behind a PCI-to-PCI(e) bridge, which means it won't configure cards behind a bridge, and the card also doesn't appear in the hardware list passed to the OS. It's like the card isn't there.


I'm not sure the guest would see the bridge but I'm no expert on vfio. I think the bridge is handled by the host and it can pass the PCI card to the guest where it just appears as another PCI card so the guest does not need to know about the bridge but I haven't tried that. I've heard though that some people managed to do that and boot MacOS with a Rage 128 so I think it's possible.

Quote:
This is explained in https://osdn.net/projects/qmiga/ticket/40018
That probably would be quite a bit of work.


Depends how much we want to emulate it. Emulating the micro engine is really hard because it's not documented so I don't know how to do that. Emulating what the microcode does and parsing the command packets is only boring but not difficult but it was already mostly done in Xenia emulator so maybe it could just be ported to QEMU. It's still a lot of work but not much experties is needed just somebody who wants to spend time with it.

Quote:
Quote:
If we are only concerned about one guest OS like AmigaOS then wrting a guest driver for QEMU's virtio devices may be easier and get better results.

Virtio drivers would be the best way forward for AmigaOS.


That's what I said. I could try that if there was some sample template driver available somewhere. The P96 page has a cirrus driver as a sample but that's quite complex and written in 68k assembly so may not be the best reference. Some FPGA projects have simpler uaegfx drivers that may be used as an example but if there's some better reference to get started it might help. Driving the QEMU card is really simple because no initialisation or any such things are needed so I think a simple frame buffer "driver" would be like 5 lines the rest only being boilerplate code for AmigaOS needs. This is where I would start before looking at virtio.

Go to top


Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


@derfs

The errors you got with sam460ex are explained here:
https://bugs.launchpad.net/qemu/+bug/1869006
from that it seems it tries to map something at guest address 0xf0000000 and it may be due to a problem in some Linux kernel versions if I gat that correctly but I'm not sure what is happening here and if that's not a side effect of a diiferent problem.

Looking at the code that runs in sam460ex U-Boot at
https://gitlab.com/qemu-project/u-boot ... m460ex/init_radeon.c#L216
(that @m3x may know more about) it looks like it decides which BAR to map not based on card type but if it's a PCIe card. So maybe you should connect the card to a PCIe bus which may be possble by adding ,bus=pcie.1 to the -device vfio-pci options but since I had no docs on the PCIe on the 460EX this may not be correctly emulated but maybe worth a try. You can verify with info qtree in the QEMU monitor where the card is connected. Experimenting with ati-vga I've found only the PCI bus (pci.0) and pcie.1 are checked by the firmware).

Does anybody know if ATI X550 card is supported by AmigaOS? I may have a card around somewhere which I could test but I think it's not supported by either AmigaOS nor MorphOS although X300 and X1000 which is probably similar are supported.

Go to top


Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


@geennaam @derfs

For pass-through let's discuss the pegasos2 and sam460ex cases separately. For the pegasos2 the bios emulator may crash on some ROMs but regardless of this the machine may be booted and if the guest OS driver can init the card itself then it may work. I haven't tried pass through as I don't have a suitable card but I can reproduce the issue with ati-vga. As I wrote in the email Maijestro forwarded:

./qemu-system-ppc -M pegasos2 -bios pegasos2.rom -device ati-vga -cdrom ~/Downloads/morphos-3.18.iso -serial stdio


will result in similar errors but the machine works just the display output is not visible as the card is not init'ed. But you can type in the QEMU window and see more errors but you can also boot MorphOS and then it inits the card and see picture. You can get back the firmware ok prompt on serial when this happens by blindly typing exactly the following (note there must be a space between the first quote and /failsafe, that's Forth not a typo):

" /failsafe" io


You have to type this in the QEMU window where the keyboard input would normally be and it won't be echoed but if successful then the ok prompt should appear where the errors are displayed and you can continue to type there to interact with the firmware. I'm not sure if you get a QEMU window with pass-thorugh but I think you should get some guest window, so type in that window not where the errors are. You only have one chance to type it without mistakes otherwise the io command breaks the input as well so if it did not work then restart the VM and try again.

You might also want to read https://osdn.net/projects/qmiga/wiki/DeveloperTips on the info qtree and info mtree QEMU monitor commands which may help debugging this and see where are the BARs of the card mapped.


Edited by balaton on 2023/6/24 12:23:29
Edited by balaton on 2023/6/24 12:24:02
Edited by balaton on 2023/6/24 20:14:42
Go to top


Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


@Hans
Quote:

As for using the emulated Radeon. My understanding is that qemu has an emulated Rage 128 Pro, and partial Mobility Radeon 7000 (a.k.a., M6). We don't have an ATI Rage driver, so that one is out.** The atiradeon.chip driver can handle the Radeon 7000 (IIRC, the Micro-A1 had it on-board), but I don't know if the mobility version needs any special handling. No guarantees that having an actual ROM would get it working.


As detailed on the qmiga development page on ati-vga the emulated Radeon 7000 is missing emulation of the micro-engine (aka CCE or PM4) so while the driver detects it and starts to talk to it it stops working when the driver enables the command processor. This could be emulated to make it work but somebody would need to port code for that from Xenia emulator as I haven't got to that yet because it's quire some work and so far I had enough to do on pegasos2 emulation and improving what's there. This is explained in https://osdn.net/projects/qmiga/ticket/40018

Emulating an ATI Radeon card would be good because it would work with all legacy systems that have a driver for it (almost all of them have) but these cards are quite complex so emulating them is not easy and due to emulating it the performance may be less than it could be (although likely still much faster than a real card).

If we are only concerned about one guest OS like AmigaOS then wrting a guest driver for QEMU's virtio devices may be easier and get better results.

Quote:
** AFAIK, MorphOS has an ATI Rage driver, so they may be using the emulated Rage 128 Pro.


Correct, the ati-vga by default emulates Rage 128 Pro which works with the simpler drivers that don't use CCE.

Go to top


Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


@joerg
Quote:

Quote:
This was already tested by Zoltan BALATON and unfortunately failed. For this he used the Classic version.

https://osdn.net/projects/qmiga/wiki/AmigaOSGfx
From the list of gfx cards mentioned there IMHO the Voodoo3/5 would be the only usable option. Not because it's a good gfx card, but because the Voodoo3/5 gfx driver is AFAIK the only AmigaOS PCI gfx card driver which works without an x86 emulator executing the gfx card BIOS ROM first. Several other AmigaOS gfx drivers do work that way as well, but only the ones for Zorro II/III bus gfx cards and the CSPPC local bus Permedia2 one (CyberVisionPPC), not any other PCI gfx card driver.
IIRC the classic Amiga kernel includes an x86 emulator as well, required for example for using ATI PCI gfx cards with a Mediator or Prometheus ZorroIIIPCI bridge, but the other kernels don't because executing the x86 gfx card BIOS is done by the machine firmware instead already before AmigaOS is started.

I don't think using pass-through instead of gfx card emulation is an option, at least not for the Pegasos2 emulation: The Pegasos2 only supported PCI and AGP, but not PCIe, i.e. you'd have to use a very old PC with PCI or AGP slots for it, and such old PCs have a way too slow CPU for usable speed in the QEmu PPC CPU emulation.


There exist PCIe to PCI bridges to connect PCI cards to modern systems. I've heard fhat those using a Pericom chip might be the best but this is not confirmed, just rumors. Also I'm not sure if the guest really has to support PCIe to pass through a card but it seems likely that having a PCIe card appear as a PCI card in the guest might cause problems and the driver could get confused so that's less likely to work.

The issue with the BIOS might not be fatal though as long as it works enough for the driver to find and init the card so I would not give up on that yet.

Go to top


Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


@terminills
Quote:
here's a little script that I fumbled through and I'm sure it needs some love.

https://github.com/terminills/qemu_scripts/blob/main/run_qemu.sh


This seems amazingly complex for just creating a command line but maybe it's usefui for some. You seem to have log_kernel_responses() function defined twice and maybe missing some quotes here and there so it could have problems with paths and file names containing spaces.

You said GPU pass through worked for you but maybe it would be helpful if you could share what GPU whan host and what guest you've tried.

Go to top


Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


@white

Quote:
Has anyone managed to get AmiCygnix working with qemu with
export DISPLAY ?


I've already sent you this via email before but I think you don't need tap for X you can just use the hostfwd option to forward right port and set DISPLAY accordingly. Port forwarding with user netdev is mentioned on the first page of the QEMU docs at https://www.qemu.org/docs/master/system/introduction.html where it uses -netdev user,id=unet,hostfwd=tcp::2222-:22 to let you connect to guest port 22 from host port 2222. You can do the same for X, assuming AmiCygnix listens on port 6000 for X then you can add e.g. -netdev user,id=unet,hostfwd=tcp::6010-:6000 then set DISPLAY to :10 on the host to display the X app on the guest.

Go to top


Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


Hello, Finally registered here but I don't have time now so will reply to the topics in detail later. (You can omit the welcome replies just to keep this already long thread a bit shorter.)

Go to top



TopTop
« 1 ... 46 47 48 (49)



Polls
Running AmigaOS 4 on?
AmigaOne SE/XE or microA1 12% (26)
Pegasos2 3% (8)
X5000 22% (48)
X1000 14% (30)
A1222 8% (19)
Sam 440/460 18% (40)
Classic PowerPC Amiga 2% (6)
WinUAE emulation 7% (16)
Qemu emulation 9% (21)
Total Votes: 214
The poll closed at 2025/12/1 12:00
6 Comments


Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project