|
From: | Aijaz . Baig |
Subject: | Confused about using the logging facility! Logs won't show up |
Date: | Thu, 26 Dec 2019 05:11:40 +0000 |
Hello
I’m trying to experiment with adding a Qemu devices (ethernet/NIC) and it’s corresponding Linux driver. I’ve chosen to port the following ‘codeproject’ project:
https://www.codeproject.com/Articles/1087177/Linux-Ethernet-Driver-using-Qemu
Since this was written a couple of years back, it didn’t integrate with latest qemu directly so I modified the code like so:
https://github.com/qemu/qemu/compare/master...redbilledpanda:skel_eth
I am unable to ascertain whether this device is indeed getting realized or not.
I am invoking qemu like so:
‘qemu-system-arm -m 512M -M vexpress-a9 -D qemu.log -kernel buildroot-2019.02.5/output/images/zImage -dtb buildroot-2019.02.5/output/images/vexpress-v2p-ca9.dtb -append "console=ttyAMA0 ip=dhcp" -initrd buildroot-2019.02.5/output/images/rootfs.cpio -nographic -net nic -net bridge,br=mybridge’
On the linux kernel side, if I keep the existing driver for the board (aka lan9118), everything is A-OK and the machine boots up and I can see the log. However when I replace that with the (modified) driver from the aforementioned codeproject link, I get an (expected) kernel panic. Which can only mean that my device backend is still lan9118 and not skel_eth_dev (the one I added). I tried specifying the model explicitly while invoking qemu like so:
‘qemu-system-arm -m 512M -M vexpress-a9 -D qemu.log -kernel buildroot-2019.02.5/output/images/zImage -dtb buildroot-2019.02.5/output/images/vexpress-v2p-ca9.dtb -append "console=ttyAMA0 ip=dhcp" -initrd buildroot-2019.02.5/output/images/rootfs.cpio -nographic -net nic,model=skel_eth_dev -net bridge,br=mybridge’
This is the string I used in the ‘typeinfo’ structure while registering the device like so:
#define TYPE_SKEL_ETH_DEV "skel_eth_dev"
…
static const TypeInfo skel_eth_device_info = {$
.name = TYPE_SKEL_ETH_DEV,$
.parent = TYPE_SYS_BUS_DEVICE,$
.instance_size = sizeof(skel_eth_device_state),$
.class_init = skel_eth_device_class_init,$
};
To which I get the following error:
skel_eth_device: skel_eth_device_register_types
skel_eth_device: skel_eth_device_class_init
qemu-system-arm: Unsupported NIC model: skel_eth_dev
what are the two messages I see in the first two lines? And why does qemu say this model isn’t supported? I am unable to see any log message whatsoever in qemu.log
Keen to hear
Aijaz Baig
[Prev in Thread] | Current Thread | [Next in Thread] |