簡體   English   中英

在 Ubuntu 上使用 qemu 模擬 raspiberry3 時沒有鍵盤和鼠標

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

當我嘗試使用 qemu 在 Ubuntu 上模擬 Raspberry Pi3 時,我沒有鍵盤和鼠標響應。 這是我的電話:

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 版本是:

QEMU 仿真器版本 7.0.50 (v7.0.0-2530-g8482ab545e) 版權所有 (c) 2003-2022 Fabrice Bellard 和 QEMU 項目開發人員

我在Ubuntu 18.04上運行

有什么想法嗎?

我剛剛發現發生了什么。 我使用的 kernel8.img 文件與應有的不同。 正確的文件應該在 RaspiOS 映像文件中。 所以我做了什么:

#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

所以,這樣我得到了正確的 kernel8.img 版本。 我也抓取了 .dtb 文件。

希望這些信息能有所幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM