待辦事項 #48376

PCI NICs don't work with MorphOS

啟用日期: 2023-07-10 09:52 最後更新: 2023-07-20 08:46

回報者:
負責人:
類型:
狀態:
開啟 [Owner assigned]
元件:
里程碑:
(無)
優先權:
5 - 中
嚴重程度:
5 - 中
處理結果:
檔案:
2
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

細節

If I try to boot MorphOS using Pegasos 2 I cannot get any of the supported network cards (rtl8139, ne2k_pci, sungem) to work. They appear in the system network settings, but DHCP does not work, and attempting to run almost any network related utility, such as ping, ifconfig, etc. causes an error to pop up stating, Need version 0 of bsdsocket.library.

Similar configuration works with Debian PPC and AmigaOS where I found it necessary to specify "bus":"pci.1"', but otherwise it worked as expected. Leaving it on pci.0 doesn't work either for MorphOS. I have tried with both -bios pegasos2.rom and instead -kernel boot.img using the Virtual Open Firmware

qemu-system-ppc64 -name guest=MorphOS -machine pegasos2 -device ati-vga,romfile='',guest_hwcursor=true -bios pegasos2.rom -cpu 7447 -vga none -drive if=none,id=hd,format=qcow2,file=MorphOS.qcow2 -device ide-hd,drive=hd,bus=ide.0 -drive if=none,id=cd,media=cdrom,file=morphos-3.18.iso -device ide-cd,drive=cd,bus=ide.1 -serial stdio -netdev '{"type":"user","id":"hostnet0"}' -device '{"driver":"ne2k_pci","netdev":"hostnet0","bus":"pci.1"}'

I have been able to get a functioning network in MorphOS using ne2k_pci with mac99, the downside being there is no functioning audio option, whereas VIA-AC97 works on Pegasos 2 with MorphOS.

Ticket History (3/17 Histories)

2023-07-10 09:52 Updated by: jmontleon
  • New Ticket "PCI NICs don't work with MorphOS" created
2023-07-10 10:01 Updated by: jmontleon
評語

I mentioned DHCP not working, but to clarify, statically assigning the address doesn't make anything behave any better.

2023-07-10 20:47 Updated by: balaton
評語

What QEMU version are you using? For PCI cards such as network to work on pegasos2 you need at least QEMU 8.0 but using the latest git master or the soon to be released 8.1-rc0 version is recommended. Can you test wirh latest QEMU version in a few days when 8.1-rc0 is available? Using DHCP should work but if not and manually setting it up you can't use any IP address when using user netdev but have to use the NAT-ed internal network that DHCP would set up. I.e. IP address 10.0.2.15 as described here: https://www.qemu.org/docs/master/system/devices/net.html

Unless the command line is generated by some management layer and that's why it has strange things in it you could simplify it some: - With latest QEMU from 8.1 -cpu 7457 is the default so you can drop the -cpu option - Having -vga none is needed when using sm501 but adding a card which has vga like ati-vga will disable default vga so in this case not needed - mixing if=none and media in -drive options may not work, media is a shortcut for -drive if=none,... -device drive=.... so you could have either

-drive if=none,id=cd0 -device ide-cd drive=cd0 and -drive if=none,id=someid -device ide-hd,drive=someid or instead use rquivalent shortcut: -drive media=cdrom,file=... and -drive media=disk,ffile=... and then no corresponding -device options are needed. You command mixes the two ways.

- The network options can be written shorter as just -netdev user,id=net0 -device ne2k_pci,netdev=net0 - On pegasos2 the default pci bus is pci.1, pci.0 corresponds to the AGP port where you can also plug pci devices but unless you want it to be separate from other PCI devices there's no reason to cahnge it and leaving it on pci.1 (without any bus option) is probably matches the real machine best.

2023-07-10 21:44 Updated by: jmontleon
評語

I have tried with 8.0.0 and 8.0.2, apologies for not including that. I will try with git master as soon as I am able.

Apologies for some of the excess/overly long options. The network options are coming from libvirt. I had to use qemu overrides and commandline options in the config because it won't let me set the appropriate GPUs, select IDE drivers, etc. but I was able to get AmigaOS working well.

Libvirt is probably also why I observed the pci.0 vs pci.1 issue. I'd have to double check, but I think it's trying to place everything on pci.0 by default.

The -vga none came because I copied from AmigaOS 4.1 FE, which is working great with with sm501. The incorrect drive options are just my fault; they seem to be working even though I've botched them. I can boot, install, etc., but I'll try to fix them up. Thank you for the explanation and clarification on all this.

2023-07-11 08:56 Updated by: jmontleon
評語

Same thing using master. I see the dummy onboard device now, but the PCI device remains non-functional. I attached a screenshot to show what it looks like. It shouldn't be hard to reproduce as it happens whether booting off the ISO or installed on a disk image.

qemu-system-ppc64 -name guest=MorphOS -machine pegasos2 -bios pegasos2.rom -device ati-vga,romfile='',guest_hwcursor=true -drive if=none,id=hd,format=qcow2,file=MorphOS.qcow2 -device ide-hd,drive=hd,bus=ide.0 -drive media=cdrom,file=morphos-3.18.iso -serial stdio -netdev user,id=net0 -device driver=ne2k_pci,netdev=net0

Just switching the ISO to debian and booting I can verify network works pulling up a shell in the installer after completing the network autoconfiguration. Screenshot attached showing that as well.

qemu-system-ppc64 -name guest=MorphOS -machine pegasos2 -bios pegasos2.rom -device ati-vga,romfile='',guest_hwcursor=true -drive if=none,id=hd,format=qcow2,file=MorphOS.qcow2 -device ide-hd,drive=hd,bus=ide.0 -drive media=cdrom,file=debian-8.11.0-powerpc-DVD-1.iso -serial stdio -netdev user,id=net0 -device driver=ne2k_pci,netdev=net0

2023-07-11 21:28 Updated by: balaton
評語

The dummy on board eth device was added to avoid delays when starting network related activities but it's not supposed to work other than that and does not seem to affect this issue either so you can ignore that. I can repoduce the problem now but don't know how to fix as you can see it works with other OSes so this may be something specific to MorphOS. The bsdsocket error I think happens when the network stack did not start correctly but I could not find where it writes debug log to search for some errors. In the advanced tab of network prefs debug level is set to 7 and shows a log file name there but I don't know where to look for that file. LogTool shows nothing so I don't know how to debug this further at the moment.

(Edited, 2023-07-11 21:30 Updated by: balaton)
2023-07-11 21:48 Updated by: jmontleon
評語

Thanks for confirming. I agree that the error is probably due to the network stack not coming up, and I had a similarly difficult time trying to generate anything meaningful in MorphOS. What little I can get for logs appear in RAM:T. But running any of the network configuration commands either generate the same error, or produces nothing meaningful even with debug flags. I tried to gather a filter dump last night using qemu, but there was basically nothing, which I think also lends to the idea that the network stack just isn't coming up. I'll poke at it a little more and see if I can learn anything new.

On the plus side, with qemu master MorphOS and AmigaOS both shutdown properly now so something has been gained.

Thanks again for taking a look.

(Edited, 2023-07-11 21:50 Updated by: jmontleon)
2023-07-14 07:35 Updated by: jmontleon
評語

I was reading over at https://www.amigans.net/modules/newbb/viewtopic.php?post_id=141042 and decided to try the patch from #787 which did not yield any change.

Prior to that I also noted that there is no bsdsocket.library error in 7.2.1, although I still could not get any of the drivers to pass network traffic.

But I did start removing drivers and rebooting. I removed ahi.device, rebooted and instantly I could tell networking was working because the Networks icon appeared on the desktop. I confirmed I can ping and connect to other systems. It seems something related to the new audio device.

I did also learn that you can boot, for example: boot cd boot.img ramdebug and then when the system starts you can run getramdebuglog to get a morphos.log file with some debug info. You can add extra debug: boot cd boot.img ramdebug ed pci and get a bunch of additional info about pci devices. I had trouble finding a full list of valid options.

2023-07-14 14:44 Updated by: jmontleon
評語

If I instead move the PEGASOS audio mode file out of the way network comes up. I can then AddAudioMode Files Work:PEGASOS and audio starts working. Network continues working, which is interesting... it should be possible to script around it as a workaround.

2023-07-14 21:01 Updated by: balaton
評語

I think before QEMU 8.0 the PCI cards did not generate any interrupt as the PCI INT lines were not connected to VT8231 so that's likely why you did not get error but it also could not work. This could be bisected but probably does not get us clser to the cause. Or are you saying you could get it work without AHI on 7.2.1? That would be surprising, I think you just meant this helps in versions after PCI IRQs were fixed. There's definitely a problem with handling multiple interrupts but I don't have time now to work on that so this likely won't get fixed for QEMU 8.1. I also don't fully nuderstand the problem yet so I can only try some chnages going back to my original patch updated to the latest recommendations that were shared on QEMU list and hope that works better but I can only do this later so don't have anything to test yet.

2023-07-14 21:43 Updated by: jmontleon
評語

I was not able to get anything to work with 7.2.1, other than it didn't cause the bsdsocket.library errors. The network cards showed up, but did not work.

With 8 (I'm using master at this point so I guess what will eventually be 8.1) if I prevent audio from fully loading until after the network loads both seem to work fine.

I saw the conversation about the alternate interrupt implementations. I was trying to follow from the conversation which of the other 8 versions from the patch set would be best to try as an alternative. If you can say which you were most satisfied with I can work on applying a diff and see if I can get any further. Otherwise I can wait and be patient; it's nothing important, other than my curiosity.

2023-07-15 03:49 Updated by: balaton
評語

I meant the original first version of that series, all later versions were cripled by people wanting to over-simplify it. But there were other changes since then so that would not apply any more on master. I've ported it now to the current master and uploaded it on the pegasos2 branch of git here under source code above. Make sure to checkout the pegasos2 branch if you want to compile from there or apply the three patches from there (two reverts and one patch). But since you've found that it works when loading sound later I don't think these patches would make a differentce just like the other workaround didn't so I think it's a different issue not related to the IRQ problem reported with AmigaOS, I've ported the patches mainly to be able to test it for the other issue with AmigaOS to find a fix for that.

(Is OSDN also slow for you now? For me the web is barely usable but git still seems to work.)

2023-07-15 06:38 Updated by: jmontleon
評語

Thanks, I'll take a look this weekend. Worst case it doesn't make a difference.

And yes OSDN has been awful. It has been almost constant 504 Gateway Time-Out errors since before my first post here. I'm happy to move/merge this conversation elsewhere if makes it easier.

2023-07-16 11:18 Updated by: jmontleon
評語

I applied the last three patches from your branch to master and as you suspected it didn't fix the sound/network issue.

2023-07-20 08:46 Updated by: balaton
評語

OSDN still seems to be dying and may have lost some info from this ticket. This was here before but now gone, I've added it back for reference:

"But I did start removing drivers and rebooting. I removed ahi.device, rebooted and instantly I could tell networking was working because the Networks icon appeared on the desktop. I confirmed I can ping and connect to other systems. It seems something related to the new audio device.

If I instead move the PEGASOS audio mode file out of the way network comes up. I can then AddAudioMode Files Work:PEGASOS and audio starts working. Network continues working, which is interesting... it should be possible to script around it as a workaround.

I was not able to get anything to work with 7.2.1, other than it didn't cause the bsdsocket.library errors. The network cards showed up, but did not work.

With 8 (I'm using master at this point so I guess what will eventually be 8.1) if I prevent audio from fully loading until after the network loads both seem to work fine."

(Edited, 2023-10-02 03:18 Updated by: balaton)

Attachment File List

編輯

Please login to add comment to this ticket » 登入