kernel image start, kernel load address/entry point

leosilva leosilva at linux.vnet.ibm.com
Tue Mar 5 13:11:23 EST 2013


Hi,

I'm studying the kexec code and try to figure out where is the best
place to grab these informations: kernel image start address, kernel
load address/kernel entry point.

I've read the kexec-tools code, most precisely  do_bzImage_load function
and purgatory/entry64.S, entry64-32.S and setup-x86_64.S. I found some
informations there as this regs32.eip = kernel32_load_address assign
where I'm assuming it's the kernel entry point that I'm looking for. But
I'm also staring in this code on entry64-32.S to understand what it
does:
ljmp    *%cs:entry32_addr - entry32


As I'm not good in asm I don't understand what it does. I saw that
assign regs32.eip = 0x1000000 /* kernel32_load_address */ first in
do_bzImage_load  so in .S file I saw it moves eip to %eax does that asm
mentioned, and in the end jump to what it calls  loaded image. 
I'm assuming it as the new kernel entry point, the address that I'm
looking to grab, but not sure if it is the the whole *%cs:entry32_addr -
entry32 or just the first assign (0x1000000).


Beyond that I have this real_mode->kernel_start, that to me seems be the
start point in the kernel image, but is just set up if kernel will run
in real mode. So is there no way to grab start image address except it
runs in real mode?

Regardless entry point address I also read this thread 
 http://lists.infradead.org/pipermail/kexec/2012-June/006394.html,
I noticed that this kernel32_load_address seems be just the first
address to where the purgatory jumps to then new kernel starts and in
some moment relocate itself. (guesses). 

My whole point is if my guesses here is correct, if this address are
related to what I want or I'm misunderstanding everything. 


Thanks in advance
Leonidas
-- 





More information about the kexec mailing list