[Lguest] Host and Guests
Rusty Russell
rusty at rustcorp.com.au
Tue May 20 11:45:28 EST 2008
On Monday 19 May 2008 21:45:50 Daniel Baluta wrote:
> I have another question regarding the next paragraph
>
> ===
> Secondly, we only run specially modified Guests, not normal kernels. When
> you set CONFIG_LGUEST to 'y' or 'm', this automatically sets
> CONFIG_LGUEST_GUEST=y, which compiles this file into the kernel so it
> knows how to be a Guest. This means that you can use the same kernel you
> boot normally (ie. as a Host) as a Guest.
> ===
>
> but CONFIG_LGUEST = y is also set within Host
> as i have seen in http://lguest.ozlabs.org/lguest.txt , configuring kernel.
>
> so where is the difference between a host and a guest, regarding the
> part when each one finds its identity ( ex: i'm host or guest?)
This has changed in more recent kernels (you can adjust the guest and host
config options separately now).
The method by which we know we're a guest changed. In 2.6.23, the Launcher
entered the Guest immediately after the string "GenuineLguest" which was
found in lguest_asm.S: this jumps to lguest_init.
In 2.6.24, the bootloader protocol was extended, and now the Guest is launched
like a normal kernel. From arch/x86/lguest/i386_head.S:
/*G:020 Our story starts with the kernel booting into startup_32 in
* arch/x86/kernel/head_32.S. It expects a boot header, which is created by
* the bootloader (the Launcher in our case).
*
* The startup_32 function does very little: it clears the uninitialized
* global C variables which we expect to be zero (ie. BSS) and then copies the
* boot header and kernel command line somewhere safe. Finally it checks the
* 'hardware_subarch' field. This was introduced in 2.6.24 for lguest and
* Xen: if it's set to '1' (lguest's assigned number), then it calls us here.
All this information can be found in "make Preparation" in the drivers/lguest
directory...
Hope that helps,
Rusty.
More information about the Lguest
mailing list