简体   繁体   English

在 Ubuntu 上使用 qemu 模拟 raspiberry3 时没有键盘和鼠标

[英]No keyboard and Mouse when using qemu to emulate raspiberry3 on Ubuntu

I have no keybord and mouse responding when i try emulates Raspberry Pi3 on Ubuntu with qemu.当我尝试使用 qemu 在 Ubuntu 上模拟 Raspberry Pi3 时,我没有键盘和鼠标响应。 This is my call:这是我的电话:

qemu-system-aarch64 -M raspi3b -append "rw earlyprintk loglevel=8 console=ttyAMA0,115200 dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootdelay=1" -dtb bcm2710-rpi-3-b.dtb -sd 2023.img -kernel kernel8.img -m 1G -smp 4 -usb -device usb-mouse -device usb-kbd qemu-system-aarch64 -M raspi3b -append "rw earlyprintk loglevel=8 console=ttyAMA0,115200 dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootdelay=1" -dtb bcm2710-rpi-3-b.dtb -sd 2023 .img -kernel kernel8.img -m 1G -smp 4 -usb -device usb-mouse -device usb-kbd

Everything runs fine, except i can't use mouse and keyboard一切运行良好,除了我不能使用鼠标和键盘

my qemu-system-aarch64 version is:我的 qemu-system-aarch64 版本是:

QEMU emulator version 7.0.50 (v7.0.0-2530-g8482ab545e) Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers QEMU 仿真器版本 7.0.50 (v7.0.0-2530-g8482ab545e) 版权所有 (c) 2003-2022 Fabrice Bellard 和 QEMU 项目开发人员

I running on Ubuntu 18.04我在Ubuntu 18.04上运行

Any ideias of what is going on?有什么想法吗?

I just found what was going on.我刚刚发现发生了什么。 I was using a kernel8.img file different from what it should be.我使用的 kernel8.img 文件与应有的不同。 The right file should be inside the RaspiOS image file.正确的文件应该在 RaspiOS 映像文件中。 So what i did:所以我做了什么:

#this way, you will see the partitions inside img. You should pay 
#attention to the start number of first partition(that is the
#boot partition of .img file)
fdisk -l RaspiOS.img 

#you must multiply this number by 512
losetup -o $[ 8192 * 512 ] /dev/loop30 RaspiOS.img   

#now, you must mount this partition to some folder
mkdir /mnt/raspi    
mount /dev/loop30 /mnt/raspi

//finally, you shoud copy kernel8.img to your host folder
cp /mnt/raspi/kernel8.img .

//and end all this
umount /mnt/raspi    
losetup -d /dev/loop30    
rmdir /mnt/raspi

So, this way i got the right kernel8.img version.所以,这样我得到了正确的 kernel8.img 版本。 I also grab the .dtb files too.我也抓取了 .dtb 文件。

Hope this info can help.希望这些信息能有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM