qemu stuff

2 views
Skip to first unread message

Barret Rhoden

unread,
Jul 29, 2015, 12:21:29 PM7/29/15
to aka...@googlegroups.com
I ran Akaros recently on a machine with qemu 2.3.0 and ran into some
minor issues. There are two commits on origin/net that update some
docs and the Makelocal.template. You won't need to do anything, but
you could speed up your VM boot time if you run a setup similar to mine.

The main thing is if you use a HDD images (basically qemu or syslinux),
you'll want to compress the kernel before copying it around. New qemu
takes 10x longer to load a kernel that is only 3x bigger. Hardware
probably doesn't care as much, but having a smaller kernel will
transfer onto a USB stick faster.

To do so, change your Makelocal targets like so:

-$(OBJDIR)/kern/.kvm.touch: $(KERNEL_OBJ)
+$(OBJDIR)/kern/.kvm.touch: $(CMP_KERNEL_OBJ)
@echo " (KVM) Copying to mnt/hdd"
$(Q)cp $^ mnt/hdd/kernel
@sync

-$(OBJDIR)/kern/.usb.touch: $(KERNEL_OBJ)
+$(OBJDIR)/kern/.usb.touch: $(CMP_KERNEL_OBJ)
@echo " (USB) Copying to /dev/sdc4"
$(Q)mount /dev/sdc4

And if you start seeing annoying warnings from qemu about "raw" disk
formats and you *don't* run with -kernel, replace "mnt/hdd.img" with
"-drive file=mnt/hdd.img,index=0,media=disk,format=raw"

Barret

Kevin Klues

unread,
Jul 29, 2015, 12:27:00 PM7/29/15
to akaros
I use the "-kernel" option, instead of an hdd.img. Startup times in
qemu for me have always been around 10s using this option. Do you
know if the "-kernel" option accepts compressed kernels as well? If
it does, we could just make it the default.

--
~Kevin

ron minnich

unread,
Jul 29, 2015, 1:01:18 PM7/29/15
to akaros
I thought I had used bzImages with qemu ...

ron minnich

unread,
Jul 29, 2015, 1:01:37 PM7/29/15
to akaros
Oh in fact I have used bzimage with qemu and it's fine. They're not hard to create and they are fast.

Barret Rhoden

unread,
Jul 29, 2015, 1:41:42 PM7/29/15
to aka...@googlegroups.com
On 2015-07-29 at 09:27 Kevin Klues <klu...@gmail.com> wrote:
> I use the "-kernel" option, instead of an hdd.img. Startup times in
> qemu for me have always been around 10s using this option.

Hopefully that continues with newer versions of qemu. My machine used
to have no trouble with hdd.img either.

> Do you know if the "-kernel" option accepts compressed kernels as
> well? If it does, we could just make it the default.

Maybe not, this hangs for me:

qemu-system-x86_64 -s -enable-kvm -cpu kvm64 -smp 8 -m 4096 -nographic
-monitor /dev/pts/24 -net nic,model=e1000 -net
user,hostfwd=tcp::5555-:23 -net dump,file=/tmp/vm.pcap -kernel
obj/kern/akaros-kernel.gz

Also, I didn't want to get rid of the KERNEL_OBJ target in case someone
else (RISCV) wants it, but we could make akaros-kernel depend on the
CMP_KERNEL_OBJ if everyone wants it, since the uncompressed object is
still built. Not a big deal one way or another; it's O(seconds) to
compress the kernel.

Barret

ron minnich

unread,
Jul 29, 2015, 1:58:22 PM7/29/15
to aka...@googlegroups.com
i think it needs to know it's a bzimage but who knows.

ron
Reply all
Reply to author
Forward
0 new messages