From: "Daniel P. Berrange" <berrange@redhat.com>
To: xen-devel@lists.xensource.com
Subject: Re: PATCH 2/3: Support booting relocatable kernels
Date: Wed, 19 Dec 2007 05:42:41 +0000 [thread overview]
Message-ID: <20071219054241.GD19526@redhat.com> (raw)
In-Reply-To: <20071219053821.GB19526@redhat.com>
This patch introduces the basic infrastructure for direct kernel
boot in the ioemu copy of QEMU. The current #ifdef disabled
code is actually obsolete wrt to upstream QEMU code. So this
is removed entirely. In its place I have imported the latest
upstream QEMU code. The QEMU code assumes that the guest RAM
is directly mapped into the QEMU process, so there were some
changes neccessary. Instead of strcpy/memcpy'ing the args
and kernel header into guest RAM, cpu_physical_memory_rw is
used. Intead of fread() the initrd and kernel into guest RAM
a helper function is used fread2guest which reads into a small
buffer and then uses cpu_physical_memory_rw.
NB in reading the following, Documentation/i386/boot.txt is
a useful reference for what's going on.
Next, instead of loading the kernel at 0x100000, this code
loads it at 0x200000. This is far enough away that there's
no risk of it overlapping with the HVM firmware image. If the
Linux kernel boot protocol is 0x205 or later, and the flag
at offset 0x234 in the kernel header is 1, then the guest
kernel was built with CONFIG_RELOCATABLE=y.
In this scenario we merely need to tell the kernel what address
it has been relocated to by writing 0x200000 into the kernel
header at offset 0x214. When switching from real mode into
protected mode the kernel will immediately start executing at
0x200000 and be happy with life. This should work for 2.6.20 or
later on i386, and 2.6.22 or later on x86_64.
This has been verified with Fedora 7 and Fedora 8 bare metal kernels
on i386 from the $TREE/images/pxeboot of the install trees.
NB x86_64 is not yet tested
pc.c | 352 ++++++++++++++++++++++++++++++++++++++++++++++++++-----------------
1 file changed, 265 insertions(+), 87 deletions(-)
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Regards,
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
next prev parent reply other threads:[~2007-12-19 5:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-19 5:38 PATCH 0/3: Direct linux kernel boot for HVM Daniel P. Berrange
2007-12-19 5:41 ` PATCH 1/3: XenD changes for HVM kernel boot Daniel P. Berrange
2007-12-19 5:42 ` Daniel P. Berrange [this message]
2007-12-19 5:44 ` PATCH 2/3: Support booting relocatable kernels Daniel P. Berrange
2007-12-19 5:43 ` PATCH 3/3: Support boot of NON-relocatable kernels Daniel P. Berrange
2007-12-19 10:48 ` PATCH 0/3: Direct linux kernel boot for HVM Keir Fraser
2007-12-19 13:00 ` Daniel P. Berrange
2007-12-19 14:43 ` Keir Fraser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071219054241.GD19526@redhat.com \
--to=berrange@redhat.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.