public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Compressed U-Boot image
@ 2004-11-04 13:26 VanBaren, Gerald
  2004-11-04 14:24 ` Wolfgang Denk
  2004-11-04 15:35 ` Terry Barnaby
  0 siblings, 2 replies; 11+ messages in thread
From: VanBaren, Gerald @ 2004-11-04 13:26 UTC (permalink / raw)
  To: u-boot

> -----Original Message-----
> From: u-boot-users-admin at lists.sourceforge.net
> [mailto:u-boot-users-admin at lists.sourceforge.net] On Behalf
> Of Terry Barnaby
> Sent: Wednesday, November 03, 2004 11:39 AM
> To: Wolfgang Denk
> Cc: u-boot-users at lists.sourceforge.net
> Subject: Re: [U-Boot-Users] Compressed U-Boot image

[snip]

> In my case I was hoping to use u-boot simply as a network
> boot loader without all of the debugging options. However I
> have only 32KByte to store the code in ....
>
> Is there another PPC based network boot loader you know off
> that would be better at this than u-boot ?
>
> Cheers
>
> Terry

Hi Terry,

You have a significant challenge.  I just did a quick gzip --best check
which confirmed that my u-boot image compressed ~50% (45% but you will
need to add the decompression code).  This implies that you need an
uncompressed u-boot image smaller than 64K.  Since you have all the
source, it is do-able, it is just a question of how hard you are willing
to work and what you are willing to cut out ;-).

My advice is to...
1) Configure a minimal u-boot by turning off as many commands as
possible.
2) See how close you are.  My gut feel is that, if you are under 96K,
you have a decent chance.
3) Look in the u-boot.map file and see who the heavy hitters are.  With
some luck, you will be able to minimize or remove enough of them to get
under 64K.

As everybody has been saying, this isn't going to be easy.  The nice
thing is that you are starting from solid code.  A _lot_ of people make
the mistake of optimizing and then debugging... it is a lot easier to
debug and then optimize.

Looking at my u-boot map it is very clear how much memory each .a/.o is
taking up (3rd column in the .text section) and what it is used for.  I
see several decompression libraries (gzip, bzip2, inflate?) that you
could remove all-but-one (and possibly all if you can get u-boot to
re-use the u-boot image decompression routine that you will need to
write).  The command parser and commands make up a pretty large chunk --
obviously that can be minimized and possibly eliminated.

Some big hitters that are obviously necessary.  These add up to just
over 32K.  We're still in the game, but this isn't looking very easy.
 .text          0xff800000     0x3560 cpu/mpc8260/start.o
 .text          0xff805098     0x1bf4 net/libnet.a(net.o)
 .text          0xff806c8c      0x6b0 net/libnet.a(tftp.o)
 .text          0xff80733c      0xae0 net/libnet.a(bootp.o)
 .text          0xff808018      0x87c net/libnet.a(eth.o)
 .text          0xff80992c      0xab4 common/libcommon.a(main.o)
 .text          0xff81248c      0x96c common/libcommon.a(console.o)
 .text          0xff812fb0     0x1328 common/libcommon.a(dlmalloc.o)

Commands, most or all of which would need to be sacrificed
 .text          0xff814bb8     0x2674 common/libcommon.a(hush.o)
 .text          0xff80a3e0      0x1ec
common/libcommon.a(cmd_autoscript.o)
 .text          0xff80a5cc      0x23c common/libcommon.a(cmd_bdinfo.o)
 .text          0xff80a808       0xbc common/libcommon.a(cmd_boot.o)
 .text          0xff80a8c4     0x11e8 common/libcommon.a(cmd_bootm.o)
 .text          0xff80baac      0x1cc common/libcommon.a(cmd_cache.o)
 .text          0xff80bc78      0x120 common/libcommon.a(cmd_console.o)
 .text          0xff80bd98      0xb5c common/libcommon.a(cmd_flash.o)
 .text          0xff80c8f4      0xe18 common/libcommon.a(cmd_immap.o)
 .text          0xff80d70c      0x424 common/libcommon.a(cmd_itest.o)
 .text          0xff80db30      0x3b0 common/libcommon.a(cmd_jffs2.o)
 .text          0xff80dee0     0x1320 common/libcommon.a(cmd_load.o)
 .text          0xff80f200      0xd04 common/libcommon.a(cmd_mem.o)
 .text          0xff80ff04      0x820 common/libcommon.a(cmd_mii.o)
 .text          0xff810724       0xb0 common/libcommon.a(cmd_misc.o)
 .text          0xff8107d4      0x5b8 common/libcommon.a(cmd_net.o)
 .text          0xff810d8c      0xca8 common/libcommon.a(cmd_nvedit.o)
 .text          0xff811a34      0x178 common/libcommon.a(cmd_portio.o)

I _really hope_ that you have a development board that you can create an
analog of your compressed u-boot on and debug it before you have to go
to a severely memory starved environment.

You have an interesting challenge.  Keep us informed and good luck,
gvb

******************************************
The following messages are brought to you by the Lawyers' League of
IdioSpeak:

******************************************
The information contained in, or attached to, this e-mail, may contain confidential information and is intended solely for the use of the individual or entity to whom they are addressed and may be subject to legal privilege.  If you have received this e-mail in error you should notify the sender immediately by reply e-mail, delete the message from your system and notify your system manager.  Please do not copy it for any purpose, or disclose its contents to any other person.  The views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the company.  The recipient should check this e-mail and any attachments for the presence of viruses.  The company accepts no liability for any damage caused, directly or indirectly, by any virus transmitted in this email.
******************************************

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [U-Boot-Users] Compressed U-Boot image
@ 2004-11-04 14:47 VanBaren, Gerald
  2004-11-04 16:04 ` Wolfgang Denk
  0 siblings, 1 reply; 11+ messages in thread
From: VanBaren, Gerald @ 2004-11-04 14:47 UTC (permalink / raw)
  To: u-boot

> -----Original Message-----
> From: wd at denx.de [mailto:wd at denx.de]
> Sent: Thursday, November 04, 2004 9:25 AM
> To: VanBaren, Gerald (AGRE)
> Cc: u-boot-users at lists.sourceforge.net
> Subject: Re: [U-Boot-Users] Compressed U-Boot image
>
> In message
> <065ACD8E84315E4394C835E398C8D5EB9A601B@COSSMGMBX02.email.corp
> .tld> you wrote:
> >
> ...
> > write).  The command parser and commands make up a pretty
> large chunk
> > -- obviously that can be minimized and possibly eliminated.
>
> If you eliminate the command parser I wonder  why  you  don't
>  simply replace  U-Boot  by  a  simple  "return" instruction
> - no more than 4 bytes needed for that ;-)
>
> Best regards,
>
> Wolfgang Denk
>
> --
> See us @ Embedded/Electronica Munich, Nov 09 - 12, Hall A.6 Booth 513
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> I know engineers. They love to change things.             - Dr. McCoy

Hi WD, I like your .sig, very appropriate today :-)

I acknowledge the wink in your response, but my thought here is that, if
you _really_ need to fit in 32K, you may want to run "tftpboot" (or
equiv) instead of hush so that all the gutted u-boot knows how to do is
boot linux over the network.  Kind of equivalent to replacing "init" in
a linux disk image so that it runs your application directly.

There were only two requirements specified by Terry: net boot and fit in
32K.  Hopefully he is an engineer per Dr. McCoy ;-).

gvb


******************************************
The following messages are brought to you by the Lawyers' League of
IdioSpeak:

******************************************
The information contained in, or attached to, this e-mail, may contain confidential information and is intended solely for the use of the individual or entity to whom they are addressed and may be subject to legal privilege.  If you have received this e-mail in error you should notify the sender immediately by reply e-mail, delete the message from your system and notify your system manager.  Please do not copy it for any purpose, or disclose its contents to any other person.  The views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the company.  The recipient should check this e-mail and any attachments for the presence of viruses.  The company accepts no liability for any damage caused, directly or indirectly, by any virus transmitted in this email.
******************************************

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [U-Boot-Users] Compressed U-Boot image
@ 2004-11-03 15:24 Terry Barnaby
  2004-11-04  0:43 ` Scott McNutt
  0 siblings, 1 reply; 11+ messages in thread
From: Terry Barnaby @ 2004-11-03 15:24 UTC (permalink / raw)
  To: u-boot

Hi,

The u-boot image is quite large.
Has anyone done any working in getting a compressed u-boot image to boot
ala the Linux kernel ?

Cheers

Terry
-- 
Dr Terry Barnaby                     BEAM Ltd
Phone: +44 1454 324512               Northavon Business Center, Dean Rd
Fax:   +44 1454 313172               Yate, Bristol, BS37 5NH, UK
Email: terry at beam.ltd.uk             Web: www.beam.ltd.uk
BEAM for: Visually Impaired X-Terminals, Parallel Processing, Software
                       "Tandems are twice the fun !"

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [U-Boot-Users] Compressed U-Boot image
@ 2004-11-03 15:22 Terry Barnaby
  2004-11-03 16:19 ` Wolfgang Denk
  0 siblings, 1 reply; 11+ messages in thread
From: Terry Barnaby @ 2004-11-03 15:22 UTC (permalink / raw)
  To: u-boot

Hi,

The u-boot image is quite large.
Has anyone done any working in getting a compressed u-boot image to boot
ala the Linux kernel ?

Cheers

Terry
-- 
Dr Terry Barnaby                     BEAM Ltd
Phone: +44 1454 324512               Northavon Business Center, Dean Rd
Fax:   +44 1454 313172               Yate, Bristol, BS37 5NH, UK
Email: terry at beam.ltd.uk             Web: www.beam.ltd.uk
BEAM for: Visually Impaired X-Terminals, Parallel Processing, Software
                       "Tandems are twice the fun !"

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-11-04 16:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-04 13:26 [U-Boot-Users] Compressed U-Boot image VanBaren, Gerald
2004-11-04 14:24 ` Wolfgang Denk
2004-11-04 15:35 ` Terry Barnaby
  -- strict thread matches above, loose matches on Subject: below --
2004-11-04 14:47 VanBaren, Gerald
2004-11-04 16:04 ` Wolfgang Denk
2004-11-03 15:24 Terry Barnaby
2004-11-04  0:43 ` Scott McNutt
2004-11-03 15:22 Terry Barnaby
2004-11-03 16:19 ` Wolfgang Denk
2004-11-03 16:38   ` Terry Barnaby
2004-11-03 18:03     ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox