Hello Alex, thanks for your answer. I have qemu 5.2.0, which prints:
$ qemu-system-arm -M help|grep rasp raspi0 Raspberry Pi Zero (revision 1.2) raspi1ap Raspberry Pi A+ (revision 1.1) raspi2 Raspberry Pi 2B (revision 1.1) (alias of raspi2b) raspi2b Raspberry Pi 2B (revision 1.1) but it contains docs/system/arm/raspi.rst . That file contains: https://git.qemu.org/?p=qemu.git;a=blob;f=docs/system/arm/raspi.rst;h=922fe375a672ca970d3b0f71d39061cd58862002;hb=553032db17440f8de011390e5a1cfddd13751b0b Raspberry Pi boards (``raspi0``, ``raspi1ap``, ``raspi2b``, ``raspi3ap``, ``raspi3b``) ======================================================================= =============== QEMU provides models of the following Raspberry Pi boards: ``raspi0`` and ``raspi1ap`` ARM1176JZF-S core, 512 MiB of RAM ``raspi2b`` Cortex-A7 (4 cores), 1 GiB of RAM ``raspi3ap`` Cortex-A53 (4 cores), 512 MiB of RAM ``raspi3b`` Cortex-A53 (4 cores), 1 GiB of RAM So, while the bundled documentation in qemu 5.2.0 says that the device raspi3b is supported, qemu-system-arm -M help does not list the device. https://en.wikipedia.org/wiki/Raspberry_Pi says Raspberry Pi 3B uses ARMv8-A (64/32-bit) + BCM2837B0 or BCM2837 These inconsistent facts make very difficult to understand what is supported and what not. The problem with the documentation at https://github.com/dhruvvyas90/qemu-rpi-kernel/tree/master/native-emuation is that I get no Network within the VM, after I follow the documentation, while I get network, when boot a generic kernel with a versatile dtb on a verstailepb machine. * Please align the qemu-system-arm -M help output with the raspi.rst documentation (on 5.2) to state what boards are supported. * How can I get network (LAN and WiFi) within the qemu-VM by using -M raspi2/3 ? Greetings Дилян On Thu, 2021-02-18 at 11:57 +0000, Alex Bennée wrote: > > Дилян Палаузов <dilyan.palau...@aegee.org> writes: > > > Hello, > > > > I download the Rapsberry OS > > image > > https://downloads.raspberrypi.org/raspios_armhf/images/raspios_armhf-2021-01-12/2021-01-11-raspios-buster-armhf.zip > > > > the kernel kernel-qemu-4.19.50-buster and versatile-pb-buster.dtb > > from https://github.com/dhruvvyas90/qemu-rpi-kernel and run with > > version 5.2.0: > > > > > > $ qemu-system-arm -dtb ./versatile-pb-buster.dtb -kernel ./kernel- > > qemu- > > 4.19.50-buster -cpu arm1176 -m 256 -M versatilepb > > You are attempting to boot a generic kernel with a versatile dtb on a > verstailepb machine. The site you link to even has pointers towards > "native-emulation" for using the -M raspi2/3 models. > > The documentation also lists the current status of the emulation: > > https://qemu.readthedocs.io/en/latest/system/arm/raspi.html > > > -append > > "root=/dev/sda2 rootfstype=ext4 rw" -drive driver=raw,file=./2021-01- > > 11-raspios-buster-armhf.img,index=0,media=disk -serial stdio > > > > > > 1. On the running system I type “sudo poweroff”. Why do I get this > > error, instead of clean shutdown: > > > > [ OK ] Removed slice system-systemd\x2dfsck.slice. > > [ OK ] Reached target Shutdown. > > [ OK ] Reached target Final Step. > > [ OK ] Started Power-Off. > > [ OK ] Reached target Power-Off. > > reboot: System halted > > Kernel panic - not syncing: Attempted to kill init! > > exitcode=0x00000000 > > > > CPU: 0 PID: 1 Comm: systemd-shutdow Not tainted 4.19.50+ #1 > > Hardware name: ARM-Versatile (Device Tree Support) > > [<c001d230>] (unwind_backtrace) from [<c00190ac>] > > (show_stack+0x10/0x14) > > [<c00190ac>] (show_stack) from [<c0025f14>] (panic+0xc8/0x240) > > [<c0025f14>] (panic) from [<c0028444>] (do_exit+0x950/0x9fc) > > [<c0028444>] (do_exit) from [<c0042440>] (sys_reboot+0x1a0/0x1f0) > > [<c0042440>] (sys_reboot) from [<c0009000>] > > (ret_fast_syscall+0x0/0x54) > > Exception stack(0xcf823fa8 to 0xcf823ff0) > > 3fa0: 00000000 00000000 fee1dead 28121969 4321fedc > > 26f8ad00 > > 3fc0: 00000000 00000000 00000000 00000058 00000fff be905c08 00000000 > > 00424b80 > > 3fe0: 00436e3c be905b88 004214a8 b6e54a38 > > ---[ end Kernel panic - not syncing: Attempted to kill init! > > exitcode=0x00000000 > > ]--- > > > > > > 2. The raspberry Pi OS image has two partitions, fdisk -l > > > > 2021-01-11-raspios-buster-armhf.img1 8192 532479 524288 > > 256M c W95 FAT32 (LBA) > > 2021-01-11-raspios-buster-armhf.img2 532480 7741439 7208960 > > 3.4G 83 Linux > > > > > > so I can mount the first one it with > > > > sudo mount -o offset=4194304 -t vfat 2021-01-11-raspios-buster- > > armhf.img disk/ > > > > It contains: $ ls > > > > bcm2708-rpi-b.dtb* bcm2709-rpi-2-b.dtb* bcm2711-rpi-4- > > b.dtb* fixup4cd.dat* fixup_db.dat* kernel.img* start4x.elf* > > bcm2708-rpi-b-plus.dtb* bcm2710-rpi-2-b.dtb* bcm2711-rpi- > > cm4.dtb* fixup4.dat* fixup_x.dat* LICENCE.broadcom* > > start_cd.elf* > > bcm2708-rpi-b-rev1.dtb* bcm2710-rpi-3-b.dtb* > > bootcode.bin* fixup4db.dat* issue.txt* > > overlays/ start_db.elf* > > bcm2708-rpi-cm.dtb* bcm2710-rpi-3-b-plus.dtb* > > cmdline.txt* fixup4x.dat* kernel7.img* > > start4cd.elf* start.elf* > > bcm2708-rpi-zero.dtb* bcm2710-rpi-cm3.dtb* > > config.txt* fixup_cd.dat* kernel7l.img* > > start4db.elf* start_x.elf* > > bcm2708-rpi-zero-w.dtb* bcm2711-rpi-400.dtb* > > COPYING.linux* fixup.dat* kernel8.img* start4.elf* > > > > > > Why does the internet say, that the bundled in the raw image kernels > > cannot be used with Qemu, but the one I have written above must be > > used? > > > > Can youn give me a suggestion, how to run Qemu 5.2, so that it > > emulates Rasberry 3A+, Raspberry 3B, and Rapsberry 3B+ with WiFi > > card? > > > > Thanks > > Дилян > >