Subject: Compressed kernels

From: [email-masked]
Date: Thu, 20 Nov 2003 09:10:41 +0000

I'm running a 2.4.21 kernel tree, and would like to have kernel
compression. I wondered if this has gone back into the latest versions yet?
Or is the old EV64120 code worth adapting to my needs?

Thanks.

---

From: Dan Malek <[email-masked]>
Date: Thu, 20 Nov 2003 10:21:27 -0500

> compression. I wondered if this has gone back into the latest versions yet?

If you apply the 'zImage' patch from Pete's ftp directory (look in past
e-mails for this discussion) you will see what I have done for a few of
the boards I'm using.  It's quite trivial to add new boards to get
this feature.  I'm still working on the method of attaching the
compressed initrd to the same image, which I find quite useful for
embedded applications.

Have fun!

	-- Dan

---

From: Ralf Baechle <[email-masked]>
Date: Thu, 20 Nov 2003 22:02:57 +0100

On Thu, Nov 20, 2003 at 10:21:27AM -0500, Dan Malek wrote:
> Date: Thu, 20 Nov 2003 10:21:27 -0500
> From: Dan Malek <[email-masked]>
> To: [email-masked]
> CC: [email-masked]
> Subject: Re: Compressed kernels
> Content-Type: text/plain; charset=us-ascii; format=flowed
> 

Compressed kernels seem to be fairly high on everybody's list.  Due to
size limits of some boatloaders and flash memory being always too small
and too expensive I guess there would also be some interest in bzip2
support.

  Ralf

---

From: Dan Malek <[email-masked]>
Date: Thu, 20 Nov 2003 16:42:07 -0500

> and too expensive I guess there would also be some interest in bzip2

Interesting thought.  I compressed the binary image using bzip2 instead
of gzip, found it was only about 7% smaller (approximately 60K bytes).
To this, we have to add the trade off that the kernel already contains
too many versions of a readily available zlib, and the attached initrd
is also a gzip file.  Five years ago we used to be concerned about a
few bytes here and there, which prompted the interest in compressed
kernels, but today the embedded systems I'm working with have lots of
flash memory.  It seems product development cost to add a little more
flash is winning over spending the engineering time to squeeze those
last few bytes.

I don't think I'll spend my time doing it, but the process of creating
the compressed image and the calls to the uncompress functions are very
clear if someone else wants to do it :-)

Thanks.

	-- Dan

---

From: Wolfgang Denk <[email-masked]>
Date: Thu, 20 Nov 2003 23:33:30 +0100

> and too expensive I guess there would also be some interest in bzip2

Well, instead of doing this in the Linux kernel, you could also do
it in the boot loader.  U-Boot supports both gzip and bzip2 decom-
pression.

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: [email-masked]
If programming was easy, they wouldn't need something as  complicated
as a human being to do it, now would they?
                       - L. Wall & R. L. Schwartz, _Programming Perl_

---

From: Dan Malek <[email-masked]>
Date: Thu, 20 Nov 2003 17:50:17 -0500

> it in the boot loader.  U-Boot supports both gzip and bzip2 decom-

Just to keep us busy, there are people that chose options
other than u-boot :-)  For embedded systems that are really sensitive
to boot time and amount of flash used, they may only have minimal
instructions for processor initialization and then jump to the
compressed kernel image.  I'm not going to discuss boot roms any
further (yes, I use u-boot every chance I get).

	-- Dan

---

From: Ralf Baechle <[email-masked]>
Date: Sat, 22 Nov 2003 03:41:43 +0100

> Or is the old EV64120 code worth adapting to my needs?

The old code apparently was functioning but replicating code from zlib and
generally was carrying half a firmware as it's baggage.

  Ralf

---

From: Ralf Baechle <[email-masked]>
Date: Wed, 26 Nov 2003 00:44:04 +0100

> further (yes, I use u-boot every chance I get).

... the lesson I learned about firmware is it's usually not very well
tested because there are only few applications (that is usually
operating systems) running it.  Phear da firmware ...

  Ralf