Hello,

On Sun, 2008-07-06 at 11:02 +0300, Avi Kivity wrote:
> Cristi Magherusan wrote:
> > Hello,
> >
> > As part of my GSoC project I'm working to create a small coreboot
> > payload containing a KVM-enabled Linux kernel and the KVM tools.
> >
> > This involves either compiling and linking KVM against uClibc, or making
> > a static binary linked against glibc.
> >
> > Has anyone tried compiling kvm against uClibc before? I did and it seems
> > it has some issues. I have fixed some by including aio support inside
> > uClibc, but it still won't work and I get some linking errors..I can
> > provide more details if needed.
> >
> >   
> 
> Please post the build log.

Sorry, the part about incompatibility with uClibc was an error on my
side. It were just my build tools.
I had some errors in the Makefile I'm using for KVM which are now
partially fixed and now I got rid of that error, but I have another
strange one which again seems to be caused by my Makefile.

For building all the stuff I'm using a somehow modified version of
coreboot's buildrom. 

This is my build log:
http://rafb.net/p/DXMwsg76.html
And this is my Makefile that triggers the kvm make command:
http://tinyurl.com/66objx

Currently, in order to reproduce it some steps must be done manually but
those will be patched in the sources later on...

So if you want to reproduce it yourself, these are the steps:

git clone git://repo.or.cz/kvm-coreboot.git
Then cd into the dir and type "make"

Beware, it will download and compile some stuff, including a 2.6.22
linux kernel, busybox and uClibc, so it will take a while to complete.

Also, note that gcc-4.3 will fail to build the kernel and you'll either
have to use gcc <=4.2.x or add a strange CFLAG to the kernel Makefile,
at the CFLAGS_KERNEL. I'll search for that one and include a patch for
it by default, but for now I'm sticking to gcc-4.2.4.

After everything builds, kvm-70 will break at some point. First rsync -R
will fail, and you must remove the line containing
"$(LINUX)"/./include/asm-*/kvm*.h from
work/kvm-tools/kvm-70/kernel/Makefile

It's strange that the first compilation fails with this message:
/tmp/kvm-coreboot/work/kvm-tools/kvm-70/qemu/hw/i8254-kvm.c: In function
‘kvm_pit_save’:
/tmp/kvm-coreboot/work/kvm-tools/kvm-70/qemu/hw/i8254-kvm.c:36: error:
storage size of ‘pit’ isn’t known
/tmp/kvm-coreboot/work/kvm-tools/kvm-70/qemu/hw/i8254-kvm.c:41: warning:
implicit declaration of function ‘kvm_get_pit’.......

Then if you run make again it will pass over that point and you'll get
some errors caused by u32 and u64 in
work/kvm-tools/kvm-70/kernel/include/linux/kvm_para.h
to fix those run this command:

sed -i -e 's/u32/uint32_t/;s/u64/uint64_t/' \
work/kernel/linux-2.6.22.2/include/linux/kvm_para.h

then include <sys/user.h> in the same file.

Run make again and then you get the error I'm facing now.

> > Also, it seems that currently there's no way to build it statically
> > linked against glibc, so that I can include it in my BIOS image in this
> > way. I used the -static CFLAG, but it seems it is still linked
> > dinamically against the same libs. Any ideas?
> >   
> 
> I don't see any reason for that.  Perhaps the build logs will tell.
I hope I won't need to do this and that uClibc will be enough.

Thanks for your answer,
Cristi

-- 
Ing. Cristi Măgherușan,
Universitatea Tehnică din Cluj-Napoca
Centrul de Comunicații "Pusztai Kalman"
Tel. 0264/401247  http://cc.utcluj.ro






--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to