Hi,
for the embedded Linux project I'm working on I needed the
ability to boot a compressed kernel image from ROM, i.e.
uncompress it to RAM and jump to the kernel entry.
So I took some parts from arch/i386/boot/compressed,
and some from linux-mips.sf.net/arch/mips/zboot/ and
hacked up something which works for me.
The appended patch is incomplete as I removed anything
specific to my platform. To use it for a different platform
you would need:
- A head.S which works for your board. Depending on what
your bootloader does, you probably don't need the
cache flushing stuff.
- For debug output, you need a putc() implementation; maybe
the included uart16550.c works for you. If you think you don't
need to debug anything ;-), you could use a dummy putc().
- Set some configuration variables in the Makefile. I tested
both booting from ROM and loading the zImage to RAM, then
uncompressing to some different area in RAM.
Note: For my platform I allocate a 2MB frame buffer at
0x80002000 in unified memory, so reuse this space
for uncompressing the zImage.
I hope the patch is of use to someone. Comments are welcome.
Regards,
Johannes
linux-oss-zimage.patch
Description: Text document
|