[En-Nut-Discussion] NutOS relocatable?
ole.reinhardt at embedded-it.de
Thu Apr 7 12:25:54 CEST 2011
> AFAIK, you cannot force the compiler to avoid absolute locations.
> Therefore the linker will create a binary, which can only run at a fixed
> memory location on targets without MMU. In order to create relocatable
> code, you need to use assembly language.
At least it must be possible with non-MMU CPUs too, as at least µCLinux
is running on non-MMU Platforms and can run the code more or less
anywhere in the memory. But indeed it has it's own dynamic loader/linker
(e.g. for the shared objects/libraries).
> As you would need only 2 or 3 different binaries, a funny idea pops up.
> You may create a basic binary for the default location and use some kind
> of patching mechanism to modify this code to run at a different
> location. Your custom binary would then consist of 2 parts, the patch
> location table and the unpatched, default binary. In the most simple
> case you'd only need to add/subtract a fixed offset to all patch locations.
Another funny Idea would be runtime loadable code, as the OS could stay
in one location and the code could run from anywhere in the memory and
just use the existing API (that's how the dynamic linker works).
But sound quite havy to implement...
Thermotemp GmbH, Embedded-IT
Embedded Hard-/ Software and Open Source Development,
Integration and Consulting
Geschäftsstelle Siegen - Steinstraße 67 - D-57072 Siegen -
tel +49 (0)271 5513597, +49 (0)271-73681 - fax +49 (0)271 736 97
Hauptsitz - Hademarscher Weg 7 - 13503 Berlin
Tel +49 (0)30 4315205 - Fax +49 (0)30 43665002
Geschäftsführer: Jörg Friedrichs, Ole Reinhardt
Handelsregister Berlin Charlottenburg HRB 45978 UstID DE 156329280
More information about the En-Nut-Discussion