This is an addendum to Kernel debugging with QEMU with additional instructions specific to NetBSD/macppc.

Installing the emulator

When using pkgsrc, the PPC emulator is part of the "qemu" package. On other systems you may have to install a separate packages such as "qemu-system-ppc".

Installing the Target System

Installation of the target system is the same as for x86_64 except for the release URL ending in "/macppc/":

 $ anita --workdir work --disk-size 10G --memory-size 256M \
     --sets kern-GENERIC,modules,base,etc,comp,debug,games,man,misc,tests,text,syssrc,src,sharesrc,gnusrc \
     install http://nycdn.netbsd.org/pub/NetBSD-daily/HEAD/latest/macppc/

Booting the VMs

NetBSD/macppc is currently unable to install a bootable system on a hard disk. This can be worked around by starting qemu via anita rather than directly, as anita will build a boot CD and boot from it instead of the hard disk.

Also, NetBSD's support for the "gem" network card qemu emulates by default is broken, so you need to substitute a different network card.

To boot the target VM with the above work-arounds, you can use

 $ anita --workdir work --vmm-args "-net nic,model=ne2k_pci -net user -gdb tcp::1234" \
     --sets kern-GENERIC,modules,base,etc,comp,debug,games,man,misc,tests,text,syssrc,src,sharesrc,gnusrc \
     interact http://nycdn.netbsd.org/pub/NetBSD-daily/HEAD/latest/macppc/

To boot the GDB VM, you can use

 $ anita --workdir work --vmm-args "-net nic,model=ne2k_pci -net user" \
      --sets kern-GENERIC,modules,base,etc,comp,debug,games,man,misc,tests,text,syssrc,src,sharesrc,gnusrc \
      interact http://nycdn.netbsd.org/pub/NetBSD-daily/HEAD/latest/macppc/

After that, everything should work the same as in Kernel debugging with QEMU.