Trying to get MALTA64 running under qemu

Ben Morrow ben at morrow.me.uk
Tue Oct 21 00:01:57 UTC 2014


Adrian Chadd <adrian at freebsd.org> wrote:
> Would you please post an updated recipe for what you've done to get
> freebsd-mips64 up on qemu-devel?

The mkimg step is missing from the instructions on the wiki, as are the
arguments to makefs to get it to include some spare inodes in the image.
I haven't yet found any way to pass boot-time arguments to the kernel
(qemu's -append option doesn't seem to work, or I'm passing the
arguments wrong) so the root fs has to be on ada0s1a.

This comes up successfully with qemu-devel-2.0.2_3. The 'malta' machine
seems to be rather limited (one CPU, no more than 256M memory); I might
see if I can get a kernel config that works with one of the other qemu
machines.

Ben

#!/bin/sh

set -ex

export TARGET=mips
export TARGET_ARCH=mips64
export KERNCONF=MALTA64
export DESTDIR=/tmp/mipsworld

make -C /usr/src -j6 buildworld
make -C /usr/src -j6 buildkernel
make -C /usr/src installworld

cp /usr/obj/mips.mips64/usr/src/sys/$KERNCONF/kernel mips64.kernel

echo '/dev/ada0s1a / ufs rw 1 1' >$DESTDIR/etc/fstab
echo '/dev/ada0s1b none swap sw 0 0' >>$DESTDIR/etc/fstab

# don't build a be UFS2 image; there is a bug in makefs
makefs -Z -B be -f 60% -b 60% -t ffs mips64.ufs $DESTDIR
mkimg -s mbr -o mips64.img \
    -p freebsd:-'mkimg -s bsd -p freebsd-ufs:=mips64.ufs -p freebsd-swap::1G'

# not as root...
#qemu-system-mips64 -M malta \
#    -nographic -m 256M -kernel mips64.kernel -hda mips64.img



More information about the freebsd-mips mailing list