Forums

Kernel image size

Started by Nobby Anderson November 20, 2009
I've recently upgraded a ppc405 build for a Virtex 4 device from kernel 2.6.15
(arch/ppc) to 2.6.31 (arch/powerpc) and the size of the image has increased
from about 900k to 1.4M.  As far as I can tell I've pretty much the same
config options set.  The 2.6.15 kernel was straight from the kernel mainline 
with some xilinx drivers hacked in, the .31 is straight from git.xilinx.com
with nothing additional hacked in but does use for example the lltemac
driver.

Is that the sort of size increase I should expect, or is it likely I'm
missing something?  It's nearly a 50% increase, which seems excessive!

Nobby
On Nov 21, 2:10=A0am, Nobby Anderson <no...@invalid.invalid> wrote:
> I've recently upgraded a ppc405 build for a Virtex 4 device from kernel 2=
.6.15
> (arch/ppc) to 2.6.31 (arch/powerpc) and the size of the image has increas=
ed
> from about 900k to 1.4M. =A0As far as I can tell I've pretty much the sam=
e
> config options set. =A0The 2.6.15 kernel was straight from the kernel mai=
nline
> with some xilinx drivers hacked in, the .31 is straight from git.xilinx.c=
om
> with nothing additional hacked in but does use for example the lltemac > driver. > > Is that the sort of size increase I should expect, or is it likely I'm > missing something? =A0It's nearly a 50% increase, which seems excessive! > > Nobby
Not that I can help on this, but I am curious on a related note; what does this kernel do? My DPS (not for the 405, just for 5200B and for the 824x so far) "kernel", dps.syst, contains things up to and including the filesystem - it has to spawn a shell to have command line functionality. dps.syst is 106100 bytes long; shell is apr. 42k. This without windows, graphics and tcp/ip; it takes another apr. 500k to add these. So I am just curious to see what other people do. Dimiter P.S. Here is a new product with the mpc5200b, it runs all of the above and some more: http://tgi-sci.com/tgi/nmcatb.htm . ------------------------------------------------------ Dimiter Popoff Transgalactic Instruments http://www.tgi-sci.com ------------------------------------------------------ http://www.flickr.com/photos/didi_tgi/sets/72157600228621276/
Didi <dp@tgi-sci.com> wrote:
> On Nov 21, 2:10&#2013266080;am, Nobby Anderson <no...@invalid.invalid> wrote: >> I've recently upgraded a ppc405 build for a Virtex 4 device from kernel 2.6.15 >> (arch/ppc) to 2.6.31 (arch/powerpc) and the size of the image has increased >> from about 900k to 1.4M. &#2013266080;As far as I can tell I've pretty much the same >> config options set. &#2013266080;The 2.6.15 kernel was straight from the kernel mainline >> with some xilinx drivers hacked in, the .31 is straight from git.xilinx.com >> with nothing additional hacked in but does use for example the lltemac >> driver. >> >> Is that the sort of size increase I should expect, or is it likely I'm >> missing something? &#2013266080;It's nearly a 50% increase, which seems excessive! >> >> Nobby > > Not that I can help on this, but I am curious on a related note; > what does this kernel do? My DPS (not for the 405, just for 5200B and > for the 824x so far) "kernel", dps.syst, contains things up to > and including the filesystem - it has to spawn a shell to have > command line functionality. dps.syst is 106100 bytes long; shell > is apr. 42k. > This without windows, graphics and tcp/ip; it takes another apr. > 500k to add these. > So I am just curious to see what other people do.
Not sure I understand what you're getting at - re-reading my post I realise that I failed to mention that it was a Linux kernel which was a bit stupid of me! Anyway, we use Linux on them because it means we can run the same app on small embedded systems up to large fast hardware on a variety of architectures. I'm just curious as to why it's increased 50% in size from the .15 to the .31 releases and wonder if anyone else has noticed this. Probably not the best group to ask on, but then embedded folk usually care more about size than others. Nobby
Nobby Anderson wrote:
> I've recently upgraded a ppc405 build for a Virtex 4 device from kernel 2.6.15 > (arch/ppc) to 2.6.31 (arch/powerpc) and the size of the image has increased > from about 900k to 1.4M. As far as I can tell I've pretty much the same > config options set. The 2.6.15 kernel was straight from the kernel mainline > with some xilinx drivers hacked in, the .31 is straight from git.xilinx.com > with nothing additional hacked in but does use for example the lltemac > driver. > > Is that the sort of size increase I should expect, or is it likely I'm > missing something? It's nearly a 50% increase, which seems excessive!
DEBUG build? Not stripped?
On Fri, 20 Nov 2009 18:10:06 -0600, Nobby Anderson wrote:

> I've recently upgraded a ppc405 build for a Virtex 4 device from kernel 2.6.15 > (arch/ppc) to 2.6.31 (arch/powerpc) and the size of the image has increased > from about 900k to 1.4M. As far as I can tell I've pretty much the same > config options set. The 2.6.15 kernel was straight from the kernel mainline > with some xilinx drivers hacked in, the .31 is straight from git.xilinx.com > with nothing additional hacked in but does use for example the lltemac > driver. > > Is that the sort of size increase I should expect, or is it likely I'm > missing something? It's nearly a 50% increase, which seems excessive!
A lot has happened between those two: 2.6.15 03-Jan-2006 2.6.15.7 28-Mar-2006 ... 2.6.31 09-Sep-2009 2.6.31.6 10-Nov-2009 Newer kernels occasionally get new features which are enabled by default, and would need to be explicitly disabled. Individual drivers often have tables of known devices, and workarounds for broken hardware. The size of both tends to increase over time. Compilation options can make a lot of difference. An kernel built for embedded use probably won't use the default switches. If you're building these kernels from source, you can examine the number and size of the object files which are built. More files tends to indicate more features (drivers, modules), consistently larger files would indicate compilation switches, inconsistently larger files would indicate specific components acquiring new features.
On Fri, 20 Nov 2009 18:10:06 -0600, Nobby Anderson wrote:

> I've recently upgraded a ppc405 build for a Virtex 4 device from kernel > 2.6.15 (arch/ppc) to 2.6.31 (arch/powerpc) and the size of the image has > increased from about 900k to 1.4M. As far as I can tell I've pretty > much the same config options set. The 2.6.15 kernel was straight from > the kernel mainline with some xilinx drivers hacked in, the .31 is > straight from git.xilinx.com with nothing additional hacked in but does > use for example the lltemac driver. > > Is that the sort of size increase I should expect, or is it likely I'm > missing something? It's nearly a 50% increase, which seems excessive! > > Nobby
I _think_ that the (Linux) kernel build, by default, includes drivers for every known device that hes ever been plugged into a Linux machine, including the kitchen sink if it happens to have a USB port (but there's also a driver for kitchen sinks that use legacy parallel ports, and two different flavors of serial). Cutting all that out should keep the kernel size down. -- www.wescottdesign.com
Nobody <nobody@nowhere.com> wrote:
> On Fri, 20 Nov 2009 18:10:06 -0600, Nobby Anderson wrote: > >> I've recently upgraded a ppc405 build for a Virtex 4 device from kernel 2.6.15 >> (arch/ppc) to 2.6.31 (arch/powerpc) and the size of the image has increased >> from about 900k to 1.4M. As far as I can tell I've pretty much the same >> config options set. The 2.6.15 kernel was straight from the kernel mainline >> with some xilinx drivers hacked in, the .31 is straight from git.xilinx.com >> with nothing additional hacked in but does use for example the lltemac >> driver. >> >> Is that the sort of size increase I should expect, or is it likely I'm >> missing something? It's nearly a 50% increase, which seems excessive! > > A lot has happened between those two: > > 2.6.15 03-Jan-2006 > 2.6.15.7 28-Mar-2006 > ... > 2.6.31 09-Sep-2009 > 2.6.31.6 10-Nov-2009 > > Newer kernels occasionally get new features which are enabled by default, > and would need to be explicitly disabled. > > Individual drivers often have tables of known devices, and workarounds > for broken hardware. The size of both tends to increase over time. > > Compilation options can make a lot of difference. An kernel built for > embedded use probably won't use the default switches. > > If you're building these kernels from source, you can examine the number > and size of the object files which are built. More files tends to indicate > more features (drivers, modules), consistently larger files would indicate > compilation switches, inconsistently larger files would indicate specific > components acquiring new features. >
Thanks to everybody who replied. I did eventually get the size down to near the old one by severely trimming out lots of options - as Nobody said there are a bunch of new things that are enabled by default. I'm not sure I know what made the biggest difference but the filesystem drivers had a marked effect - I didn't have any filesystems enabled that I don't need, but there seem to be a bunch of new options for the ext2-class of filesystems that make for quite a hefty kernel. I did find this web page which might be of some use to somebody: http://elinux.org/Kernel_Size_Tuning_Guide which introduced me to the aptly-named bloat-o-meter in the scripts directory in the kernel sources! Cheers, Nobby