Port-mips archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Committing code to evbmips?



>> I have an interest in getting a virtual mips64el going, and newer
>> qemu has the "mipssim-virtio" machine type for this purpose.
>> I found there is no "live / install" CD image built for either of
>> mipsel or mips64el, and I wanted to run sysinst...  I guess there
>> are other ways to install into the image.
>
> If you just need a ready-made NetBSD userland in a directory, you can
> use nfsrb2 ([1]) to create that for you. Your ride might be a little
> rough for NetBSD, though, because I mainly use it to create OpenBSD
> based NFS root file systems for my vintage machines, so this
> functionality works and is tested best. But I'm here to help if you
> run into any trouble when creating NetBSD file systems with it.
>
> [1]: https://github.com/the-machine-hall/nfsrb2
>
> I don't know how to get the created userland into an image usable by
> QEMU though, but I assume there are ways to accomplish that.

Thanks for the hint & pointer.  What I was thinking of when I
wrote the above was that since I'm using a "raw" image with qemu,
I could probably just use vnconfig on the host, label the "disk",
newfs and mount it, and extract the user-land from the host OS,
since the kernel to boot in this case is supplied by the host
directly to qemu, the disk image itself doesn't have to be
"natively bootable".

I have since done exactly that, and I'm using the MIPSSIM-MIPS64
kernel from -current and the 9.3 user-land.  The sequence to get
this going was roughly:

# dd if=/dev/zero of=disk.img bs=1m count=<what-you-want-or-need>
# vnconfig vnd0 disk.img
# disklabel -I -e vnd0
I labeled with a 'b' swap partition at the end, rest to the 'a'
partition.
# newfs -O 2 -V 2 /dev/rvnd0a
# mount /dev/vnd0a /mnt
# cd /mnt
# for s in <list of set files>; do
progress -f $s tar xfzpB -
done
# umount /mnt
# vnconfig -u vnd0

and this gives me an unconfigured user-land, so some manual work
has to be done when booted.  Also, the kernel I'm using hasn't
hardwired the root device, so I have to supply "ld0a" as root
file system and default swap + init.  I then end up having to

# mount -u /dev/ld0a /

due to a missing /etc/fstab.  So this needs fixing by creating
/etc/fstab, edit /etc/rc.conf and set rc_configured=YES and set
up to start any non-default daemons (ntp, ssh, dhcpcd etc.).
After that it's more or less "standard NetBSD operations".

I've noticed that "reboot" doesn't work, I get thrown into ddb
when I try to do that, so I end up having to kill qemu before I
spin up a new one.

And I'm running qemu with

MEM=2g
qemu-system-mips64el \
        -M mipssim-virtio \
        -m $MEM  \
        -cpu 5Kf \
        -kernel netbsd-MIPSSIM64 \
        -nographic \
        -device virtio-rng-device \
        -drive id=hda,format=raw,file=disk.img \
        -device virtio-blk-device,drive=hda \
        -netdev user,id=net0,hostfwd=tcp::2224-:22,ipv6=off \
        -device virtio-net-device,netdev=net0,mac=00:11:1e:01:02:03

BTW, the 2g is optimistic from my side, I end up getting 508MB
from NetBSD because the emulator doesn't have a way to
communicate the amount of memory to the kernel, so the kernel
probes for memory up to the ISA i/o memory window.

The above network config makes qemu do a dhcp server, and the
emulated host therefore needs to do dhcpcd=YES, and once that's
done, you can ssh in to 127.0.0.1 port 2224 to log in to the
emulated host (once you've created a non-root user via the
console, of course).  Not entirely sure if it makes any
difference, but different emulated systems on the same host
should probably have different MAC addresses.

Best regards,

- Håvard


Home | Main Index | Thread Index | Old Index