我正在尝试在Qemu源代码中添加自定义设备。以下是我在Qemu源代码中添加设备的步骤:
转到安装qemu的目录
然后
我在执行以下两个命令后sudo make CFLAGS =“-Wno-error”sudo make install
然后我使用自定义设备运行qemu以下是运行qemu>的脚本
:#!/bin/bash KERNEL="/lhome/priyamvad/debian_qemu_arm32/vmlinuz-3.16.0-6-armmp-lpae" INIT_IMAGE="/lhome/priyamvad/debian_qemu_arm32/initrd.img-3.16.0-6-armmp-lpae" DISK="/lhome/priyamvad/debian_qemu_arm32/hda30.qcow2" /lhome/priyamvad/arm_qemu_Setup/qemu/arm-softmmu/qemu-system-arm \ -M virt \ -m 1024 \ -smp 4 \ -kernel $KERNEL \ -object rng-random,filename=/dev/urandom,id=rng0 \ -device virtio-rng-device,rng=rng0 \ -initrd $INIT_IMAGE \ -append 'root=/dev/vda2' \ -drive if=none,file=$DISK,format=qcow2,id=hd \ **-device hello-world-device** \ -device virtio-blk-device,drive=hd \ -device virtio-net-device,netdev=usernet \ -netdev user,id=usernet,hostfwd=tcp::2222-:22 \ -nographic
当我在脚本上运行时,出现以下错误:
错误
qemu-system-arm:-device hello-world-device:'hello-world-device'是不是有效的设备型号名称
那么上述步骤中我缺少什么?
我正在尝试在Qemu源代码中添加自定义设备。以下是我在Qemu源代码中添加设备的步骤:转到安装qemu的目录,然后创建自定义...
您正在尝试编辑一些由configure and make流程自动生成的文件,因此在运行make时,所做的更改将再次被覆盖:config-devices.mak,config-devices.mak.old和config-all- devices.mak都是自动生成的。
您要放置新CONFIG_HELLO_DEVICE = y的位置在default-configs / arm-softmmu.mak中。然后hw / misc / Makefile.objs可以在“ common-obj-$(CONFIG_HELLO_DEVICE)+ = hello.o”这样的行中使用它。