Heiko Carstens <[EMAIL PROTECTED]> writes:
> On Thu, Nov 16, 2006 at 10:33:47AM -0700, Eric W. Biederman wrote:
>> Heiko Carstens <[EMAIL PROTECTED]> writes:
>> >
>> > With binary interface I mean: the kernel image will be handled as binary
> blob
>> > and the only things that need to be changed are:
>> > - the command line -> always at 0x10480
>> > - size and position of the initrd -> always at 0x10408/0x10410
>> > There is no need to distinguish between 32/64bit kernel images since they
>> > get treated exactly the same way.
>> > Hope that clarifies things a bit or maybe I get you wrong? Uhmm..
>>
>> A little. It sounds like you are handing off to a bootloader?
>
> Sort of... The first few instructions of a kernel are always 32 bit
> instructions before (in case of a 64 bit kernel) it switches to 64 bit mode.
> This is mandatory anyway because if you 'switch on' a s390 machine it will
> always run in 32 bit mode until you switch to 64 bit mode.
x86 has the same situation except it always starts in 16bit mode.
My x86 kernels don't always start with 16bit instructions.
> The kexec code in the kernel makes sure that the system is in 32 bit mode
> before the new image gets executed. Therefore there is no problem
> executing a 32 bit kernel from a 64 bit kernel and vice versa.
>
>> The basic question is if I want to boot something other than the linux
>> kernel with kexec will that work? Assuming the appropriate user space
>> side is in place.
>
> It will work, as long as whatever should be booted starts at 0x10000 and
> the first few instructions are 32 bit instructions.
>
>> I'm really trying to understand how you can execute either 32bit or
>> 64bit code with the same binary interface. Is it something like ppc
>> where the same instructions work regardless of mode? But even
>> the ppc has a mode.
>
> Hope the above explains that?
Yes. It explains it. I am always distressed when I look into these
kexec ports and I see how much of the power of kexec is simply discarded.
Especially since most of the work is provided by the generic infrastructure.
Always doing the handoff in 32bit mode I find unpleasant but tolerable. The
switch back to 32bit mode really should be done in the trampoline provided by
user space.
The hard coded entry point, I find much more distressing, given that kexec
has an entry point parameter.
Somehow I suspect you have also have hard coded the regions of memory where you
can load the kernel as well.
kexec should not switch processor operating modes.
kexec should provide a virtual to physical one to one mapping.
kexec should allow you to load your image anywhere there is ram on the
machine that you can address with a native word size.
kexec should allow any entry point to be specified.
Grumble, Grumble, Grumble, Grumble.
Eric
_______________________________________________
fastboot mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/fastboot