On Fri, May 16, 2008 at 10:56:15AM +0800, Huang, Ying wrote:
Huang is making use of purgatory only for booting kernel B for the first
time. Once the kernel B is booted, all the trasitions (A-->B and B<--A)
happen without using purgatory. Just keep on jumping back and forth
to "kexec_jump_back_entry".
Probably not using purgatory for later transitions is justified as long as
kernel code is simple and small. Otherwise we will shall have to teach
purgatory also of special case of resuming kernel B or booting kernel B.
To me this idea also looks good. So control flow will look something
as follows?
relocate_new kernel:
if (!preserve_context)
set registers to known state.
jump to purgatory.
else
goto jump-back-setup:
jump-back-setup:
- Color the stack.
move $0xffffffff 0(%esp)
- call %edx
kexec_jump_back_entry:
- If 0 (%esp) is not -1
image->start = 0(%esp) //Re entry point of kernel B. Store it.
else
We returned from BIOS call. Re-entry point has not changed
Do nothing.
- Continue to resume kernel A
Thanks
Vivek
--