Subject: Re: booting kernel on SA1110

From: Nicolas Pitre <[email-masked]>
Date: Thu, 27 Apr 2000 19:54:46 -0400 (EDT)

On Thu, 27 Apr 2000, Zach Welch wrote:

> Nicolas,
> 
> Could you please give a brief explanation as to why zImage is preferred over
> Image in the current SA-1100 build? Our bootloader uses a built-in
> compression scheme that I need to use, and the idea of compressing the
> zImage is not appealing. My understanding is that the two images should be
> the same (except zImage has to extract the piggyback kernel).

In latest kernels, this extraction is done with all caches enabled so it
takes less than half a second to execute.  So it shouldn't be a big deal
for you to blindlessly use zImage, even if you had it compressed already.
There is a nice side effect too -- there is a checksum performed on the
kernel image while it is uncompressed so you won't silently boot a
truncated or corrupted kernel image.

Now the SA1100 reason for using zImage is this: Some, if not most, SA1100
boards uses many different bootloaders, some leaves the MMU activated,
some jumps in the kernel while not in SVC mode, some doesn't initialize
the serial port on which debugging output should be sent, some doesn't
actually set proper values in r0/r1 for kernel entry, etc. A good example
of this is the angel debug monitor.

The linker script for the compressed boot image allows for inserting an
arbitrary chunk of code very near the beginning of the execution so all
SA1100 specific hacks and tweaks are isolated away in a single file:
head-sa1100.S.  This makes things pretty clean without polluting the main
code with #ifdef ...

In head_sa1100.S, you'll find some code to get control from angel's hands,
caches are cleaned (very important) and MMU turned off (doesn't matter if
it is off already, but just in case), serial ports might be initialized,
etc. The idea is to put the CPU in the barest state so the mainline kernel
code can start over with no catch. Since this code should not run twice, I
linked it with zImage only since zImage is what most people would use.
Like I said above, it can't arm if you always use zImage anyway.

Nicolas

unsubscribe: body of `unsubscribe linux-arm-kernel' to [email-masked]