The link-edit models folder contains a set of link-edit models, each one describing how to link-edit a particular type of binary file.
The models.xml file contains the standard set of link-edit models:
bootconf_model specifies the default link-edit model for bootconf programs
bootstrap_model specifies the default link-edit model for bootstrap programs
debug_driver_model specifies the default link-edit model for debug agent drivers
debug_agent_model specifies the default link-edit model for debug agents
microkernel_model specifies the default link-edit model for the micro-kernel
driver_model specifies the default link-edit model for built-in drivers
supervisor_actor_model specifies the default link-edit model for supervisor actors
user_actor_model specifies the default link-edit model for user actors
Usually, the board-specific configuration includes the models defined in model.xml and defines a small number of board-specific models.
A link-edit model is specified by an object of type Binary which defines the following fields:
type is an enumeration specifying how the resulting program will be activated by the ChorusOS operating system boot process.
If a type value is not specified, the program will be activated by a specific procedure such as processor hardware reset or ChorusOS operating system afexec.
ro is an optional field specifying link-edit instructions for read-only sections (such as text and initialized read-only data). If the field is not specified, read-only sections will be link-edited using instructions for read-write sections.
rw is an optional field specifying link-edit instructions for read-write data sections. If the field is not specified, the program must not contain read-write data sections.
bss is an optional field specifying link-edit instructions for zero initialized read-write data sections. If the field is not specified, zero-initialized read-write sections will be link-edited using instructions for read-write sections.
strip is an enumeration specifying whether or not ELF headers, symbols and debug information must be included in the resulting program image.
If the value of strip is NOTHING, the resulting image will contain all ELF headers, symbol tables and debug information.
If the value of strip is ALL, the resulting image will contain program segment images only.
If the value of strip is SYMBOLS, the resulting image will contain program segment images and ELF file and segment headers.
The values of the ro, rw, and bss fields are objects of the type Segment. A Segment object specifies link-edit instructions for the set of sections held by the segment and instructions for the segment loading for execution. In the Segment object:
The optional area field is a reference to an Area object. If the field is defined, each section must be link-edited into an address range dynamically allocated in the linking area, whereas if the field is not defined, each section must be link-edited at the address equal to the section's image start in the memory bank.
If the value of the boolean xip is true, the segment must be executed at its place in the memory bank. If the value of the boolean xip is false the segment image must be copied in RAM for execution.
Therefore, if for a given segment a linking area is not defined (for instance, the segment is to be link-edited at its place in the memory bank) ,the xip attribute must be true.
If, for a segment, a linking area is defined, the xip attribute can be either:
True. In this case the linking area must be a virtual one.
False. In this case the linking area can be virtual or physical.
Example 5-6 is an extract of the SBC8260 board-specific configuration file, and contains the standard link-edit models and the link-edit model definition which contains the trampoline program.
<folder name='Link-edit models'> <description>layouts of executable binary files</description> <folderRef href='model.xml' /> <folder name='Genesis2-specific link-edit models'> <description>layouts of executable binary files</description> <definition name='trampoline_model'> <description>trampoline (eg. power-up) program link-edit model</description> <type name='Binary' /> <value field='ro'> <value field='xip'><true/></value> </value> <value field='strip'><const>ALL</const></value> </definition> </folder> </folder>
The trampoline program does not contain any data and its text section must be link-edited at its place in its memory bank, trampoline_bank.