qemu-rpi-kernel
qemu-rpi-kernel copied to clipboard
why my pc can not come in gui (err:guest has not initialized the display (yet))
1、My pc:
2、I want to simulate the Raspberry Party
3、I installed QEMU
4、I am prepared file
5、I am using the command
6、Election information qemu-system-arm -M versatilepb -cpu arm1176 -m 256 -drive 'F:\Raspberry Pi\qemu\raspberyyOS\2021-10-30-raspios-bullseye-armhf-full.img,if=none,index=0,media=disk,format=raw,id=disk0' -device "virtio-blk-pci,drive=disk0,disable-modern=on,disable-legacy=off" -net "user,hostfwd=tcp::5022-:22" -dtb F:\Raspberry Pi\qemu\raspberyyOS\versatile-pb-buster-5.4.51.dtb -kernel F:\Raspberry Pi\qemu\raspberyyOS\kernel-qemu-5.4.51-buster -append 'root=/dev/vda2 panic=1' -no-reboot
PS F:\RaspberryPi\qemu> .\qemu-system-arm -kernel .\raspberyyOS\kernel-qemu-5.10.63-bullseye -cpu arm1176 -m 256 -M versatilepb -dtb .\raspberyyOS\versatile-pb-bullseye-5.10.63.dtb -no-reboot -append “root=/dev/sda2 panic=1 rootfstype=ext4 rw” -net nic -net user,hostfwd=tcp::5022-:22 -drive file="F:\RaspberryPi\qemu\raspberyyOS\2021-10-30-raspios-bullseye-armhf-full.img",index=0,media=disk,format=raw -serial stdio vpb_sic_write: Bad register offset 0x2c Booting Linux on physical CPU 0x0 Linux version 5.10.63 (jmh205@jmh205pc) (arm-linux-gnueabihf-gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1 Thu Dec 16 11:31:22 GMT 2021 CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d CPU: VIPT aliasing data cache, unknown instruction cache OF: fdt: Machine model: ARM Versatile PB Memory policy: Data cache writeback Zone ranges: Normal [mem 0x0000000000000000-0x000000000fffffff] Movable zone start for each node Early memory node ranges node 0: [mem 0x0000000000000000-0x000000000fffffff] Initmem setup node 0 [mem 0x0000000000000000-0x000000000fffffff] Built 1 zonelists, mobility grouping on. Total pages: 64960 Kernel command line: root=/dev/sda2 panic=1 rootfstype=ext4 rw Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear) Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear) mem auto-init: stack:off, heap alloc:off, heap free:off Memory: 250548K/262144K available (6500K kernel code, 273K rwdata, 1608K rodata, 220K init, 171K bss, 11596K reserved, 0K cma-reserved) NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16 VIC @(ptrval): id 0x00041190, vendor 0x41 FPGA IRQ chip 0 "interrupt-controller" @ (ptrval), 20 irqs, parent IRQ: 47 random: get_random_bytes called from start_kernel+0x2ac/0x4cc with crng_init=0 clocksource: arm,sp804: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275 ns sched_clock: 32 bits at 1000kHz, resolution 1000ns, wraps every 2147483647500ns Failed to initialize '/amba/timer@101e3000': -22 sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns Console: colour dummy device 80x30 printk: console [tty0] enabled Calibrating delay loop... 864.25 BogoMIPS (lpj=4321280) pid_max: default: 32768 minimum: 301 Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) cgroup: Disabling memory control group subsystem CPU: Testing write buffer coherency: ok Setting up static identity map for 0x8220 - 0x827c devtmpfs: initialized VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5 clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns futex hash table entries: 256 (order: -1, 3072 bytes, linear) NET: Registered protocol family 16 DMA: preallocated 256 KiB pool for atomic coherent allocations OF: amba_device_add() failed (-19) for /amba/smc@10100000 OF: amba_device_add() failed (-19) for /amba/mpmc@10110000 OF: amba_device_add() failed (-19) for /amba/sctl@101e0000 OF: amba_device_add() failed (-19) for /amba/watchdog@101e1000 OF: amba_device_add() failed (-19) for /amba/sci@101f0000 OF: amba_device_add() failed (-19) for /amba/spi@101f4000 OF: amba_device_add() failed (-19) for /amba/fpga/sci@a000 Serial: AMBA PL011 UART driver 101f1000.uart: ttyAMA0 at MMIO 0x101f1000 (irq = 28, base_baud = 0) is a PL011 rev1 printk: console [ttyAMA0] enabled 101f2000.uart: ttyAMA1 at MMIO 0x101f2000 (irq = 29, base_baud = 0) is a PL011 rev1 101f3000.uart: ttyAMA2 at MMIO 0x101f3000 (irq = 30, base_baud = 0) is a PL011 rev1 10009000.uart: ttyAMA3 at MMIO 0x10009000 (irq = 54, base_baud = 0) is a PL011 rev1 vgaarb: loaded SCSI subsystem initialized clocksource: Switched to clocksource arm,sp804 NET: Registered protocol family 2 IP idents hash table entries: 4096 (order: 3, 32768 bytes, linear) tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear) TCP established hash table entries: 2048 (order: 1, 8192 bytes, linear) TCP bind hash table entries: 2048 (order: 1, 8192 bytes, linear) TCP: Hash tables configured (established 2048 bind 2048) UDP hash table entries: 256 (order: 0, 4096 bytes, linear) UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear) NET: Registered protocol family 1 RPC: Registered named UNIX socket transport module. RPC: Registered udp transport module. RPC: Registered tcp transport module. RPC: Registered tcp NFSv4.1 backchannel transport module. PCI: CLS 0 bytes, default 32 NetWinder Floating Point Emulator V0.97 (double precision) workingset: timestamp_bits=14 max_order=16 bucket_order=2 Installing knfsd (copyright (C) 1996 [email protected]). jffs2: version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc. romfs: ROMFS MTD (C) 2007 Red Hat, Inc. 9p: Installing v9fs 9p2000 file system support Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252) io scheduler mq-deadline registered io scheduler kyber registered pl061_gpio 101e4000.gpio: PL061 GPIO chip registered pl061_gpio 101e5000.gpio: PL061 GPIO chip registered pl061_gpio 101e6000.gpio: PL061 GPIO chip registered pl061_gpio 101e7000.gpio: PL061 GPIO chip registered versatile-pci 10001000.pci: host bridge /amba/pci@10001000 ranges: versatile-pci 10001000.pci: IO 0x0043000000..0x004300ffff -> 0x0000000000 versatile-pci 10001000.pci: MEM 0x0050000000..0x005fffffff -> 0x0050000000 versatile-pci 10001000.pci: MEM 0x0060000000..0x006fffffff -> 0x0060000000 versatile-pci 10001000.pci: PCI core found (slot 11) versatile-pci 10001000.pci: PCI host bridge to bus 0000:00 pci_bus 0000:00: root bus resource [bus 00-ff] pci_bus 0000:00: root bus resource [io 0x0000-0xffff] pci_bus 0000:00: root bus resource [mem 0x50000000-0x5fffffff] pci_bus 0000:00: root bus resource [mem 0x60000000-0x6fffffff pref] pci 0000:00:0c.0: [1000:0012] type 00 class 0x010000 pci 0000:00:0c.0: reg 0x10: [io 0x0000-0x00ff] pci 0000:00:0c.0: reg 0x14: [mem 0x00000000-0x000003ff] pci 0000:00:0c.0: reg 0x18: [mem 0x00000000-0x00001fff] PCI: bus0: Fast back to back transfers disabled pci 0000:00:0c.0: BAR 2: assigned [mem 0x50000000-0x50001fff] pci 0000:00:0c.0: BAR 1: assigned [mem 0x50002000-0x500023ff] pci 0000:00:0c.0: BAR 0: assigned [io 0x1000-0x10ff] versatile-tft-panel 10000000.sysreg:display@0: no panel detected drm-clcd-pl111 10120000.display: set up callbacks for Versatile PL110 brd: module loaded loop: module loaded sym53c8xx 0000:00:0c.0: enabling device (0100 -> 0103) sym0: <895a> rev 0x0 at pci 0000:00:0c.0 irq 66 sym0: No NVRAM, ID 7, Fast-40, LVD, parity checking sym0: SCSI BUS has been reset. scsi host0: sym-2.2.3 scsi 0:0:0:0: Direct-Access QEMU QEMU HARDDISK 2.5+ PQ: 0 ANSI: 5 scsi target0:0:0: tagged command queuing enabled, command queue depth 16. scsi target0:0:0: Beginning Domain Validation scsi target0:0:0: Domain Validation skipping write tests scsi target0:0:0: Ending Domain Validation scsi 0:0:2:0: CD-ROM QEMU QEMU CD-ROM 2.5+ PQ: 0 ANSI: 5 scsi target0:0:2: tagged command queuing enabled, command queue depth 16. scsi target0:0:2: Beginning Domain Validation random: fast init done scsi target0:0:2: Domain Validation skipping write tests scsi target0:0:2: Ending Domain Validation sr 0:0:2:0: Power-on or device reset occurred sr 0:0:2:0: [sr0] scsi3-mmc drive: 16x/50x cd/rw xa/form2 cdda tray cdrom: Uniform CD-ROM driver Revision: 3.20 sd 0:0:0:0: Power-on or device reset occurred sd 0:0:0:0: [sda] 18096128 512-byte logical blocks: (9.27 GB/8.63 GiB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA physmap-flash 34000000.flash: versatile/realview flash protection physmap-flash 34000000.flash: physmap platform flash device: [mem 0x34000000-0x37ffffff] 34000000.flash: Found 1 x32 devices at 0x0 in 32-bit bank. Manufacturer ID 0x000000 Chip ID 0x000000 Intel/Sharp Extended Query Table at 0x0031 Using buffer write method sda: sda1 sda2 sd 0:0:0:0: [sda] Attached SCSI disk tun: Universal TUN/TAP device driver, 1.6 smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre [email protected] smc91x 10010000.net eth0: SMC91C11xFD (rev 1) at (ptrval) IRQ 41
smc91x 10010000.net eth0: Ethernet addr: 52:54:00:12:34:56 rtc-ds1307 0-0068: registered as rtc0 rtc-ds1307 0-0068: setting system clock to 2021-12-24T12:17:18 UTC (1640348238) versatile reboot driver registered device-mapper: ioctl: 4.43.0-ioctl (2020-10-01) initialised: [email protected] mmci-pl18x fpga:05: mmc0: PL181 manf 41 rev0 at 0x10005000 irq 59,60 (pio) mmci-pl18x fpga:0b: mmc1: PL181 manf 41 rev0 at 0x1000b000 irq 49,50 (pio) leds-syscon 10000000.core-module:[email protected]: registered LED (null) leds-syscon 10000000.core-module:[email protected]: registered LED (null) leds-syscon 10000000.core-module:[email protected]: registered LED (null) leds-syscon 10000000.core-module:[email protected]: registered LED (null) leds-syscon 10000000.core-module:[email protected]: registered LED (null) leds-syscon 10000000.core-module:[email protected]: registered LED (null) leds-syscon 10000000.core-module:[email protected]: registered LED (null) leds-syscon 10000000.core-module:[email protected]: registered LED (null) ledtrig-cpu: registered to indicate activity on CPUs IPVS: Registered protocols (TCP, UDP, SCTP, AH, ESP) input: AT Raw Set 2 keyboard as /devices/platform/amba/amba:fpga/10006000.kmi/serio0/input/input0 IPVS: Connection hash table configured (size=4096, memory=32Kbytes) IPVS: ipvs loaded. IPVS: [rr] scheduler registered. IPVS: [wrr] scheduler registered. IPVS: [lc] scheduler registered. IPVS: [wlc] scheduler registered. IPVS: [fo] scheduler registered. IPVS: [ovf] scheduler registered. IPVS: [lblc] scheduler registered. IPVS: [lblcr] scheduler registered. IPVS: [dh] scheduler registered. IPVS: [sh] scheduler registered. IPVS: [mh] scheduler registered. IPVS: [sed] scheduler registered. IPVS: [nq] scheduler registered. ipip: IPv4 and MPLS over IPv4 tunneling driver ipt_CLUSTERIP: ClusterIP Version 0.8 loaded successfully NET: Registered protocol family 17 Bridge firewalling registered 8021q: 802.1Q VLAN Support v1.8 9pnet: Installing 9P2000 support drm-clcd-pl111 10120000.display: set up callbacks for Versatile PL110 drm-clcd-pl111 10120000.display: set up callbacks for Versatile PL110 uart-pl011 101f1000.uart: no DMA platform data input: ImExPS/2 Generic Explorer Mouse as /devices/platform/amba/amba:fpga/10007000.kmi/serio1/input/input2 drm-clcd-pl111 10120000.display: set up callbacks for Versatile PL110 EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null) VFS: Mounted root (ext4 filesystem) on device 8:2. devtmpfs: mounted Freeing unused kernel memory: 220K Kernel memory protection not selected by kernel config. Run /sbin/init as init process systemd[1]: Failed to look up module alias 'autofs4': Function not implemented systemd[1]: systemd 247.3-6+rpi1 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=unified) systemd[1]: Detected architecture arm.
Welcome to Raspbian GNU/Linux 11 (bullseye)!
systemd[1]: Set hostname to
Raspbian GNU/Linux 11 raspberrypi ttyAMA0
raspberrypi login: pi Password: Linux raspberrypi 5.10.63 #1 Thu Dec 16 11:31:22 GMT 2021 armv6l
The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Fri Dec 24 12:18:10 GMT 2021 on tty1 pi@raspberrypi:~$
7、qemu information
8、What should I do to enter the desktop?
Hello, you can try native emulation (instead of using versatilepb) using Qemu's raspi2/3 machine and see if it works.
Try using the 5.4.x kernels, as the 5.10.x kernels (from my experience) do not display, and only print to serial.
The native emulations have no keyboard or mouse support, so you will still have to use serial only.
Additionally, using the versatilepb emulation with GUI will only work with the older versions (I have tested the 3.x kernels with wheezy + LXQT). The newer versions of Raspberry Pi OS don't seem to boot into a GUI due to the limitations on the memory and processing power.
@ishangxue : Can you try the suggestions by MrMan314 ? Thanks.
I can't get video to work either. I followed the instructions to the letter, but nothing shows up. I tried both the latest bullseye OS image (2022-04-04-raspios-bullseye-arm64.img
) as well as the legacy one (2022-04-04-raspios-buster-armhf.img
). I tried both versatilepb and raspi3b.
Example:
qemu-system-aarch64 \
-M raspi3b \
-append "rw earlyprintk loglevel=8 console=ttyAMA0,115200 dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootdelay=1" \
-kernel native-kernel/kernel8.img \
-dtb native-kernel/bcm2710-rpi-3-b-plus.dtb \
-m 1G \
-smp 4 \
-serial stdio \
-usb -device usb-mouse -device usb-kbd \
-sd 2022-04-04-raspios-buster-armhf.img
This prints the boot process on the terminal and it gets to the raspberrypi login:
prompt. But the qemu window is completely black.
Is a video device even emulated?
Well, apparently you can't download the image from the site the README.md links to (https://www.raspberrypi.org/downloads/raspbian/). It won't work.
I had to download this instead (found on another guide):
https://downloads.raspberrypi.org/raspios_armhf/images/raspios_armhf-2021-01-12/2021-01-11-raspios-buster-armhf.zip
This one worked right away with native emulation:
It would probably be a good idea to link to a working image directly, rather than to the RPi OS download page which only provides downloads for images that don't work anymore.
Additionally, using the versatilepb emulation with GUI will only work with the older versions (I have tested the 3.x kernels with wheezy + LXQT). The newer versions of Raspberry Pi OS don't seem to boot into a GUI due to the limitations on the memory and processing power.
The latest version of Raspberry Pi OS Bookworm starts the GUI perfectly fine in versatilepb, which makes sense because the ARM1176 CPU we emulate in QEMU is the same CPU in the Raspberry Pi 1 and Zero, which Raspberry Pi OS Bookworm runs perfectly fine on.