[U-Boot-Users] hello world application

Detlev Zundel dzu at denx.de
Sun Oct 31 15:43:49 CET 2004


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.




More information about the U-Boot mailing list