kernel entry for thumb2-only cpus
Russell King - ARM Linux
linux at arm.linux.org.uk
Mon Aug 6 15:08:56 EDT 2012
On Mon, Aug 06, 2012 at 01:40:26PM -0500, Matt Sealey wrote:
> Maybe we could implement a shiny new zImage magic value, I'm not sure
> if 0x016f2818 might have some sentimental value, but there's nothing
> to say that 0x016f2819 wouldn't also be valid and indicate that it's
> an ARM zImage with a Thumb2 entrypoint?
No. That magic value is a bloody pain in the backside from my point
of view. I've had soo many problems with it with boot loaders its
untrue.
For example, the Skiff (SA110 platform produced by Compaq) using
bootldr. It detects the value in the kernel image after loading
the kernel at 0x8000 into RAM, and then proceeds to move the entire
kernel image to RAM location 0, and then calls it at 0x8000 !
Naturally, that action corrupts the ATAG list etc.
To work around that, I've ended up doing some weird and wonderful
tricks like pre-pending 32K of zeros, and copying the first 128
bytes of the kernel image to the start of the image file to fool
the boot loader. Still results in a corrupted ATAG list but it is
bootable.
There's other boot loaders around too which change their behaviour
in weird and wonderful ways depending on magic values in the loaded
image file.
What this all means is that stuff like this is at the mercy of the
boot loader folk, and when problems happen, it's hard to work around
them, because you have no way to tell the boot loader to do something
different.
Instead, lets not continue this broken idea. Instead, let's be able
to _tell_ the boot loader what we want it to do, rather than have it
magically decipher what _it_ thinks might be a good idea to do.
More information about the linux-arm-kernel
mailing list