[U-Boot-Users] hello world application

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

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

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

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
participants (3)
-
Detlev Zundel
-
Jhavk
-
Wolfgang Denk