Contained WithinFind More DocumentationFeatured Support Resources | Download this book in PDF (159 KB)
Chapter 7 XML SyntaxThis Chapter gives a formal description of the XML language used in the ChorusOS configuration files. The conf directory described throughout this document includes several XML files that you can use as examples when you need to modify the XML configuration files. The ChorusOS 4.0 Porting Guide also explains how to modify the XML configuration files when adapting ChorusOS to a new target platform. XML FilesThe grammar given here is a simplified overview of the ECML language. ECML is a language based on XML. The ECML DTD is located in <bin_dir>/tools/ews/ChorusOS.dtd file. Table 7-1 Semantics of Grammar in XML Files
The Attributes Tables in the sections below describe the XML attributes that can be used with the tags. ConfigurationThis is the topmost scope level. A configuration must start with a <configuration> tag. <configuration>
[ <description> ] [ <typedef>* ] [{ <definition> | <feature> | <tunable> ]*
[ <setting>* ] [ <action>* ] [ <constraint>* ]
[{ <folder> | <folderRef> }]*
Table 7-2 Attributes for Configuration
Folder DeclarationA folder is used to scope variables, and to set up a hierarchy in the ChorusOS system configuration. A condition can be used on a folder to disable it (if the condition evaluates to false). Any element located in a disabled folder is also disabled. <folder> [ <description> ] [ <typedef>* ] [ <definition> | <feature> | <tunable> ]* [ <setting>* ] [ <action>* ] [ <constraint>* ] [ <folder> | <folderRef> ]*Table 7-3 Attributes for Folder
Folder LinkA folder link is used to include another file. This is used to split the configuration into several files. <folderRef>Table 7-4 Attributes for Folder Link
DescriptionThis is used to bind a description to an element. The description text can be displayed in a configuration tool. <description> text DefinitionThis is used to declare a variable. The declaration is fully typed, and can be conditioned by a <condition> boolean expression. If the condition evaluates to 'false', the variable is not declared. <definition>
[ <description> ] [ <condition> ] type_content [{ expression | <value>* }]
Table 7-5 Attributes of Definition
FeatureThis is used to declare a ChorusOS system feature. A feature declaration has the same semantics as a variable declaration, but it is always visible, configurable, and global. <feature> [ <description> ] [ <condition> ] type_content [ <const> | boolean_values ]Table 7-6 Attributes for Feature
TunableThis is used to declare a ChorusOS system tunable. A tunable declaration has the same semantics as a variable declaration, but it is always visible, configurable, and global. <tunable> [ <description> ] [ <condition> ] type_content [ <const> | boolean_const ]Table 7-7 Attributes for Tunable
Boolean ConstantsThis defines the 'true' and 'false' boolean constants. boolean_const
{ <true> | <false> }
Type ContentThis is the set of types available for variable declarations. type_content
{ <bool> | <int> | <string> | <enum> | <struct> | <list> | <type> }
IntegersThis is used to declare a variable as an integer. An integer is assigned a value of 64 bits. <int>Table 7-8 Attribute for Integer
StringThis is used to declare a variable as a string. <string> EnumerationsThis is used to declare an enumerated value. The <const> sub-elements define all the possible values of the enumeration. <enum> <const>+ StructuresThis is used to declare a structured variable. <struct> <field>+ Structure FieldsThis is used to describe the characteristics of a structure field. <field> [ <description> ] type_content expressionTable 7-9 Attributes of Field
ListsUsed to declare a list variable. The type_content sub-element is used to type the element of the list. Table 7-10 Attributes of List
Boolean ExpressionsBoolean expressions are written in a post-fixed notation. They are used wherever a boolean result is expected. boolean_expression
{ boolean_const | <and> | <or> | <not> | <equal> | <notequal> |
<ifdef> | <imply> }
ExpressionsGeneric expressions are an extension of boolean expressions which can produce variable reference, string, or enumeration constants. expression
{ boolean_expression | <ref> | <vstring> | <const> }
Variable ReferenceThis is used to reference another variable by its name. The variable must be declared and accessible in the scope of this reference. <ref>Table 7-11 Attributes of Variable Reference
Test of Variable ExistenceThis test returns true if the specified variable exists or has been declared. <ifdef>Table 7-12 Attribute of Variable Existence
Variable valueThis allows you to get the current value of a variable. The specified variable must have been declared previously. <var>Table 7-13 Attributes of Variable Value
ConditionsA condition is used to validate or invalidate an element. <condition> boolean_expression TypedefThis declares a new type. A type definition is global in the configuration, and can be used in a 'type' reference. <typedef> [ <description> ] type_content TypeThis is used to reference a type definition. <type>Table 7-14 Attributes of Type
SettingsThis is the assignment of a variable . The named variable is assigned with the given value. The variable must already have been declared before, and the value must have a correct type. <setting>
[ <description> ] [ <condition> ] type_content { expression | <value>* }
Table 7-15 Attribute of Setting
ConstraintsA constraint is a boolean expression used to ensure the integrity of the configuration. If a constraint has a false value, the configuration tool considers the configuration to be invalid, and not to be used to generate a ChorusOS system image. <constraint> [ <description> ] boolean_expressionTable 7-16 Attribute of Constraint
ActionsAn action takes a parameter which specifies the precise effect that will be performed by a configuration tool. <action>
[ <description> ] [ <condition> ] <application> {<definition>|expression}
Table 7-17 Attribute of Action
Action ApplicationThis determines which action of the configuration tool will be applied. Currently, only the configure application exists and uses a variable typed as Configure structure as a parameter. <application> text |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||