public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] hello world application
@ 2004-10-31  8:04 Jhavk
  2004-10-31 14:43 ` Detlev Zundel
  2004-10-31 21:25 ` Wolfgang Denk
  0 siblings, 2 replies; 4+ messages in thread
From: Jhavk @ 2004-10-31  8:04 UTC (permalink / raw)
  To: u-boot

I want to make gzipped hello_world application and
later execute it using bootm command.

I figured that mkimage is the utility for making
compressed STANDALONE image.

But it needs an option mkimage -d <datafile>

Now what is this datafile? Is it hello_world or
hello_world.bin or hello_world.srec
I tried all 3, but they give different sizes of
gzipped image. So i am confused.

My target architecture is ARM.

Thanks.


		
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 

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

* [U-Boot-Users] hello world application
  2004-10-31  8:04 [U-Boot-Users] hello world application Jhavk
@ 2004-10-31 14:43 ` Detlev Zundel
  2004-10-31 21:29   ` Wolfgang Denk
  2004-10-31 21:25 ` Wolfgang Denk
  1 sibling, 1 reply; 4+ messages in thread
From: Detlev Zundel @ 2004-10-31 14:43 UTC (permalink / raw)
  To: u-boot

Hi Jhavk,

> I want to make gzipped hello_world application and
> later execute it using bootm command.
>
> I figured that mkimage is the utility for making
> compressed STANDALONE image.
>
> But it needs an option mkimage -d <datafile>
>
> Now what is this datafile? Is it hello_world or
> hello_world.bin or hello_world.srec
> I tried all 3, but they give different sizes of
> gzipped image. So i am confused.

Right - the differences are:

hello_world - ELF file generated by compiler.  You need an ELF loader
for this if you want to execute it (bootm does not contain ELF code).
This is usually used for cross debugging as the file to feed to the
debugger.

hello_world.srec - MotorolaS-Record file (ascii format) only used for
serial download as it can encode binary files in 7 bit.  One can think
of this as kind of like BASE64 with some address meta information
added.

hello_world.bin - This is generated from the ELF file and actually
contains a memory dump without any meta information - so you have to
ensure that it is being loaded to the correct address.  This is the
file you should use as the datafile.  Be sure to provide the mkimage
tool with the correct load and entry points (although the entry point
can be overriden with the second argument of bootm for standalone
applications).  Also be aware that the environment variable
"autostart" determines whether a standalone application started with
bootm really starts.  This is a neat trick for "misusing" the
standalone application format to compress simple datafiles needed on
the target.

Having this in mind, the different sizes after compression should now
be obvious ;)

Cheers
  Detlev

-- 
Deutsches Grundgesetz Artikel 14 Absatz 2:
Eigentum verpflichtet. Sein Gebrauch soll zugleich dem Wohle der
Allgemeinheit dienen.

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

* [U-Boot-Users] hello world application
  2004-10-31  8:04 [U-Boot-Users] hello world application Jhavk
  2004-10-31 14:43 ` Detlev Zundel
@ 2004-10-31 21:25 ` Wolfgang Denk
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2004-10-31 21:25 UTC (permalink / raw)
  To: u-boot

In message <20041031080457.27425.qmail@web12009.mail.yahoo.com> you wrote:
> I want to make gzipped hello_world application and
> later execute it using bootm command.

Please  use  correct  terms.  The  "hello_world"  is  so  small  that
compressing it makes no sense. Maybe you are talking about some other
standalone application, which is bigger?

> I figured that mkimage is the utility for making
> compressed STANDALONE image.
> 
> But it needs an option mkimage -d <datafile>
> 
> Now what is this datafile? Is it hello_world or
> hello_world.bin or hello_world.srec

It is none of them. You mentioned that you want to build a compressed
image, so you must compress the fiule first, and none of  hello_world
nor  hello_world.bin  nor  hello_world.srec  is compressed. Also, ask
yoruself  if  the  processor  will  be  able   to   find   executable
instructions in a S-Record file, or in a ELF header. it will not.

You  should  run  gzip  on  hello_world.bin  and  use  the  resulting
compressed binary image as input.

> I tried all 3, but they give different sizes of
> gzipped image. So i am confused.

I would be confused if it was different. Since mkimage always adds  a
64  byte  header, the resulting file sizes MUST be different when you
use files with different sizes as input.


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
While most peoples' opinions change, the conviction of their correct-
ness never does.

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

* [U-Boot-Users] hello world application
  2004-10-31 14:43 ` Detlev Zundel
@ 2004-10-31 21:29   ` Wolfgang Denk
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2004-10-31 21:29 UTC (permalink / raw)
  To: u-boot

In message <873bzvdk2i.fsf@deepthought.outer.space.org> you wrote:
> 
> hello_world.bin - This is generated from the ELF file and actually
> contains a memory dump without any meta information - so you have to
> ensure that it is being loaded to the correct address.  This is the
> file you should use as the datafile.  Be sure to provide the mkimage

Not quite. Remember that he wanted to use a _compressed_ image.

> Having this in mind, the different sizes after compression should now
> be obvious ;)

I bet he never compressed anything.

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
IMPORTANT NOTICE TO PURCHASERS: The Entire Physical Universe,  Inclu-
ding  This Product, May One Day Collapse Back into an Infinitesimally
Small Space. Should  Another  Universe  Subsequently  Re-emerge,  the
Existence of This Product in That Universe Cannot Be Guaranteed.

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

end of thread, other threads:[~2004-10-31 21:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-31  8:04 [U-Boot-Users] hello world application Jhavk
2004-10-31 14:43 ` Detlev Zundel
2004-10-31 21:29   ` Wolfgang Denk
2004-10-31 21:25 ` Wolfgang Denk

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