OSDev.org
https://forum.osdev.org/

Passing network traffic from macOS 11.5 to QEMU
https://forum.osdev.org/viewtopic.php?f=1&t=56100
Page 1 of 1

Author:  Princekin [ Sat Jan 22, 2022 11:57 pm ]
Post subject:  Passing network traffic from macOS 11.5 to QEMU

Hi:
I develop a custom os use qemu and use macos 11.5.2 as host, I use the net argument '-net nic,model=pcnet -net tap,ifname=tap0,script=no,downscript=no’ when run the qemu-system-i386,then I can get the network device in my custom os:

pci_device_dump: vendor id: 0x1022
pci_device_dump: device id: 0x2000
pci_device_dump: class code: 0x20000
pci_device_dump: revision id: 0x10
pci_device_dump: multi function: 0
pci_device_dump: card bus CIS pointer: 0
pci_device_dump: subsystem vendor id: 0
pci_device_dump: subsystem device id: 0
pci_device_dump: expansion ROM base address: feb80000
pci_device_dump: capability list pointer: 0
pci_device_dump: irq line: 11
pci_device_dump: irq pin: 1
pci_device_dump: min Gnt: 6
pci_device_dump: max Lat: 255
pci_device_dump: bar 0:
pci_device_bar_dump: type: io base address
pci_device_bar_dump: base address: c000
pci_device_bar_dump: len: 20
pci_device_dump: bar 1:
pci_device_bar_dump: type: mem base address
pci_device_bar_dump: base address: febd1000
pci_device_bar_dump: len: 20

I can send a message to the host from my custom os in qemu, but can’t receive a message from the host.

so I rebuild the qemu using this patch https://patchew.org/QEMU/[email protected]/, then I use the argument '-netdev vmnet-bridged,id=vmnet,ifname=en0’ to run the qemu-system-i386 again, this time, I can’t get the network device either and show warning: "qemu-system-i386: warning: netdev vmnet has no peer".

I don’t know why, how to use vmnet-bridged to send message to host from my custom os and receive a message from the host, what should I do? thanks a lot!

I had referenced from https://forum.osdev.org/viewtopic.php?f=1&t=39828, but it's older, when I build the version qemu,I got errors.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/