[okl4-developer] What's the difference between image.elf & image.sim

Matthew Warton mwarton at ok-labs.com
Tue Oct 2 10:00:18 EST 2007


Hi Kashin,

There are generally three ELF files created as part of the build  
process, image.elf, image.sim and image.boot (you may have to leave  
the simulate off the build command to get image.boot to build).

image.elf is a standard ELF file with correct virtual addresses and  
physical addresses for it's segments.  The entry point is left as a  
virtual address as per the ELF specification.  This is the canonical  
system image.

image.sim is used for ELF loaders (such as the one in skyeye) that  
understand the physical addresses of segments, but do not translate  
the entry point to a physical address themselves.  The only  
difference between image.elf and image.sim is that the entry point is  
given as a physical rather than virtual address.

image.boot is used for ELF loaders (such as u-boot's elf loader) that  
ignore the physical address in the segments and try to load  
everything at it's virtual address.  It also works with ELF loaders  
that load sections instead of segments.  image.boot is image.sim with  
all virtual addresses (section and segment) translated to their  
physical equivalents.

To generate a binary image for a board we generally use objcopy on  
image.boot, although it may work on the other images as well, as we  
have not tried.  We normally simply use "objcopy -O binary image.boot  
image.bin", as the build process produces a pretty clean ELF file  
anyway.  When you load this into RAM you need to load and execute it  
at the physical address, in your case 0xa0000000.

I hope that clears up a few things about the boot process.

Matthew Warton

On 29/09/2007, at 4:08 AM, kashin Lin wrote:

> Hi,
>
> i built okl4 for pxa270 and got an "image.elf" and an "image.sim"  
> for simulation.
> those two files are seems to be ELF file. i guess "image.elf" copy  
> image to 0xf000000
> and execute it but " image.sim" copy image to 0xa0000000 and  
> execute it.(is it right?)
> are there any other difference between them?
>
> because the U-boot on my develope board can't boot from ELF file.  
> so i use the following
> command to produce raw binary file from "image.elf".
> "arm-linux-objcopy -O binary -R .note -R .comment -S image.elf  
> image.bin"
> is it the correct way to get a raw binary image?
>
> but after i got the raw binary through this way. it seems i can  
> only load it to 0xa0000000 to boot just like what " image.sim" does.
>
> i am confused why the binary got from "image.elf" entry address is  
> 0xa0000000 like "image.sim" ? and why we have those two difference  
> entry address?
>
> my machine class in machines.py:
> class creator(pxa):
>    virtual = False
>    timer_driver = "pxa250_timer"
>    uart = "FFUART"
>    subplatform = "pxa270"
>    drivers = [timer_driver] + pxa.drivers
>
>    skyeye = "creator.skyeye"
>    memory = pxa.memory.copy()
>    memory['physical'] = [(0xa0000000L, 0xa3FFFFFFL)]
>    cpp_defines = pxa.cpp_defines + [("PLATFORM_PXA", 1),  
> ("SERIAL_FFUART", 1),                   ("CONFIG_PXA270", 1),  
> ("CONFIG_RESTRICTED_VM", 1)]
>
> _______________________________________________
> Developer mailing list
> Developer at okl4.org
> https://lists.okl4.org/mailman/listinfo/developer




More information about the Developer mailing list