Diff for /wikisrc/ports/evbarm/qemu_arm.mdwn between versions 1.3 and 1.8

version 1.3, 2014/01/11 23:04:46 version 1.8, 2019/12/03 12:52:20
Line 1 Line 1
 [[!meta title="NetBSD/evbarm under QEMU"]]  [[!meta title="NetBSD/evbarm under QEMU"]]
 This page attempts to document running NetBSD/evbarm under the  This page attempts to document running NetBSD/evbarm under the
 [QEMU](http://wiki.qemu.org/Main_Page) open source processor emulator.  [QEMU](http://www.qemu.org/) open source processor emulator.
 This can be extremely useful for development and testing.  This can be extremely useful for development and testing.
 This is a placeholder until useful information gets added; once that  # Requirements
 is done, it should be linked to the port/evbarm page.  * qemu 4.1.0 or higher
   * disk image
     * [NetBSD 9.x armv7](http://nycdn.netbsd.org/pub/NetBSD-daily/netbsd-9/latest/evbarm-earmv7hf/binary/gzimg/armv7.img.gz)
     * [NetBSD 9.x arm64](http://nycdn.netbsd.org/pub/NetBSD-daily/netbsd-9/latest/evbarm-aarch64/binary/gzimg/arm64.img.gz)
   * Tianocore EDK2 firmware
     * [QEMU_EFI.fd for armv7](http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/latest/QEMU-ARM/RELEASE_GCC5/QEMU_EFI.fd)
     * [QEMU_EFI.fd for arm64](http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/latest/QEMU-AARCH64/RELEASE_GCC5/QEMU_EFI.fd)
 # Introduction  # Installing QEMU on NetBSD
  - general notes for what works and what doesn't go here.  You can install latest qemu with the following commands.
   It is assumed that your pkgsrc tree is in /usr/pkgsrc directory.
 # Requirements      # cd /usr/pkgsrc/emulators/qemu
  - information on what is needed (QEMU versions known to work or not,      # make install
    pointers to how to install via pkgsrc or whatever)  
  - also information on which evbarm kernels are known to be able to boot  # Preparing the disk image
    under QEMU.  
   The disk image (armv7.img.gz or arm64.img.gz) must first be uncompressed. The *qemu-img* tool can then resize the image to the desired size. On first boot, NetBSD will grow the root file-system to match the size of the disk.
       $ gunzip arm64.img.gz
       $ qemu-img resize arm64.img 20g
   # Booting the system (arm64)
       $ qemu-system-aarch64 -M virt -cpu cortex-a53 -smp 4 -m 4g \
             -drive if=none,file=arm64.img,id=hd0 -device virtio-blk-device,drive=hd0 \
             -netdev type=user,id=net0 -device virtio-net-device,netdev=net0,mac=00:11:22:33:44:55 \
             -bios QEMU_EFI.fd -nographic
   # Booting the system (armv7)
       $ qemu-system-arm -M virt -cpu cortex-a15 -smp 4 -m 2g \
             -drive if=none,file=armv7.img,id=hd0 -device virtio-blk-device,drive=hd0 \
             -netdev type=user,id=net0 -device virtio-net-device,netdev=net0,mac=00:11:22:33:44:55 \
             -bios QEMU_EFI.fd -nographic
   # Bridged networking
 # Booting and Installation  To bridge a QEMU guest to your network, you need to create a tap(4) interface for your VM, then connect it to a physical interface with a bridge(4) interface.
  - maybe some information about how to actually boot a kernel, first  
  - how to get networking/etc working  
  - what kinds of userland are supported and how to get there.   
 # Using QEMU to debug the kernel  The following example assumes NetBSD as a host OS, and a physical interface named *bge0*.
  - there is info elsewhere on the wiki about this; maybe adapt to ARM  
    and link?  
 # Additional links  [[!template  id=filecontent name="/etc/ifconfig.bridge0" text="""
   descr "LAN VM bridge" up
   !brconfig bridge0 add bge0
 # What works  [[!template  id=filecontent name="/etc/ifconfig.tap0" text="""
   link f2:0b:a4:d1:f2:69 descr "NetBSD Arm64 VM" up
   !brconfig bridge0 add tap0
 # What needs work  Then replace the *-netdev* part of the qemu command with:
 # more info      -net nic -net tap,ifname=tap0,script=no

Removed from v.1.3  
changed lines
  Added in v.1.8

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb