@All So happy to share that i have working virtio-net.device for amigaos4/qemu, so you have no more needs to tinker with rtl device issues !
Big thanks coming to derfs who made a base for that with his virtioSCSI.device, with code from which were matter of "just" add a SANA2 support and get rid of SCSI code. Also thanks to Neil Cafferkey who share his network drivers code for prism2 and atheros5000, it also help with os4 bits.
For one day it was some boring/AI cleaning to just start and make ping 127.0.0.1 to work, then bunch of crashes and issues (of course) of all sort, which were dealt only with Neil's code of drivers, then some debugging as always, and yeah !
(click to open in new tab for full sized images):
detected device in Ranger, network settings and ping of localhost
actually working state
debug split without which you can't fix a shit
Now all what need it is to remove debug output, check the speed (and improve if possible), and that all !
For one day it was some boring/AI cleaning to just start and make ping 127.0.0.1 to work, then bunch of crashes and issues (of course) of all sort, which were dealt only with Neil's code of drivers, then some debugging as always, and yeah !
So if you managed to clean AI cruft from the virtio part it's time to make that a virtio.library so others don't have to clean the other drivers one by one an won't have this code repeated in all drivers but can all use the same virtio.library so if one driver improves it all the others can benefit.
I not sure, and i can be wrong, but it looks like it share same issues which i have with rtl ! Need to be double sure, but so far i can see how my network died after a while, and i start to have packet loss even on ping. But that of course can be easy bugs in this device, but strangely repeats same issues as with rtl .. Maybe some of you can check how it reacts on your qemus. Thanks!
I not sure, and i can be wrong, but it looks like it share same issues which i have with rtl !
Did you try it with your WSL2 QEmu setup already? Even if it's slower it may be stable as IIRC the AmigaOS 4.x RTL drivers are working with QEmu running on Linux and MaxOS hosts and there are only problems with (some?) Windows hosts. It may be the same for your virtio-net.device.
I.e. lines just exactly same, just change "rtl8139" on "virtio-net-pci,disable-legacy=on"
@joerg Quote:
Did you try it with your WSL2 QEmu setup already? Even if it's slower it may be stable as IIRC the AmigaOS 4.x RTL drivers are working with QEmu running on Linux and MaxOS hosts and there are only problems with (some?) Windows hosts. It may be the same for your virtio-net.device.
Currently tried only directly on own win64 build, where it seems that once i surf a bit with odyssey, then whole stack start to acts : i tried to ping in another console same what i were able to ping normally, and have 66% of packet loss. Then reboot, and all fine. Remind me same issue i have with rtl driver , when i start to do something, it like works, and then all going to crawl. But will check on wsl2 build as well to see how it will be ..
The rtl8139 AmigaOS driver author has looked at it before and also checked the emulation in QEMU and could not find any problem in either of those so it could well be the issue is somewhere else. It could be in AmigaOS common SANAII code or network stack too. That it works on real machines does not mean the AmigaOS side does not have race conditions that do not happen as long as things are slow as on real machine but could break when replies come faster than expected (sometimes instantly) on emulation that may never happen on real machines. It could also be in QEMU's Windows version as that's less tested but since all network cards use the same netdev backends in QEMU and a lot of people use those it should not be completely broken so it's more likely to be either in rtl8139 emulation (which does not seem to be the case), pegasos2 emulation (you could try with other machines to check) or somewhere on the AmigaOS side but not in other parts of QEMU.
It also freezes on Asahi Linux ARM64 (Fedora). But it's a little different than RTL8139. Small packets still get through. On RTL8139, access is completely cut off.
Now my question, Roadshow (maybe a stupid one). From what I've read, it works strangely even on real machines. The INTERNET speed is poor. You can get some good values on the LAN. Is there a problem there? I don't currently know how packets are transmitted through QEMU. QEMU definitely emulates network cards, but what if a guest (AOS4 with an old TCP/IP stack) gets a “large packet” exceeding some limit (10Mb/100Mb/1Gb)? It will try to limit it, but it won't be able to handle it... will it crash? I'm just writing theoretically - these are just my random thoughts and I may be talking nonsense. One last thing: qemu-system-ppc and MacOS 9 PPC and Linux PPC work fine. There are no problems there.