summaryrefslogtreecommitdiff
path: root/ecos/doc/sgml/user-guide/configuration.sgml
blob: c06fa89cf9b17f0a82b125f1bf3b52c13164b40f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
<!-- {{{ Banner                         -->

<!-- =============================================================== -->
<!--                                                                 -->
<!--     configuration.sgml                                          -->
<!--                                                                 -->
<!--     eCos User Guide                                             -->
<!--                                                                 -->
<!-- =============================================================== -->
<!-- ####ECOSDOCCOPYRIGHTBEGIN####                                       -->
<!-- ===============================================================     -->
<!-- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. -->
<!-- This material may be distributed only subject to the terms          -->
<!-- and conditions set forth in the Open Publication License, v1.0      -->
<!-- or later (the latest version is presently available at              -->
<!-- http://www.opencontent.org/openpub/)                                -->
<!-- Distribution of the work or derivative of the work in any           -->
<!-- standard (paper) book form is prohibited unless prior               -->
<!-- permission obtained from the copyright holder                       -->
<!-- ===============================================================     -->
<!-- ####ECOSDOCCOPYRIGHTEND####                                         -->
<!-- =============================================================== -->
<!-- #####DESCRIPTIONBEGIN####                                       -->
<!--                                                                 -->
<!-- ####DESCRIPTIONEND####                                          -->
<!-- =============================================================== -->

<!-- }}} -->

<PART id="configuration-and-the-package-repository">
<TITLE>Configuration and the Package Repository</TITLE>
<PARTINTRO>
<PARA>The following chapters contain information on running
	<COMMAND>ecosconfig</COMMAND> (the command line tool that
	manipulates configurations and constructs build trees) and on
	managing a source repository across multiple versions of
	<productname>eCos</productname>. </PARA>
</PARTINTRO>
<CHAPTER id="manual-configuration">
<TITLE>Manual Configuration</TITLE>

    <PARA><productname>eCos</productname> developers will generally use the graphical
      Configuration Tool for configuring an <productname>eCos</productname> system and building
      the target library. However, some user prefer to use command
      line tools. These command line tools can also be used for batch
      operations on all platforms, for example as part of a nightly
      rebuild and testing procedure.
    </PARA>

<PARA>In the current release of the system the command line tools
      do not provide exactly the same functionality as the graphical
      tool. Most importantly, there is no facility to resolve
      configuration conflicts interactively.</PARA>
<PARA>The <productname>eCos</productname> configuration system, both graphical and command
      line tools, are under constant development and enhancement.
      Developers should note that the procedures described may change
      considerably in future releases. </PARA>

<SECT1 id="directory-tree-structure">
<TITLE>Directory Tree Structure</TITLE>
<PARA>When building <productname>eCos</productname> there are three main directory trees to
	consider: the source tree, the build tree, and the install
	tree.</PARA>
<PARA>The source tree, also known as the component repository,
	  is read-only. It is possible to use a single component
	  repository for any number of different configurations, and
	  it is also possible to share a component repository between
	  multiple users by putting it on a network drive.</PARA>
<PARA>The build tree contains everything that is specific to a
	  particular configuration, including header and other files
	  that contain configuration data, and the object files that
	  result from compiling the system sources for this
	  configuration. </PARA>
<PARA>The install tree is usually located in the <filename>install</filename> subdirectory
of the build tree. Once an <productname>eCos</productname> system has been built, the install
tree contains all the files needed for application development including
the header files and the target library. By making copies of the
install tree after a build it is possible to separate application
development and system configuration, which may be desirable for
some organizations. </PARA>
</SECT1>

<SECT1 id="creating-build-tree">
<TITLE>Creating the Build Tree</TITLE>
<PARA>Generating a build tree is a non-trivial operation and
	  should not be attempted manually. Instead, <productname>eCos</productname> is shipped
	  with a tool called <COMMAND>ecosconfig</COMMAND> that should
	  be used to create a build tree.</PARA>
<PARA>Usually <command>ecosconfig</command> will be
run inside the build tree itself. If you are creating a new build
tree then typically you will create a new empty directory using
the <command>mkdir</command> command, <command>cd</command> into
that directory, and then invoke <command>ecosconfig</command> to
create a configuration. By default, the configuration is stored
in a file <filename>ecos.ecc</filename> in the current
directory. The configuration may be modified by editing this file directly. <command>ecosconfig</command> itself
deals with a number of coarse-grained configuration options such
as the target platform and the packages that should be used.</PARA>
<PARA>The <command>ecosconfig</command> tool is also
used subsequently to generate a build tree for a configuration.
Once a build tree exists, it is possible to run <command>ecosconfig</command> again
inside the same build tree. This will be necessary if your wish
to change some of the configuration options.</PARA>
<PARA><COMMAND>ecosconfig</COMMAND> does not generate
the top-level directory of the build tree; you must do this
	yourself. </PARA>
<SCREEN>$ mkdir ecos-work
$ cd ecos-work</SCREEN>
<PARA>The next step is to run <COMMAND>ecosconfig</COMMAND>: </PARA>
<SCREEN>$ ecosconfig &lt;qualifiers&gt; &lt;command&gt;</SCREEN>
<SECT2>
<TITLE>ecosconfig qualifiers</TITLE>
<PARA>The available command line qualifiers for
	    <COMMAND>ecosconfig</COMMAND> are as follows. Multiple
	    qualifiers may be used on the command line:
	  </PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM><OPTION>--help</OPTION></TERM>
<LISTITEM>
<PARA>Provides basic usage guidelines for the
	      available commands and qualifiers.</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM><OPTION>--config=&lt;file&gt;</OPTION></TERM>
<LISTITEM>
<PARA>Specifies an <productname>eCos</productname> configuration save file for
		  use by the tool. By default, the file
		  <filename>ecos.ecc</filename> in the
		  current directory is used. Developers may prefer to
		  use a common location for all their <productname>eCos</productname>
		  configurations rather than keep the configuration
		  information in the base of the build tree.</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM><OPTION>--prefix=&lt;dir&gt;</OPTION></TERM>
<LISTITEM>
<PARA>Specifies an alternative location for the
		  install tree. By default, the install tree resides
		  inside the <filename>install</filename>
		  directory in the build tree. Developers may prefer
		  to locate the build tree in a temporary file
		  hierarchy but keep the install tree in a more
		  permanent location.</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM><OPTION>--srcdir=&lt;dir&gt;</OPTION></TERM>
<LISTITEM>
<PARA>Specifies the location of the component
		  repository. By default, the tool uses the location
		  specified in the
		  <REPLACEABLE>ECOS_REPOSITORY</REPLACEABLE>
		  environment variable. Developers may prefer to use
		  of this qualifier if they are working with more than
		  one repository.</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM><OPTION>--no-resolve</OPTION></TERM>
<LISTITEM>
<PARA>Disables the implicit resolution of conflicts
		  while manipulating the configuration data.
		  developers may prefer to resolve conflicts by
		  editing the <productname>eCos</productname> configuration save file
		  manually.</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM><OPTION>--ignore-errors</OPTION></TERM>
<TERM><OPTION>-i</OPTION></TERM>
<LISTITEM>
<PARA>
By default, ecosconfig will exit with an error code if the current
configuration contains any conflicts, and it is not possible to
generate or update a build tree for such configurations. This
qualifier causes ecosconfig to ignore such problems, and hence it is
possible to generate a build tree even if there are still
conflicts. Of course, there are no guarantees that the resulting
system will actually do anything.
</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM><OPTION>--verbose</OPTION></TERM>
<TERM><OPTION>-v</OPTION></TERM>
<LISTITEM>
<PARA>
Display more information.
</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM><OPTION>--quiet</OPTION></TERM>
<TERM><OPTION>-q</OPTION></TERM>
<LISTITEM>
<PARA>
Display less information.
</PARA>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
<PARA>
The <OPTION>--config</OPTION>, <OPTION>--prefix</OPTION> and
<OPTION>--srcdir</OPTION> qualifiers can also be written with two arguments,
for example:
</para>
<SCREEN>
ecosconfig --srcdir <REPLACEABLE>&lt;dir&gt;</REPLACEABLE> ...
</SCREEN>
<para>
This simplifies filename completion with some shells.
</PARA>
</SECT2>
<SECT2>
<TITLE>ecosconfig commands</TITLE>
<PARA>The available commands for
	    <COMMAND>ecosconfig</COMMAND> are as
	    follows:</PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM><COMMAND>list</COMMAND></TERM>
<LISTITEM>
<PARA>Lists the available packages, targets and
		  templates as installed in the <productname>eCos</productname> repository.
		  Aliases and package versions are also
		  reported.</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM><COMMAND>new &lt;target&gt; [&lt;template&gt; [&lt;version&gt;]]</COMMAND></TERM>
<LISTITEM>
<PARA>Creates a new <productname>eCos</productname> configuration for
		  the specified target hardware and saves it. A
		  software template may also be specified. By default,
		  the template named &lsquo;default&rsquo; is used. If
		  the template version is not specified, the latest
		  version is used.</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM><COMMAND>target &lt;target&gt;</COMMAND></TERM>
<LISTITEM>
<PARA>Changes the target hardware selection
		  for the <productname>eCos</productname> configuration. This has the effect of
		  unloading packages supporting the target selected
		  previously and loading the packages which support
		  the new hardware. This command will be used
		  typically when switching between a simulator and
		  real hardware.</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM><COMMAND>template &lt;template&gt; [&lt;version&gt;]</COMMAND></TERM>
<LISTITEM>
<PARA>Changes the template selection for the <productname>eCos</productname>
		  configuration. This has the effect of unloading
		  packages specified by the template selected
		  previously and loading the packages specified by the
		  new template. By default, the latest version of the
		  specified template is used.</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM><COMMAND>remove &lt;packages&gt;</COMMAND></TERM>
<LISTITEM>
<PARA>Removes the specified packages from the <productname>eCos</productname>
		  configuration. This command will be used typically
		  when the template on which a configuration is based
		  contains packages which are not required.</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM><COMMAND>add &lt;packages&gt;</COMMAND></TERM>
<LISTITEM>
<PARA>Adds the specified packages to the <productname>eCos</productname> configuration. This
command will be used typically when the template on which a
configuration is based does not contain all the packages which are
required.For example, add-on packages provided by third parties will
not be known to the standard templates, so they will have to be added
explicitly. </PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM><COMMAND>version &lt;version&gt; &lt;packages&gt;</COMMAND></TERM>
<LISTITEM>
<PARA>Selects the specified version of a
		  number of packages in the <productname>eCos</productname> configuration. By
		  default, the most recent version of each package is
		  used. This command will be used typically when an
		  older version of a package is required.</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM><COMMAND>check</COMMAND></TERM>
<LISTITEM>
<PARA>Presents the following information
		  concerning the current configuration:</PARA>
<ORDEREDLIST>
<LISTITEM>
<PARA>the selected target hardware</PARA>
</LISTITEM>
<LISTITEM>
<PARA>the selected template</PARA>
</LISTITEM>
<LISTITEM>
<PARA>additional packages</PARA>
</LISTITEM>
<LISTITEM>
<PARA>removed packages</PARA>
</LISTITEM>
<LISTITEM>
<PARA>the selected version of packages
		      where this is not the most recent
		      version</PARA>
</LISTITEM>
<LISTITEM>
<PARA>conflicts in the current configuration</PARA>
</LISTITEM>
</ORDEREDLIST>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM><COMMAND>resolve</COMMAND></TERM>
<LISTITEM>
<PARA>Resolves conflicts identified in the
		  current <productname>eCos</productname> configuration by invoking an inference
		  capability. Resolved conflicts are reported, but not
		  all conflicts may be resolvable. This command will
		  be used typically following manual editing of the
		  configuration.</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM><COMMAND>export &lt;file&gt;</COMMAND></TERM>
<LISTITEM>
<PARA>Exports a minimal <productname>eCos</productname> configuration
		  save file with the specified name. This file
		  contains only those options which do not have their
		  default value. Such files are used typically to
		  transfer option values from one configuration to
		  another.</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM><COMMAND>import &lt;file&gt;</COMMAND></TERM>
<LISTITEM>
<PARA>Imports a minimal <productname>eCos</productname> configuration
		  save file with the specified name. The values of
		  those options specified in the file are applied to
		  the current configuration.</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM><COMMAND>tree</COMMAND></TERM>
<LISTITEM>
<PARA>Generates a build tree based on the current <productname>eCos</productname>
		  configuration. This command will be used typically
		  just before building <productname>eCos</productname>.Normally a build tree can
only be generated if if the configuration has no unresolved
conflicts, but <OPTION>--ignore-errors</OPTION> can be used to override
this.</PARA>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</SECT2>
</SECT1>
<SECT1 id="conflicts-and-constraints">
<TITLE>Conflicts and constraints</TITLE>
<PARA>Configuration options are not completely independent. For example
the C library's <FUNCTION>strtod()</FUNCTION> and <FUNCTION>atof()</FUNCTION>
functions rely on the math library package to provide certain functionality. If the math library package is removed then the C
library can no longer provide these functions. Each package describes constraints like these in CDL <EMPHASIS>"requires"</EMPHASIS> properties. If a constraint is not satisfied, then the configuration contains a conflict. For any given conflict there can
be several resolution options. For example, it would be possible to add the math library package back to the
configuration, or to disable the <FUNCTION>strtod()</FUNCTION> and <FUNCTION>atof()</FUNCTION> functions.</PARA>
<PARA>
The <productname>eCos</productname> configuration tools will report any conflicts in the current configuration. If there are any such conflicts
then the configuration is usually unsafe and it makes no sense to build and run <productname>eCos</productname> in such circumstances. In fact,
any attempt at building <productname>eCos</productname> is likely to fail. In exceptional cases it is possible to override this by using e.g. the
<OPTION>--ignore-errors</OPTION> qualifier with ecosconfig. 
</PARA>
<PARA>
Many constraints are fairly simple in nature, and the configuration tools contain an inference engine which can
resolve the associated conflicts automatically. For example, if the math library package is removed then the
inference engine can resolve the resulting conflict by disabling the configuration option for <FUNCTION>strtod()</FUNCTION> and <FUNCTION>atof()</FUNCTION>. All
such changes will be reported. Sometimes the inference engine cannot resolve a conflict, for example it is not
allowed to override a change that has been made explicitly by the user. Sometimes it will find a solution which does
not match the application's requirements. 
</PARA>
<PARA>
A typical session involving conflicts would look something like this: 
<SCREEN>
$ ecosconfig new pid
</SCREEN>This creates a new configuration with the default template. For most targets this will not result in any conflicts,
because the default settings for the various options meet the requirements of the default template.
</PARA><PARA> For some targets
there may be conflicts and the inference engine would come into play. 
<SCREEN>
$ ecosconfig remove libm 
U CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, new inferred value 0 
U CYGFUN_LIBC_strtod, new inferred value 0 
U CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, new inferred value 0 
</SCREEN>
ecosconfig reports that this change caused three conflicts, all in the C library. The inference engine was able to
resolve all the conflicts and update the relevant configuration options accordingly. </PARA>
<PARA>To suppress the inference engine <OPTION>--no-resolve</OPTION> can be used: 
<SCREEN>
$ ecosconfig new pid
$ ecosconfig --no-resolve remove libm 
C CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, "requires" constraint not satisfied:      CYGPKG_LIBM 
C CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, "requires" constraint not satisfied:      CYGPKG_LIBM 
C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM 
</SCREEN>
Three unresolved conflicts are reported.
</PARA>
<PARA>The <COMMAND>check</COMMAND> command can be used to get the current state of the
configuration, and the <OPTION>--verbose</OPTION> qualifier will provide additional information: </PARA>
<SCREEN>
$ ecosconfig --srcdir /home/bartv/ecc/ecc --verbose check 
Target: pid 
Template: default 
Removed:
 CYGPKG_LIBM 
3 conflict(s): 
C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM
 Possible solution: 
    CYGFUN_LIBC_strtod -> 0 
    CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT -> 0 
C CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, "requires" constraint not satisfied:      CYGPKG_LIBM 
 Possible solution: 
    CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT -> 0 
C CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, "requires" constraint not satisfied:      CYGPKG_LIBM 
 Possible solution: 
    CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT -> 0 
</SCREEN>
<PARA>
If the proposed solutions are acceptable, the resolve command can be used to apply them: 
<SCREEN>
$ ecosconfig resolve 
U CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, new inferred value 0 
U CYGFUN_LIBC_strtod, new inferred value 0 
U CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, new inferred value 0 
</SCREEN></PARA>
<PARA>The current configuration is again conflict-free and it is possible to generate a build tree. The <OPTION>--quiet</OPTION> qualifier can
be used to suppress the change messages, if desired.
</PARA><PARA>
When changing individual configuration options by editing the ecos.ecc file (as described below), the resulting
system should be checked and any problems should be resolved. For example, if CYGFUN_LIBC_strtod is
explicitly enabled in the savefile:
<SCREEN>
$ edit ecos.ecc
$ ecosconfig check 
Target: pid 
Template: default 
Removed: 
    CYGPKG_LIBM 
1 conflict(s): 
C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM 
$ ecosconfig resolve 
C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM 
</SCREEN>
In this case the inference engine cannot resolve the conflict automatically because that would involve changing a
user setting. Any attempt to generate a build tree will fail: 
<SCREEN>
$ ecosconfig --srcdir /home/bartv/ecc/ecc tree 
C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM
Unable to generate build tree, this configuration still contains conflicts.
Either resolve the conflicts or use --ignore-errors 
</SCREEN>
</PARA><PARA>
It is still possible to generate a build tree: 
<SCREEN>
$ ecosconfig --srcdir /home/bartv/ecc/ecc --ignore-errors tree 
C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM 
$ make 
</SCREEN>
In this case <productname>eCos</productname> will fail to build. In other cases of unresolved conflicts <productname>eCos</productname> may build, but may not run. In
general all conflicts should be resolved by editing the <FILENAME>ecos.ecc</FILENAME> file, by letting the inference engine make appropriate
changes, or by other means, before any attempt is made to build or run <productname>eCos</productname>. 
</PARA>
</SECT1>
<SECT1 id="building-the-system">
<TITLE>Building the System</TITLE>
<PARA>Once a build tree has been generated with
	  <COMMAND>ecosconfig</COMMAND>, <!-- <index></index>
	  -->building <productname>eCos</productname> is straightforward:</PARA>
<SCREEN>$ make</SCREEN>
<PARA>The build tree contains the subdirectories, makefiles,
	  and everything else that is needed to generate the default
	  configuration for the selected architecture and platform.
	  The only requirement is that the tools needed for that
	  architecture, for example
	  <COMMAND>powerpc-eabi-g++</COMMAND>,
	  are available using the standard search path. If this is not
	  the case then the <COMMAND>make</COMMAND> will
	  fail with an error message. If you have a multiprocessor
	  system then it may be more efficient to use:</PARA>
<SCREEN>$ make -j <REPLACEABLE>n</REPLACEABLE></SCREEN>
<PARA>where <REPLACEABLE>n</REPLACEABLE> is equal to the
	  number of processors on your system.</PARA>
<PARA>Once the <COMMAND>make</COMMAND> process
	  has completed, the install tree will contain the header
	  files and the target library that are needed for application
	  development. </PARA>
<PARA>It is also possible to build the system&rsquo;s test cases
for the current configuration:</PARA>
<SCREEN>$ make tests</SCREEN>
<PARA>The resulting test executables will end up in a
	  <FILENAME>tests</FILENAME> subdirectory of the
	  <!-- <index></index> -->install tree. </PARA>
<PARA>If disk space is scarce then it is possible to make the copy
of the install tree for application development purposes, and then
use: </PARA>
<SCREEN>$ make clean</SCREEN>
<PARA>The build tree will now use up a minimum of disk space &mdash; the
bulk of what is left consists of configuration header files that
you may have edited and hence should not be deleted automatically.
However, it is possible to rebuild the system at any time without
re-invoking <COMMAND>ecosconfig</COMMAND>, just by
running <COMMAND>make</COMMAND> again. </PARA>
<PARA>Under exceptional circumstances it may be necessary to run <COMMAND>make
clean</COMMAND> for other reasons, such as when a new release
of the toolchain is installed. The toolchain includes a number of
header files which are closely tied to the compiler, for example <filename>limits.h</filename>,
and these header files are not and should not be duplicated by <productname>eCos</productname>.
The makefiles perform header file dependency analysis, so that when
a header file is changed all affected sources will be rebuilt during
the next <COMMAND>make</COMMAND>. This is very useful
when the configuration header files are changed, but it also means
that a build tree containing information about the locations of
header files must be rebuilt. If a new version of the toolchain
is installed and the old version is removed then this location information
is no longer accurate, and <COMMAND>make</COMMAND> will
complain that certain dependencies cannot be satisfied. Under such circumstances
it is necessary to do a <COMMAND>make clean</COMMAND> first. </PARA>
</SECT1>
<SECT1 id="ecos-packages">
<TITLE>Packages</TITLE>
<PARA><productname>eCos</productname> is a component architecture. The system comes as a
	  number of <!-- <index></index> -->packages which can be
	  enabled or disabled as required, and new packages can be
	  added as they become available. Unfortunately, the packages
	  are not completely independent: for example the &micro;ITRON
	  compatibility package relies almost entirely on
	  functionality provided by the kernel package, and it would
	  not make sense to try to build &micro;ITRON if the kernel
	  was disabled. The C library has fewer dependencies: some
	  parts of the C library rely on kernel functionality, but it
	  is possible to disable these parts and thus build a system
	  that has the C library but no kernel. The
	<command>ecosconfig</command> tool has the capability of
	    checking that all the dependencies are satisfied, but it
	    may still be possible to produce configurations that will
	    not build or (conceivably) that will build but not run.
	    Developers should be aware of this and take appropriate
	    care.</PARA>
<PARA>By default, <!-- <index></index> --><command>ecosconfig</command> will
include all packages that are appropriate for the specified hardware
in the configuration. The common <!-- <index></index> -->HAL package and
the <productname>eCos</productname> infrastructure must be present in every configuration. In
addition, it is always necessary to have one architectural HAL package
and one platform HAL package. Other packages are optional, and can
be added or removed from a configuration as required.</PARA>
<PARA>The application may not require all of the packages; for example,
it might not need the &micro;ITRON compatibility
package, or the floating point support provided by the math library.
There is a slight overhead when <productname>eCos</productname> is built because the packages
will get compiled, and there is also a small disk space penalty.
However, any unused facilities will get stripped out at link-time,
so having redundant packages will not affect the final executable. </PARA>
</SECT1>
<SECT1 id="coarse-grained-configuration">
<TITLE>Coarse-grained Configuration</TITLE>
<PARA>Coarse-grained <!-- <index></index> -->configuration of
	  an <productname>eCos</productname> system means making configuration changes using the
	  <COMMAND>ecosconfig</COMMAND> tool. These changes
	  include: </PARA>
<ORDEREDLIST>
<LISTITEM>
<PARA>switching to different target hardware</PARA>
</LISTITEM>
<LISTITEM>
<PARA>switching to a different template</PARA>
</LISTITEM>
<LISTITEM>
<PARA>adding or removing a package</PARA>
</LISTITEM>
<LISTITEM>
<PARA>changing the version of a package</PARA>
</LISTITEM>
</ORDEREDLIST>
<PARA>Whenever <COMMAND>ecosconfig</COMMAND> generates or
	  updates an <productname>eCos</productname> configuration, it generates a configuration
	  save file.</PARA>
<PARA>Suppose that the configuration was first created using
	  the following command line: </PARA>
<SCREEN>$ ecosconfig new stdeval1</SCREEN>
<PARA>To change the target hardware to the Cogent CMA28x
	  PowerPC board, the following command would be needed:
	</PARA>
<SCREEN>$ ecosconfig target cma28x</SCREEN>
<PARA>To switch to the PowerPC simulator instead: </PARA>
<SCREEN>$ ecosconfig target psim</SCREEN>
<PARA>As the hardware changes, hardware-related packages such as
the HAL packages and device drivers will be added to and removed
from the configuration as appropriate. </PARA>
<PARA>To remove any package from the current configuration, use
the <COMMAND>remove</COMMAND> command: </PARA>
<SCREEN>$ ecosconfig remove uitron</SCREEN>
<PARA>You can disable multiple packages using multiple arguments,
for example: </PARA>
<SCREEN>$ ecosconfig remove uitron libm</SCREEN>
<PARA>If this turns out to have been a mistake then you can
	  re-enable one or more packages with the
	  <COMMAND>add</COMMAND> command: </PARA>
<SCREEN>$ ecosconfig add libm</SCREEN>
<PARA>Changing the desired version for a package is also
	  straightforward:</PARA>
<SCREEN>$ ecosconfig version v2_1 kernel</SCREEN>
<PARA>It is necessary to regenerate the build tree and header
	  files following any changes to the configuration before
	  rebuilding <productname>eCos</productname>:</PARA>
<SCREEN>$ ecosconfig tree</SCREEN>
</SECT1>
<SECT1 id="fine-grained-configuration">
<TITLE>Fine-grained Configuration</TITLE>
<PARA><COMMAND>ecosconfig</COMMAND> only provides
	  coarse-grained control over the configuration: the hardware,
	  the template and the packages that should be built. Unlike
	  the Configuration Tool,
	  <COMMAND>ecosconfig</COMMAND> does not provide
	  any facilities for manipulating finer-grained <!--
	  <index></index> -->configuration options such as how many
	  priority levels the scheduler should support. There are
	  hundreds of these options, and manipulating them by means of
	  command line arguments would not be sensible. </PARA>
<PARA>In the current system fine-grained configuration options may
be manipulated by manual editing of the configuration file. When
a file has been edited in this way, the <COMMAND>ecosconfig</COMMAND> tool
should be used to check the configuration for any conflicts which
may have been introduced:</PARA>
<SCREEN>$ ecosconfig check</SCREEN>
<PARA>The <COMMAND>check</COMMAND> command will list
all conflicts and will also rewrite the configuration file, propagating
any changes which affect other options. The user may choose to resolve
the conflicts either by re-editing the configuration file manually
or by invoking the inference engine using the <COMMAND>resolve</COMMAND> command:</PARA>
<SCREEN>$ ecosconfig resolve</SCREEN>
<PARA>The  <COMMAND>resolve</COMMAND> command will
list all conflicts which can be resolved and save the resulting changes
to the configuration.</PARA>
<PARA>It is necessary to regenerate the build tree and header files
following any changes to the configuration before rebuilding <productname>eCos</productname>:</PARA>
<SCREEN>$ ecosconfig tree</SCREEN>
<PARA>All the configuration options and their descriptions are listed
in the <citetitle><productname>eCos</productname> Reference Manual</citetitle>. </PARA>
</SECT1>
<SECT1 id="editing-an-ecos-savefile">
<TITLE>Editing an <productname>eCos</productname> Savefile</TITLE>
<PARA>The <productname>eCos</productname> configuration information is held in a single
	  savefile, typically <FILENAME>ecos.ecc</FILENAME>, which can
	  be generated by either the GUI configuration tool or by the
	  command line <command>ecosconfig</command> tool. The file
	  normally exists at the top level of the build tree. It is a
	  text file, allowing the various configurations options to be
	  edited inside a suitable text editor or by other programs or
	  scripts, as well as in the GUI config tool.</PARA>
<PARA>An <productname>eCos</productname> savefile is actually a script in the <EMPHASIS>Tcl</EMPHASIS> programming
language, so any modifications to the file need to preserve Tcl
syntax. For most configuration options, any modifications will be
trivial and there is no need to worry about Tcl syntax. For example,
changing a 1 to a 0 to disable an option.  For more complicated
options, for example<literal> CYGDAT_UITRON_TASK_EXTERNS</literal>,
which involves some lines of C code, more care has
to be taken. If an edited savefile is no longer a valid Tcl script
then the configuration tools will be unable to read back the data
for further processing, for example to generate a build tree. An
outline of Tcl syntax is given below. One point worth noting here
is that a line that begins with a &ldquo;#&rdquo; is
usually a comment, and the bulk of an <productname>eCos</productname> savefile actually consists
of such comments, to make it easier to edit.</PARA>
<SECT2>
<TITLE>Header</TITLE>
<PARA>An <productname>eCos</productname> savefile begins with a header, which typically
	    looks something like this:</PARA>
<SCREEN># eCos saved configuration
# ---- commands -------------------------------------------------------- 
# This section contains information about the savefile format. 
# It should not be edited. Any modifications made to this section 
# may make it impossible for the configuration tools to read 
# the savefile.

cdl_savefile_version 1; 
cdl_savefile_command cdl_savefile_version {};
cdl_savefile_command cdl_savefile_command {}; 
cdl_savefile_command 
cdl_configuration { description hardware template package }; 
cdl_savefile_command cdl_package { value_source user_value wizard_value inferred_value }; 
cdl_savefile_command cdl_component { value_source user_value wizard_value inferred_value }; 
cdl_savefile_command cdl_option { value_source user_value wizard_value inferred_value }; 
cdl_savefile_command cdl_interface { value_source user_value wizard_value inferred_value }; 
      </SCREEN>
<PARA>This section of the savefile is intended for use by the
	configuration system, and should not be edited. If this
	section is edited then the various configuration tools may no
	longer be able to read in the modified savefile.</PARA>
</SECT2>
<SECT2>
<TITLE>Toplevel Section</TITLE>
<PARA>The header is followed by a section that defines the
	    configuration as a whole. A typical example would
	    be:</PARA>
<SCREEN># ---- toplevel -------------------------------------------------------- 
# This section defines the toplevel configuration object. The only 
# values that can be changed are the name of the configuration and 
# the description field. It is not possible to modify the target, 
# the template or the set of packages simply by editing the lines 
# below because these changes have wide-ranging effects. Instead 
# the appropriate tools should be used to make such modifications.

cdl_configuration eCos {     
description &ldquo;&ldquo; ;         

# These fields should not be modified.     
hardware    pid ;     
template    uitron ;     
package -hardware CYGPKG_HAL_ARM current ;     
package -hardware CYGPKG_HAL_ARM_PID current ;     
package -hardware CYGPKG_IO_SERIAL current ;     
package -template CYGPKG_HAL current ;     
package -template CYGPKG_IO current ;     
package -template CYGPKG_INFRA current ;     
package -template CYGPKG_KERNEL current ;     
package -template CYGPKG_UITRON current ;     
package -template CYGPKG_LIBC current ;     
package -template CYGPKG_LIBM current ;     
package -template CYGPKG_DEVICES_WALLCLOCK current ;     
package -template CYGPKG_ERROR current ; 
}; 
      </SCREEN>
<PARA>This section allows the configuration tools to reload the
various packages that make up the configuration. Most of the information
should not be edited. If it is necessary to add a new package or
to remove an existing one then the appropriate tools should be used
for this, for example:</PARA>
<PROGRAMLISTING>$ ecosconfig remove CYGPKG_LIBM</PROGRAMLISTING>
<PARA>There are two fields which can be edited. Configurations have
a name; in this case <productname>eCos</productname>. They can also have a description, which
is some arbitrary text. The configuration tools do not make use
of these fields, they exist so that users can store additional information
about a configuration.</PARA>
</SECT2>
<SECT2>
<TITLE>Conflicts Section</TITLE>
<PARA>The toplevel section is followed by details of all the
	    conflicts (if any) in the configuration, for
	    example:</PARA>
<SCREEN># ---- conflicts ------------------------------------------------------- 
# There are 2 conflicts. 
# 
# option CYGNUM_LIBC_TIME_DST_DEFAULT_OFFSET 
#   Property LegalValues 
#   Illegal current value 100000 
#   Legal values are: -90000 to 90000 
# 
# option CYGSEM_LIBC_TIME_CLOCK_WORKING 
#   Property Requires 
#   Requires constraint not satisfied: CYGFUN_KERNEL_THREADS_TIMER 
	  </SCREEN>
<PARA>When editing a configuration you may end up with something
that is invalid. Any problems in the configuration will be reported
in the conflicts section. In this case there are two conflicts.
The option <literal>CYGNUM_LIBC_TIME_DST_DEFAULT_OFFSET</literal> has
been given an illegal value: typically this would be fixed by searching
for the definition of that option later on in the savefile and modifying
the value. The second conflict is more interesting, an unsatisfied <EMPHASIS>requires</EMPHASIS> constraint.
Configuration options are not independent: disabling some functionality
in, say, the kernel, can have an impact elsewhere; in this case
the C library. The various dependencies between the options are
specified by the component developers and checked by the configuration
system. In this case there are two obvious ways in which the conflict could
be resolved: re-enabling <literal>CYGFUN_KERNEL_THREADS_TIMER</literal>,
or disabling <literal>CYGSEM_LIBC_TIME_CLOCK_WORKING</literal>.
Both of these options will be listed later on in the file.</PARA>
<PARA>Some care has to be taken when modifying configuration options,
to avoid introducing new conflict. For instance it is possible that
there might be other options in the system which have a dependency
on <literal>CYGSEM_LIBC_TIME_CLOCK_WORKING</literal>,
so disabling that option may not be the best way to resolve the
conflict. Details of all such dependencies are provided in the appropriate
places in the savefile.</PARA>
<PARA>It is not absolutely required that a configuration be conflict-free
before generating a build tree and building <productname>eCos</productname>. It is up to the
developers of each component to decide what would happen if an attempt
is made to build <productname>eCos</productname> while there are still conflicts. In serious
cases there is likely to be a compile-time failure, or possibly
a link-time failure. In less serious cases the system may build
happily and the application can be linked with the resulting library,
but the component may not quite function as intended - although
it may still be good enough for the specific needs of the application.
It is also possible that everything builds and links, but once in
a while the system will unaccountably crash. Using a configuration
that still has conflicts is done entirely at the user&rsquo;s
risk.</PARA>
</SECT2>
<SECT2>
<TITLE>Data Section</TITLE>
<PARA>The bulk of the savefile lists the various packages,
	    components, and options, including their values and the
	    various dependencies. A number of global options come
	    first, especially those related to the build process such
	    as compiler flags. These are followed by the various
	    packages, and the components and options within those
	    packages, in order.</PARA>
<PARA>Packages, components and options are organized in a
	    hierarchy. If a particular component is disabled then all
	    options and sub-components below it will be inactive: any
	    changes made to these will have no effect. The savefile
	    contains information about the hierarchy in the form of
	    comments, for example:</PARA>
<SCREEN>cdl_package CYGPKG_KERNEL ... 
# &gt; 
cdl_component CYGPKG_KERNEL_EXCEPTIONS ... 
# &gt; 
cdl_option CYGSEM_KERNEL_EXCEPTIONS_DECODE ... 
cdl_option CYGSEM_KERNEL_EXCEPTIONS_GLOBAL ... 
# &lt; 
cdl_component CYGPKG_KERNEL_SCHED ... 
# &gt; 
cdl_option CYGSEM_KERNEL_SCHED_MLQUEUE ... 
cdl_option CYGSEM_KERNEL_SCHED_BITMAP ... 
# &lt; 
# &lt; 
	  </SCREEN>
<PARA>This corresponds to the following hierarchy:</PARA>
<SCREEN> CYGPKG_KERNEL
   CYGPKG_KERNEL_EXCEPTIONS
     CYGSEM_KERNEL_EXCEPTIONS_DECODE
     CYGSEM_KERNEL_EXCEPTIONS_GLOBAL
   CYGPKG_KERNEL_SCHED
     CYGSEM_KERNEL_SCHED_MLQUEUE
     CYGSEM_KERNEL_SCHED_BITMAP 
	  </SCREEN>
<PARA>Providing the hierarchy information in this way allows
	    programs or scripts to analyze the savefile and readily
	    determine the hierarchy. It could also be used by a
	    sufficiently powerful editor to support structured editing
	    of <productname>eCos</productname> savefiles. The information is not used by the
	    configuration tools themselves since they obtain the
	    hierarchy from the original CDL scripts.</PARA>
<PARA>Each configurable entity is preceded by a comment, of
	    the following form:</PARA>
<SCREEN># Kernel schedulers 
# doc: ref/ecos-ref/ecos-kernel-overview.html#THE-SCHEDULER 
# The eCos kernel provides a choice of schedulers. In addition 
# there are a number of configuration options to control the 
# detailed behaviour of these schedulers. 
cdl_component CYGPKG_KERNEL_SCHED {     
... 
}; 
	  </SCREEN>
<PARA>This provides a short textual alias
	    <literal>Kernel schedulers</literal> for the
	    component. If online documentation is available for the
	    configurable entity then this will come next. Finally
	    there is a short description of the entity as a whole. All
	    this information is provided by the component
	    developers.</PARA>
<PARA>Each configurable entity takes the form:</PARA>
<SCREEN>&lt;type&gt; &lt;name&gt; {
     &lt;data&gt;
};</SCREEN>
<PARA>Configurable entities may not be active. This can be either
because the parent is disabled or inactive, or because there are
one or more <EMPHASIS>active_if</EMPHASIS> properties. Modifying
the value of an inactive entity has no effect on the configuration,
so this information is provided first:</PARA>
<PARA></PARA>
<SCREEN>cdl_option CYGSEM_KERNEL_EXCEPTIONS_DECODE {     
# This option is not active     
# The parent CYGPKG_KERNEL_EXCEPTIONS is disabled     
... 
};
 
...

cdl_option CYGIMP_IDLE_THREAD_YIELD {     
# This option is not active     
# ActiveIf constraint: (CYGNUM_KERNEL_SCHED_PRIORITIES == 1)     
#     CYGNUM_KERNEL_SCHED_PRIORITIES == 32     
#   --&gt; 0     
... 
}; 

</SCREEN>
<PARA>For <literal>CYGIMP_IDLE_THREAD_YIELD</literal> the
savefile lists the expression that must be satisfied if the option
is to be active, followed by the current value of all entities that
are referenced in the expression, and finally the result of evaluating
that expression.</PARA>
<PARA>Not all options are directly modifiable in the savefile. First,
the value of packages (which is the version of that package loaded
into the configuration) cannot be modified here.</PARA>
<SCREEN>

cdl_package CYGPKG_KERNEL {     
# Packages cannot be added or removed, nor can their version be changed,     
# simply by editing their value. Instead the appropriate configuration     
# should be used to perform these actions.
...
};

</SCREEN>
<PARA>The version of a package can be changed using e.g.:    </PARA>
<SCREEN>$ ecosconfig version 1.3 CYGPKG_KERNEL</SCREEN>
<PARA>Even though a package&rsquo;s value cannot be modified
here, it is still important for the savefile to contain the details.
In particular packages may impose constraints on other configurable
entities and may be referenced by other configurable entities. Also
it would be difficult to understand or extract the configuration&rsquo;s
hierarchy if the packages were not listed in the appropriate places
in the savefile.</PARA>
<PARA>Some components (or, conceivably, options) do not have any
associated data. Typically they serve only to introduce another
level in the hierarchy, which can be useful in the context of the
GUI configuration tool.</PARA>
<SCREEN>

cdl_component CYGPKG_HAL_COMMON_INTERRUPTS {     
# There is no associated value. 
}; 

</SCREEN>
<PARA>Other components or options have a calculated value. These
are not user-modifiable, but typically the value will depend on
other options which can be modified. Such calculated options can
be useful when controlling what gets built or what ends up in the
generated configuration header files. A calculated value may also
effect other parts of the configuration, for instance, via a <EMPHASIS>requires</EMPHASIS> constraint.</PARA>
<SCREEN>

cdl_option BUFSIZ {     
# Calculated value: CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO ? CYGNUM_LIBC_STDIO_BUFSIZE : 0     
#     CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO == 1     
#     CYGNUM_LIBC_STDIO_BUFSIZE == 256     
# Current_value: 256 
}; 

</SCREEN>
<PARA>A special type of calculated value is the <EMPHASIS>interface</EMPHASIS>.
The value of an interface is the number of active and enabled options
which <EMPHASIS>implement</EMPHASIS> that interface. Again the value
of an interface cannot be modified directly; only by modifying the
options which implement the interface. However, an interface can
be referenced by other parts of the configuration. </PARA>
<SCREEN>cdl_interface CYGINT_KERNEL_SCHEDULER {     
# Implemented by CYGSEM_KERNEL_SCHED_MLQUEUE, active, enabled     
# Implemented by CYGSEM_KERNEL_SCHED_BITMAP, active, disabled     
# This value cannot be modified here.     
# Current_value: 1     
# Requires: 1 == CYGINT_KERNEL_SCHEDULER     
#     CYGINT_KERNEL_SCHEDULER == 1     
#   --&gt; 1

</SCREEN>
<SCREEN># The following properties are affected by this value     
# interface CYGINT_KERNEL_SCHEDULER     
#     Requires: 1 == CYGINT_KERNEL_SCHEDULER 
}; </SCREEN>
<PARA>If the configurable entity is modifiable then there will be
lines like the following:</PARA>
<SCREEN> 
cdl_option CYGSEM_KERNEL_SCHED_MLQUEUE {     
...     
# Flavor: bool     
# No user value, uncomment the following line to provide one.     
# user_value 1     
# value_source default     
# Default value: 1     
... 
}; 

</SCREEN>
<PARA>Configurable entities can have one of four different flavors:
none, bool, data and booldata. Flavor none indicates that there
is no data associated with the entity, typically it just acts as
a placeholder in the overall hierarchy. Flavor bool is the most
common, it is a simple yes-or-no choice. Flavor data is for more
complicated configuration choices, for instance the size of an array
or the name of a device. Flavor booldata is a combination of bool
and data: the option can be enabled or disabled, and there is some
additional data associated with the option as well.</PARA>
<PARA>In the above example the user has not modified this particular
option, as indicated by the comment and by the commented-out <literal>user_value</literal> line.
To disable this option the file should be edited to:</PARA>
<SCREEN>

cdl_option CYGSEM_KERNEL_SCHED_MLQUEUE {     
...     
# Flavor: bool     
# No user value, uncomment the following line to provide one.     
user_value 0     
# value_source default     
# Default value: 1     
... 
} 

</SCREEN>
<PARA>The comment preceding the <literal>user_value
0</literal> line can be removed if desired, otherwise it
will be removed automatically the next time the file is read and
updated by the configuration tools.</PARA>
<PARA>Much the same process should be used for options with the
data flavor, for example:</PARA>
<SCREEN> 
cdl_option CYGNUM_LIBC_TIME_DST_DEFAULT_OFFSET {     
# Flavor: data     
# No user value, uncomment the following line to provide one.     
# user_value 3600     
# value_source default     
# Default value: 3600     
# Legal values: -90000 to 90000 
}; 

</SCREEN>
<PARA>can be changed to:</PARA>
<SCREEN>

cdl_option CYGNUM_LIBC_TIME_DST_DEFAULT_OFFSET {     
# Flavor: data     
user_value 7200     
# value_source default     
# Default value: 3600     
# Legal values: -90000 to 90000 }; 

</SCREEN>
<PARA>Note that the original text provides the default value in
the <literal>user_value</literal> comment,
on the assumption that the desired new value is likely to be similar
to the default value. The <literal>value_source</literal> comment
does not need to be updated, it will be fixed up if the savefile
is fed back into the configuration system and regenerated.</PARA>
<PARA>For options with the booldata flavor, the <literal>user_value</literal> line
needs take two arguments. The first argument is for the boolean
part, the second for the data part. For example:</PARA>
<SCREEN> 
cdl_component CYGNUM_LIBM_COMPATIBILITY {     
# Flavor: booldata     
# No user value, uncomment the following line to provide one.    
# user_value 1 POSIX     
# value_source default     
# Default value: 1 POSIX     
# Legal values:  &ldquo;POSIX&rdquo; &ldquo;IEEE&rdquo; &ldquo;XOPEN&rdquo; &ldquo;SVID&rdquo;     
... 
}; 

</SCREEN>
<PARA>could be changed to:</PARA>
<SCREEN> 
cdl_component CYGNUM_LIBM_COMPATIBILITY {     
# Flavor: booldata     
user_value 1 IEEE     
# value_source default     
# Default value: 1 POSIX     
# Legal values:  &ldquo;POSIX&rdquo; &ldquo;IEEE&rdquo; &ldquo;XOPEN&rdquo; &ldquo;SVID&rdquo;     
... 
}; 

</SCREEN>
<PARA>or alternatively, if the whole component should be disabled,
to:</PARA>
<SCREEN> 
cdl_component CYGNUM_LIBM_COMPATIBILITY {     
# Flavor: booldata     
user_value 0 POSIX     
# value_source default     
# Default value: 1 POSIX     
# Legal values:  &ldquo;POSIX&rdquo; &ldquo;IEEE&rdquo; &ldquo;XOPEN&rdquo; &ldquo;SVID&rdquo;     
... 
}; 

</SCREEN>
<PARA>Some options take values that span multiple lines. An example
would be:</PARA>
<SCREEN>

cdl_option CYGDAT_UITRON_MEMPOOLVAR_INITIALIZERS {     
# Flavor: data     
# No user value, uncomment the following line to provide one.     
# user_value \     
# &ldquo;CYG_UIT_MEMPOOLVAR( vpool1, 2000 ), \\     
#  CYG_UIT_MEMPOOLVAR( vpool2, 2000 ), \\     
#  CYG_UIT_MEMPOOLVAR( vpool3, 2000 ),&rdquo;     
# value_source default     
# Default value: \     
#     &ldquo;CYG_UIT_MEMPOOLVAR( vpool1, 2000 ), \\     
#      CYG_UIT_MEMPOOLVAR( vpool2, 2000 ), \\     
#      CYG_UIT_MEMPOOLVAR( vpool3, 2000 ),&rdquo; 
}; 

</SCREEN>
<PARA>Setting a user value for this option involves uncommenting
and modifying all relevant lines, for example:</PARA>
<SCREEN>

cdl_option CYGDAT_UITRON_MEMPOOLVAR_INITIALIZERS {     
# Flavor: data     
user_value \     
&ldquo;CYG_UIT_MEMPOOLVAR( vpool1, 4000 ), \\      
CYG_UIT_MEMPOOLVAR( vpool2, 4000 ),&rdquo;     
# value_source default     
# Default value: \     
#     &ldquo;CYG_UIT_MEMPOOLVAR( vpool1, 2000 ), \\     
#      CYG_UIT_MEMPOOLVAR( vpool2, 2000 ), \\     
#      CYG_UIT_MEMPOOLVAR( vpool3, 2000 ),&rdquo; 
}; 

</SCREEN>
<PARA>In such cases appropriate care has to be taken to preserve
Tcl syntax, as discussed below.</PARA>
<PARA>The configuration system has the ability to keep track of
	  several different values for any given option. All options
	  start off with a default value, in other words their value
	  source is set to <literal>default</literal>. If a
	  configuration involves conflicts and the configuration
	  system&rsquo;s inference engine is allowed to resolve these
	  automatically then it may provide an
	  <literal>inferred</literal> value instead, for
	  example:</PARA>
<SCREEN>

cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT {     
# Flavor: bool     
# No user value, uncomment the following line to provide one.     
# user_value 1     
# The inferred value should not be edited directly.     
inferred_value 0     
# value_source inferred     
# Default value: 1     
... 
}; 

</SCREEN>
<PARA>Inferred values are calculated by the configuration system
and should not be edited by the user. If the inferred value is not
correct then a user value should be substituted instead:</PARA>
<SCREEN>

cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT {     
# Flavor: bool     
user_value 1     
# The inferred value should not be edited directly.     
inferred_value 0     
# value_source inferred     
# Default value: 1     
... 
}; </SCREEN>
<PARA>The inference engine will not override a user value with an
inferred one. Making a change like this may well re-introduce a
conflict, since the inferred value was only calculated to resolve
a conflict. Another run of the inference engine may find a different
and more acceptable way of resolving the conflict, but this is not guaranteed
and it may be up to the user to examine the various dependencies
and work out an acceptable solution.</PARA>
<PARA>Inferred values are listed in the savefile because the exact
inferred value may depend on the order in which changes were made
and conflicts were resolved. If the inferred values were absent
then it is possible that reloading a savefile would not exactly
restore the configuration. Default values on the other hand are
entirely deterministic so there is no actual need for the values
to be listed in the savefile. However, the default value can be
very useful information so it is provided in a comment.</PARA>
<PARA>Occasionally the user will want to do some experimentation,
and temporarily switch an option from a user value back to a default
or inferred one to see what the effect would be. This could be achieved
by simply commenting out the user value. For instance, if the current
savefile contains:</PARA>
<SCREEN> 
cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT {     
# Flavor: bool     
user_value 1     
# The inferred value should not be edited directly.     
inferred_value 0     
# value_source user     
# Default value: 1     
... 
}; 

</SCREEN>
<PARA>then the inferred value could be restored by commenting out
or removing the <literal>user_value</literal> line:</PARA>
<SCREEN> 
cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT {     
# Flavor: bool     
# user_value 1     
# The inferred value should not be edited directly.     
inferred_value 0     
# value_source user     
# Default value: 1     
... 
}; 

</SCREEN>
<PARA>This is fine for simple values. However if the value is complicated
then there is a problem: commenting out the <LITERAL>user_value</LITERAL> line
or lines means that the user value becomes invisible to the configuration system,
so if the savefile is loaded and then regenerated the information
will be lost. An alternative approach is to keep the <LITERAL>user_value</LITERAL> but
explicitly set the <LITERAL>value_source</LITERAL> line,
for example:</PARA>
<SCREEN>

cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT {     
# Flavor: bool     
user_value 1     
# The inferred value should not be edited directly.     
inferred_value 0     
value_source inferred     
# Default value: 1     
... 
}; 

</SCREEN>
<PARA>In this case the configuration system will use the inferred
value for the purposes of dependency analysis etc., even though
a user value is present. To restore the user value the <LITERAL>value_source</LITERAL> line
can be commented out again. If there is no explicit <LITERAL>value_source</LITERAL> then
the configuration system will just use the highest priority one:
the user value if it exists; otherwise the inferred value if it
exists; otherwise the default value which always exists.</PARA>
<PARA>The default value for an option can be a simple constant,
or it can be an expression involving other options. In the latter
case the expression will be listed, together with the values for
all options referenced in the expression and the current result
of evaluating that expression. This is for informational purposes
only, the default value is always recalculated deterministically
when loading in a savefile.</PARA>
<SCREEN>

cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {     
# Flavor: data     
# No user value, uncomment the following line to provide one.     
# user_value arm-elf     
# value_source default     
# Default value:  CYGHWR_THUMB ? &ldquo;thumb-elf&rdquo; : &ldquo;arm-elf&rdquo;     
#     CYGHWR_THUMB == 0     
#   --&gt; arm-elf 
}; 

</SCREEN>
<PARA>For options with the data or booldata flavor, there are likely
to be constraints on the possible values. If the value is supposed
to be a number in a given range and a user value of &ldquo;<LITERAL>hello
world</LITERAL>&rdquo; is provided instead then there
are likely to be compile-time failures. Component developers can
specify constraints on the legal values, and these will be listed
in the savefile.</PARA>
<SCREEN> 
cdl_option X_TLOSS {     
# Flavor: data     
# No user value, uncomment the following line to provide one.     
# user_value 1.41484755040569E+16     
# value_source default     
# Default value: 1.41484755040569E+16     
# Legal values: 1 to 1e308 
};

</SCREEN>
<SCREEN>cdl_component CYGNUM_LIBM_COMPATIBILITY {     
# Flavor: booldata     
# No user value, uncomment the following line to provide one.     
# user_value 1 POSIX     
# value_source default     
# Default value: 1 POSIX     
# Legal values:  &ldquo;POSIX&rdquo; &ldquo;IEEE&rdquo; &ldquo;XOPEN&rdquo; &ldquo;SVID&rdquo;     
... 
};

</SCREEN>
<PARA>In some cases the legal values list may be an expression involving
other options. If so then the current values of the referenced options
will be listed, together with the result of evaluating the list
expression, just as for default value expressions.</PARA>
<PARA>If an illegal value is provided then this will result in a
conflict, listed in the conflicts section of the savefile. For more
complicated options a simple legal values list is not sufficient
to allow the current value to be validated, and the configuration
system will be unable to flag conflicts. This issue will be addressed in
future releases of the configuration system.</PARA>
<PARA>Following the value-related fields for a given option, any <EMPHASIS>requires</EMPHASIS> constraints belonging
to this option will be listed. These constraints are only effective
if the option is active and, for bool and booldata flavors, enabled.
If some aspect of <productname>eCos</productname> functionality is inactive or disabled then
it cannot impose any constraints on the rest of the system. As usual,
the full expression will be listed followed by the current values
of all options that are referenced and the result of evaluating
the expression:</PARA>
<SCREEN>

cdl_option CYGSEM_LIBC_TIME_TIME_WORKING {     
...     
# Requires: CYGPKG_DEVICES_WALLCLOCK     
#     CYGPKG_DEVICES_WALLCLOCK == current     
#   --&gt; 1 
};

</SCREEN>
<PARA>When modifying the value of an option it is useful to know
not only what constraints the option imposes on the rest of the
system but also what other options in the system depend in some
way on this one. The savefile provides this information:</PARA>
<SCREEN>cdl_option CYGFUN_KERNEL_THREADS_TIMER {     
...     
# The following properties are affected by this value     
# option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT     
#     Requires: CYGFUN_KERNEL_THREADS_TIMER     
# option CYGIMP_UITRON_STRICT_CONFORMANCE     
#     Requires: CYGFUN_KERNEL_THREADS_TIMER     
# option CYGSEM_LIBC_TIME_CLOCK_WORKING     
#     Requires: CYGFUN_KERNEL_THREADS_TIMER 
}; 

</SCREEN>
</SECT2>
<SECT2>
<TITLE>Tcl Syntax</TITLE>
<PARA><productname>eCos</productname> savefiles are implemented as Tcl scripts, and are read
in by running the data through a standard Tcl interpreter that has
been extended with a small number of additional commands such as <LITERAL>cdl_option</LITERAL> and <LITERAL>cdl_configuration</LITERAL>.
In many cases this is an implementation detail that can be safely
ignored while editing a savefile: simply replacing a <LITERAL>1</LITERAL> with
a <LITERAL>0</LITERAL> to disable some functionality
is not going to affect whether or not the savefile is still a valid
Tcl script and can be processed by a Tcl interpreter. However, there
are more complicated cases where an understanding of Tcl syntax
is at least desirable, for example:</PARA>
<SCREEN>

cdl_option CYGDAT_UITRON_MEMPOOLVAR_EXTERNS {
     # Flavor: data
     user_value \
      &ldquo;static char vpool1\[ 2000 \], \\
      vpool2\[ 2000 \], \\
       vpool3\[ 2000 \];&rdquo;     
# value_source default     
# Default value: \
     #     &ldquo;static char vpool1\[ 2000 \], \\
     #      vpool2\[ 2000 \], \\
    #      vpool3\[ 2000 \];&rdquo; 
};

</SCREEN>
<PARA>The backslash at the end of the <LITERAL>user_value</LITERAL> line
is processed by the Tcl interpreter as a line continuation character.
The quote marks around the user data are also interpreted by the
Tcl interpreter and serve to turn the entire data field into a single
argument. The backslashes preceding the opening and closing square
brackets prevent the Tcl interpreter from treating these characters
specially, otherwise there would be an attempt at <EMPHASIS>command
substitution</EMPHASIS> as described below. The double backslashes
at the end of each line of the data will be turned into a single
backslash by the Tcl interpreter, rather than escaping the newline
character, so that the actual data seen by the configuration system
is:</PARA>
<SCREEN>

static char vpool1[ 2000 ], \
      vpool2[ 2000 ], \
      vpool3[ 2000 ];

</SCREEN>
<PARA>This is of course the data that should end up in the &micro;ITRON
configuration header file. The opening and closing braces surrounding
the entire body of the option data are also significant and cause
this body to be passed as a single argument to the <command>cdl_option</command> command.
The closing semicolon is optional in this example, but provides
a small amount of additional robustness if the savefile is edited
such that it is no longer a valid Tcl script. If the data contained
any <LITERAL>$</LITERAL> characters then
these would have to be treated specially as well, via a backslash escape.</PARA>
<PARA>In spite of what all the above might seem to suggest, Tcl
is actually a very simple yet powerful scripting language: the syntax
is defined by just eleven rules. On occasion this simplicity means
that Tcl&rsquo;s behaviour is subtly different from other languages,
which can confuse newcomers.</PARA>
<PARA>When the Tcl interpreter is passed some data such as <LITERAL>puts
Hello</LITERAL>, it splits this data into a command and its
arguments. The command will be terminated by a newline or by a semicolon,
unless one of the quoting mechanisms is used. The command and each
of its arguments are separated by white space. So in the following
example:</PARA>
<SCREEN>puts Hello 
set x 42 </SCREEN>
<PARA>will result in two separate commands being executed. The first
command is <LITERAL>puts</LITERAL> and is passed a
single argument, <LITERAL>Hello</LITERAL>. The second
command is <LITERAL>set</LITERAL> and is passed two
arguments, <LITERAL>x</LITERAL> and <LITERAL>42</LITERAL>.
The intervening newline character serves to terminate the first
command, and a semi-colon separator could be used instead: </PARA>
<programlisting>puts Hello;set x 42</programlisting>
<PARA>Any white space surrounding the semicolon is just ignored
because it does not serve to separate arguments.</PARA>
<PARA>Now consider the following:</PARA>
<SCREEN>set x Hello world</SCREEN>
<PARA>This is not valid Tcl. It is an attempt to invoke the <LITERAL>set</LITERAL> command
with three arguments: <LITERAL>x</LITERAL>, <LITERAL>Hello</LITERAL>,
and <LITERAL>world</LITERAL>. The <LITERAL>set</LITERAL> only
takes two arguments, a variable name and a value, so it is necessary
to combine the data into a single argument by quoting:</PARA>
<PROGRAMLISTING>set x &ldquo;Hello world&rdquo;</PROGRAMLISTING>
<PARA>When the Tcl interpreter encounters the first quote character
it treats all subsequent data up to but not including the closing
quote as part of the current argument. The quote marks are removed
by the interpreter, so the second argument passed to the <LITERAL>set</LITERAL> command
is just <LITERAL>Hello world</LITERAL> without the
quote characters. This can be significant in the context of <productname>eCos</productname> savefiles.
For instance, consider the following configuration option:</PARA>
<SCREEN>

cdl_option CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE {     
# Flavor: data     
# No user value, uncomment the following line to provide one.     
# user_value &ldquo;\&rdquo;/dev/ttydiag\&rdquo;&rdquo;     
# value_source default     
# Default value: &ldquo;\&rdquo;/dev/ttydiag\&rdquo;&rdquo; 
}; 

</SCREEN>
<PARA>The desired value of the configuration option should be a
valid C string, complete with quote characters. If the savefile
was edited to: </PARA>
<SCREEN>

cdl_option CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE {     
# Flavor: data     
user_value &ldquo;/dev/ttydiag&rdquo;     
# value_source default     
# Default value: &ldquo;\&rdquo;/dev/ttydiag\&rdquo;&rdquo; 
}; 

</SCREEN>
<PARA>then the Tcl interpreter would remove the quote marks when
the savefile is read back in, so the option&rsquo;s value would
not have any quote marks and would not be a valid C string. The
configuration system is not yet able to perform the required validation
so the following <LITERAL>#define</LITERAL> would
be generated in the configuration header file:</PARA>
<PROGRAMLISTING>#define CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE /dev/ttydiag </PROGRAMLISTING>
<PARA>This is likely to cause a compile-time failure when building
<productname>eCos</productname>.</PARA>
<PARA>A quoted argument continues until the closing quote character
is encountered, which means that it can span multiple lines. This
can also be encountered in <productname>eCos</productname> savefiles, for instance, in the <literal>CYGDAT_UITRON_MEMPOOLVAR_EXTERNS</literal> example
mentioned earlier. Newline or semicolon characters do not terminate
the current command in such cases.</PARA>
<PARA>The Tcl interpreter supports much the same forms of backslash
substitution as other common programming languages. Some backslash
sequences such as <literal>\n</literal> will
be replaced by the appropriate character. The sequence <literal>\\</literal> will
be replaced by a single backslash. A backslash at the very end of
a line will cause that backslash, the newline character, and any
white space at the start of the next line to be replaced by a single
space. Hence the following two Tcl commands are equivalent:</PARA>
<PROGRAMLISTING>puts  &ldquo;Hello\nworld\n&rdquo; 
puts \ 
&ldquo;Hello 
world 
&ldquo;</PROGRAMLISTING>
<PARA>In addition to quote and backslash characters, the Tcl interpreter
treats square brackets, the <literal>$</literal> character,
and braces specially. Square brackets are used for command substitution,
for example:</PARA>
<PROGRAMLISTING>puts &ldquo;The answer is [expr 6 * 9]&rdquo;</PROGRAMLISTING>
<PARA>When the Tcl interpreter encounters the square brackets it
will treat the contents as another command that should be executed
first, and the result of executing that is used when continuing
to process the script. In this case the Tcl interpreter will execute
the command <literal>expr 6 * 9</literal>,
yielding a result of 54, and then the Tcl interpreter will execute
<literal>puts &ldquo;The answer is 54&rdquo;</literal>. It should be noted that
the interpreter contains only one level of substitution: if the
result of performing command substitution performs further special
characters such as square brackets then these will not be treated
specially.</PARA>
<PARA>Command line substitution is very unlikely to prove useful
in the context of an <productname>eCos</productname> savefile, but it is part of the Tcl language
and hence cannot be easily suppressed while reading in a savefile.
As a result care has to be taken when savefile data involves square
brackets. Consider the following:</PARA>
<PROGRAMLISTING>

cdl_option CYGDAT_UITRON_MEMPOOLFIXED_EXTERNS {
     ...
     user_value \ 
&ldquo;static char fpool1[ 2000 ], 
fpool2[ 2000 ];&rdquo;
     ... 
};
</PROGRAMLISTING>
<PARA>The Tcl interpreter will interpret the square brackets as
an attempt at command substitution and hence it will attempt to
execute the command <literal>2000</literal> with no
arguments. No such command is defined by the Tcl language or by
the savefile-related extensions provided by the configuration system,
so this will result in an error when an attempt is made to read
back the savefile. Instead it is necessary to backslash-escape the
square brackets and thus suppress command substitution:</PARA>
<PROGRAMLISTING>

cdl_option CYGDAT_UITRON_MEMPOOLFIXED_EXTERNS {
     ...
     user_value \ 
&ldquo;static char fpool1\[ 2000 \], 
fpool2\[ 2000 \];&rdquo;
     ... 
}; </PROGRAMLISTING>
<PARA>Similarly the <literal>$</literal> character
is used in Tcl scripts to perform variable substitution:</PARA>
<PROGRAMLISTING>set x [expr 6 * 9] 
puts &ldquo;The answer is $x&rdquo; </PROGRAMLISTING>
<PARA>Variable substitution, like command substitution, is very
unlikely to prove useful in the context of an <productname>eCos</productname> savefile. Should
it be necessary to have a <literal>$</literal> character
in configuration data then again a backslash escape needs to be
used.</PARA>
<PROGRAMLISTING>cdl_option FOODAT_MONITOR_PROMPT {
     ...
     user_value &ldquo;\$ &ldquo;
     ... 
};</PROGRAMLISTING>
<PARA>Braces are used to collect a sequence of characters into a
single argument, just like quotes. The difference is that variable,
command and backslash substitution do not occur inside braces (with
the sole exception of backslash substitution at the end of a line).
So, for example, the <literal>CYGDAT_UITRON_MEMPOOL_EXTERNFIXED_EXTERNS</literal> value
could be written as:</PARA>
<PROGRAMLISTING>cdl_option CYGDAT_UITRON_MEMPOOLFIXED_EXTERNS {
     ...
     user_value \ 
{static char fpool1[ 2000 ], 
fpool2[ 2000 ];}
     ... 
};</PROGRAMLISTING>
<PARA>The configuration system does not use this when generating
savefiles because for simple edits of a savefile by inexperienced
users the use of brace characters is likely to be a little bit more
confusing than the use of quotes.</PARA>
<PARA>At this stage it is worth noting that the basic format of
each configuration option in the savefile makes use of braces:</PARA>
<PROGRAMLISTING>cdl_option &lt;name&gt; {
     ... 
};</PROGRAMLISTING>
<PARA>The configuration system extends the Tcl language with a small
number of additional commands such as <LITERAL>cdl_option</LITERAL>.
These commands take two arguments, a name and a body, where the
body consists of all the text between the braces. First a check
is made that the specified option is actually present in the configuration.
Then the body is executed in a recursive invocation of the Tcl interpreter,
this time with additional commands such as <LITERAL>user_value</LITERAL> and <LITERAL>value_source</LITERAL>.
If, after editing, the braces are not correctly matched up then
the savefile will no longer be a valid Tcl script and errors will
be reported when the savefile is loaded again.</PARA>
<PARA>Comments in Tcl scripts are introduced by a hash character <LITERAL>#</LITERAL>.
However, a hash character only introduces a comment if it occurs
where a command is expected. Consider the following:</PARA>
<PROGRAMLISTING># This is a comment 
puts &ldquo;Hello&rdquo; # world </PROGRAMLISTING>
<PARA>The first line is a valid comment, since the hash character
occurs right at the start where a command name is expected. The
second line does not contain a comment. Instead it is an attempt
to invoke the <LITERAL>puts</LITERAL> command with
three arguments: <LITERAL>Hello</LITERAL>, <LITERAL>#</LITERAL> and <LITERAL>world</LITERAL>.
These are not valid arguments for the <LITERAL>puts</LITERAL> command
so an error will be raised.</PARA>
<PARA>If the second line was rewritten as:</PARA>
<PROGRAMLISTING>puts &ldquo;Hello&rdquo;; # world</PROGRAMLISTING>
<PARA>then this is a valid Tcl script. The semicolon identifies
the end of the current command, so the hash character occurs at
a point where the next command would start and hence it is interpreted
as the start of a comment.</PARA>
<PARA>This handling of comments can lead to subtle behaviour. Consider
the following:</PARA>
<PROGRAMLISTING>cdl_option WHATEVER {
     # This is a comment }
     user_value 42
     ... 
}</PROGRAMLISTING>
<PARA>Consider the way the Tcl interpreter processes this. The command
name and the first argument do not pose any special difficulties.
The opening brace is interpreted as the start of the next argument,
which continues until a closing brace is encountered. In this case
the closing brace occurs on the second line, so the second argument
passed to <LITERAL>cdl_option</LITERAL> is <literal>\n # This is a comment</LITERAL> . This second argument
is processed in a recursive invocation of the Tcl interpreter and
does not contain any commands, just a comment. Toplevel savefile
processing then resumes, and the next command that is encountered
is <LITERAL>user_value</LITERAL>. Since the
relevant savefile code is not currently processing a configuration
option this is an error. Later on the Tcl interpreter would encounter
a closing brace by itself, which is also an error. Fortunately this
sequence of events is very unlikely to occur when editing generated
savefiles.</PARA>
<PARA>This should be sufficient information about Tcl to allow for
safe editing of <productname>eCos</productname> savefiles. Further information is available
from a wide variety of sources, for example the book <EMPHASIS>Tcl
and the Tk Toolkit </EMPHASIS>by John K Ousterhout.</PARA>
</SECT2>
</SECT1>
<SECT1 id="editing-the-sources">
<TITLE>Editing the Sources</TITLE>
<PARA>For many users, controlling the packages and
	  manipulating the available configuration options will be
	  sufficient to create an embedded operating system that meets
	  the application's requirements. However, since <productname>eCos</productname> is
	  shipped entirely in source form, it is possible to go
	  further when necessary: you can edit the <productname>eCos</productname> <!--
	  <index></index> -->sources themselves. This requires some
	  understanding of the way the <productname>eCos</productname> build system works.
	</PARA>
<PARA>The most obvious place to edit the source code is directly
in the <!-- <index></index> -->component repository. For example, you could
edit the file <filename>kernel/<replaceable>&Version;</replaceable>/src/sync/mutex.cxx</filename>
to change the way kernel mutexes work, or possibly just to add some
extra diagnostics or assertions. Once the file has been edited,
it is possible to invoke <command>make</command> at
the top level of the build tree and the target library will be rebuilt
as required. A small optimization is possible: the build tree is
largely a mirror of the component repository, so it too will contain
a subdirectory <filename>kernel/<replaceable>&Version;</replaceable></filename>;
if make is invoked in this directory
then it will only check for changes to the kernel sources, which
is a bit more efficient than checking for changes throughout the component
repository. </PARA>
<PARA>Editing a file in the component repository is fine if this
tree is used for only one <productname>eCos</productname> configuration. If the repository
is used for several different configurations, however, and especially
if it is shared by multiple users, then making what may be experimental
changes to the master sources would be a bad idea. The build system provides
an alternative. It is possible to make a copy of the file in the
build tree, in other words copy <filename>mutex.cxx</filename> from
the <filename>kernel/<replaceable>&Version;</replaceable>/src/sync</filename> directory
in the component repository to <filename>kernel/<replaceable>&Version;</replaceable>/src/sync</filename> in
the build tree, and edit the file in the build tree. When <command>make</command> is
invoked it will pick up local copies of any of the sources in preference
to the master versions in the component repository. Once you have
finished modifying the <productname>eCos</productname> sources you can install the final version
back in the component repository. If the changes were temporary
in nature and only served to aid the debugging process, then you
can discard the modified version of the sources. </PARA>
<PARA>The situation is slightly more complicated for the header
files that a package may export, such as the C library&rsquo;s <filename>stdio.h</filename> header
file, which can be found in the directory <filename>language/c/libc/<replaceable>&Version;</replaceable>/include</filename>.
If such a header file is changed, either directly in the component
repository or after copying it to the build tree, then <command>make</command> must
be invoked at the top level of the build tree. In cases like this
it is not safe to rebuild just the C library because other packages
may depend on the contents of <filename>stdio.h</filename>. </PARA>
</SECT1>
<SECT1 id="modifying-the-memory-layout">
<TITLE>Modifying the Memory Layout</TITLE>
<PARA>Each <productname>eCos</productname> platform package is supplied with linker script
fragments which describe the location of memory regions on the evaluation
board and the location of memory sections within these regions.
The correct linker script fragment is selected and included in the
<productname>eCos</productname> linker script <!-- <index></index> --><filename>target.ld</filename> when
<productname>eCos</productname> is built.</PARA>
<PARA>It is not necessary to <!-- <index></index> -->modify the default memory
layouts in order to start development with <productname>eCos</productname>. However, it will
be necessary to edit a linker script fragment when the memory map
of the evaluation board is changed. For example, if additional memory
is added, the linker must be notified that the new memory is available
for use. As a minimum, this would involve modifying the length of
the corresponding memory region. Where the available memory is non-contiguous,
it may be necessary to declare a new memory region and reassign
certain linker output sections to the new region.</PARA>
<PARA>Linker script fragments and memory layout header files should
be <!-- <index></index> -->edited within the <productname>eCos</productname> install tree. They are
located at <filename>include/pkgconf/mlt_*.*</filename>.
Where multiple start-up types are in use, it will be necessary to
edit multiple linker script fragments and header files. The information
provided in the header file and the corresponding linker script
fragment must always match. A typical linker script fragment is
shown below:</PARA>
<EXAMPLE><!-- <index></index> -->
<TITLE><productname>eCos</productname> linker script fragment</TITLE>
<PROGRAMLISTING>MEMORY
{
 rom : ORIGIN = 0x40000000, LENGTH = 0x80000
 ram : ORIGIN = 0x48000000, LENGTH = 0x200000
}

SECTIONS
{
 SECTIONS_BEGIN
 SECTION_rom_vectors (rom, 0x40000000, LMA_EQ_VMA)
 SECTION_text (rom, ALIGN (0x1), LMA_EQ_VMA)
 SECTION_fini (rom, ALIGN (0x1), LMA_EQ_VMA)
 SECTION_rodata (rom, ALIGN (0x1), LMA_EQ_VMA)
 SECTION_rodata1 (rom, ALIGN (0x1), LMA_EQ_VMA)
 SECTION_fixup (rom, ALIGN (0x1), LMA_EQ_VMA)
 SECTION_gcc_except_table (rom, ALIGN (0x1), LMA_EQ_VMA)
 SECTION_data (ram, 0x48000000, FOLLOWING (.gcc_except_table))
 SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
 SECTIONS_END
}</PROGRAMLISTING>
</EXAMPLE>
<PARA>The file consists of two blocks, the <literal>MEMORY</literal> block
contains lines describing the address (<literal>ORIGIN</literal>)
and the size (<literal>LENGTH</literal>) of each memory
region. The <literal>MEMORY</literal> block is followed
by the <literal>SECTIONS</literal> block which contains
lines describing each of the linker output sections. Each section
is represented by a macro call. The arguments of these macros are
ordered as follows: </PARA>
<ORDEREDLIST>
<LISTITEM>
<PARA>The memory region in which the section will finally
	      reside.</PARA>
</LISTITEM>
<LISTITEM>
<PARA>The final address (
<LITERAL>VMA</LITERAL>
) of the section. This is expressed using one of the following forms:</PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM><EMPHASIS>n</EMPHASIS></TERM>
<LISTITEM>
<PARA>at the absolute address specified by the
		    unsigned integer <EMPHASIS>n</EMPHASIS></PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM>ALIGN (<EMPHASIS>n</EMPHASIS>)</TERM>
<LISTITEM>
<PARA>following the final location of the previous section
		    with alignment to the next <EMPHASIS>n</EMPHASIS>-byte
		    boundary</PARA>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</LISTITEM>
<LISTITEM>
<PARA>The initial address (<LITERAL>LMA</LITERAL>)
	      of the section. This is expressed using one of the
	      following forms:</PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>LMA_EQ_VMA</TERM>
<LISTITEM>
<PARA>the <LITERAL>LMA</LITERAL>
		    equals the <LITERAL>VMA</LITERAL> (no relocation)</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM>AT (<EMPHASIS>n</EMPHASIS>)</TERM>
<LISTITEM>
<PARA>at the absolute address specified by the
		    unsigned integer <EMPHASIS>n</EMPHASIS></PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM>FOLLOWING (.<EMPHASIS>name</EMPHASIS>)</TERM>
<LISTITEM>
<PARA>following the initial location of section
		    <EMPHASIS>name</EMPHASIS></PARA>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</LISTITEM>
</ORDEREDLIST>
<PARA>In order to maintain compatibility with linker script
	  fragments and header files exported by the
	  <productname>eCos</productname> <APPLICATION>Configuration Tool</APPLICATION>, the use
	  of other expressions within these files is not
	  recommended.</PARA>
<PARA>Note that the names of the linker output sections will vary
between target architectures. A description of these sections can
be found in the specific <productname>GCC</productname> documentation for
your architecture.</PARA>
</SECT1>
</CHAPTER>
<CHAPTER id="managing-package-repository">
<TITLE>Managing the <!-- <index></index> -->Package Repository</TITLE>
<PARA>A source distribution of <productname>eCos</productname> consists of a number of
	packages, such as the kernel, the C library, and the
	&micro;ITRON subsystems. These are
	individually versioned in the tree structure of the source
	code, to support distribution on a per-package basis and to
	support third party packages whose versioning systems might be
	different. The <productname>eCos</productname> <application>Package
	  Administration Tool</application> is used to manage the
	installation and removal of packages from a variety of sources
	with potentially multiple versions.</PARA>
<PARA>The presence of the version information in the source tree
	structure might be a hindrance to the use of a separate source
	control system such as <EMPHASIS>CVS</EMPHASIS> or
	<EMPHASIS>SourceSafe</EMPHASIS>. To work
	in this way, you can rename all the version components to some
	common name (such as &ldquo;current&rdquo;) thus unifying the
	structure of source trees from distinct <productname>eCos</productname> releases.</PARA>
<PARA>The <productname>eCos</productname> build system will treat any such name as just another
version of the package(s), and support building in exactly the same
way. However, performing this rename invalidates any existing build
trees that referred to the versioned source tree, so do the rename
first, before any other work, and do a complete rebuild afterwards.</PARA>
<SECT1 id="package-installation">
<TITLE>Package Installation</TITLE>
<PARA>Package installation and removal is performed using the
	  <productname>eCos</productname> <application>Package Administration Tool</application>. This
	  tool is a Tcl script named
	<command>ecosadmin.tcl</command> which allows
	  the user to add new <productname>eCos</productname> packages and new versions of
	  existing packages to an <productname>eCos</productname> repository. Such packages must
	  be distributed as a single file in the <productname>eCos</productname> package
	  distribution format. Unwanted packages may also be removed
	  from the repository using this tool. A graphical version of
	  the tool is provided as part of the
	  <productname>eCos</productname> <application>Configuration Tool</application>.</PARA>
<SECT2>
<TITLE>Using the Administration Tool</TITLE> <PARA>The graphical
version of the <productname>eCos</productname> <application>Package
Administration Tool</application>, provided as part of the
<productname>eCos</productname> <application>Configuration
Tool</application>, provides functions equivalent to the command-line
version for those who prefer a Windows-based interface.</PARA>
<PARA>It may be invoked in one of two ways:</PARA>
<ITEMIZEDLIST>
<LISTITEM>
<PARA>from the <GUIMENU>start menu</GUIMENU> (by default
		<GUIMENUITEM>Start-&gt;Programs-&gt;
		  eCos-&gt;Package Administration
		  Tool</GUIMENUITEM>)</PARA>
<!--
<para>
XXXXX What is the Windows menu structure now? XXXXX
</para>
-->
            
</LISTITEM>
<LISTITEM>
<PARA>from the <productname>eCos</productname> <APPLICATION>Configuration
		  Tool</APPLICATION> via the
		<GUIMENUITEM>Tools-&gt;Administration</GUIMENUITEM>
		menu item</PARA>
</LISTITEM>
</ITEMIZEDLIST>
<PARA><GRAPHIC ENTITYREF="graphic31"></GRAPHIC></PARA>
<PARA>The main window of the tool displays the packages which are
currently installed in the form of a tree. The installed versions
of each package may be examined by expanding the tree.</PARA>
<PARA>Packages may be added to the <productname>eCos</productname> repository by clicking on
the <EMPHASIS>Add</EMPHASIS> button. The <productname>eCos</productname> package distribution
file to be added is then selected via a <EMPHASIS>File Open</EMPHASIS> dialog
box.</PARA>
<PARA>Packages may be removed by selecting a package in the tree
and then clicking on the <EMPHASIS>Remove</EMPHASIS> button. If
a package node is selected, all versions of the selected package
will be removed. If a package version node is selected, only the
selected version of the package will be removed.</PARA>
</SECT2>
<SECT2>
<TITLE>Using the command line</TITLE>
<PARA>The <command>ecosadmin.tcl</command>
	    script is located in the base of the <productname>eCos</productname> repository. Use
	    a command of the following form under versions of
	    UNIX:</PARA>
<SCREEN>$ tclsh ecosadmin.tcl &lt;command&gt;</SCREEN>
<PARA>Under Windows, a command of the following form may be used
at the Cygwin command line prompt:</PARA>
<SCREEN>$ cygtclsh80 ecosadmin.tcl &lt;command&gt;</SCREEN>
<PARA>The following commands are available:</PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM><COMMAND>add &lt;file&gt;</COMMAND></TERM>
<LISTITEM><!-- <index></index> -->
<PARA>Adds the packages contained with the specified package distribution
file to the <productname>eCos</productname> repository and updates the package database accordingly.
By convention, <productname>eCos</productname> package distribution files are given the <filename>.epk</filename> suffix.</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM><COMMAND>remove &lt;package&gt; [ --version=&lt;version&gt; ]</COMMAND></TERM><!-- <index></index> -->
<LISTITEM>
<PARA>Removes the specified package from the <productname>eCos</productname>
		  repository and updates the package database
		  accordingly. Where the optional version qualifier is
		  used, only the specified version of the package is
		  removed.</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM><COMMAND>list</COMMAND></TERM><!-- <index></index> -->
<LISTITEM>
<PARA>Produces a list of the packages which
		  are currently installed and their versions. The
		  available templates and hardware targets are also
		  listed.</PARA>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
<PARA>Note that is is possible to remove critical packages
	    such as the common HAL package using this tool. Users
	    should take care to avoid such errors since core <productname>eCos</productname>
	    packages may only be re-installed in the context of a
	    complete re-installation of <productname>eCos</productname>.</PARA>
</SECT2>
</SECT1>
<SECT1 id="package-structure">
<TITLE>Package Structure</TITLE>
<PARA>The files in an installed <productname>eCos</productname> source tree are organized in
a natural tree structure, grouping together files which work together
into <EMPHASIS>Packages</EMPHASIS>. For example, the kernel files
are all together in: </PARA>
<SIMPLELIST>
<MEMBER><FILENAME><REPLACEABLE>BASE_DIR</REPLACEABLE>/kernel/<replaceable>&Version;</replaceable>/include/</FILENAME></MEMBER>
<MEMBER>	    <FILENAME><REPLACEABLE>BASE_DIR</REPLACEABLE>/kernel/<replaceable>&Version;</replaceable>/src/</FILENAME></MEMBER>
<MEMBER>	<FILENAME><REPLACEABLE>BASE_DIR</REPLACEABLE>/kernel/<replaceable>&Version;</replaceable>/tests/</FILENAME></MEMBER>
</SIMPLELIST>
<PARA>and &micro;ITRON compatibility layer files are in:
	</PARA>
<SIMPLELIST>
<MEMBER>	    <FILENAME><REPLACEABLE>BASE_DIR</REPLACEABLE>/compat/uitron/<replaceable>&Version;</replaceable>/include/</FILENAME></MEMBER>
<MEMBER>	<FILENAME><REPLACEABLE>BASE_DIR</REPLACEABLE>/compat/uitron/<replaceable>&Version;</replaceable>/src/</FILENAME></MEMBER>
<MEMBER>	<FILENAME><REPLACEABLE>BASE_DIR</REPLACEABLE>/compat/uitron/<replaceable>&Version;</replaceable>/tests/</FILENAME></MEMBER>
</SIMPLELIST>
<PARA>The feature of these names which is of interest here is
	  the <replaceable>&Version;</replaceable> near the end. It may seem odd to place a version number deep in the
	  path, rather than having something like
	  <FILENAME><REPLACEABLE>BASE_DIR</REPLACEABLE>/<replaceable>&Version;</replaceable>/...everything...</FILENAME>
          or leaving it up to you to choose a different
	  install-place when a new release of the system arrives.
	</PARA>
<PARA>There is a rationale for this organization: as
	  indicated, the kernel and the
	  &micro;ITRON compatibility subsystem
	  are examples of software packages. For the first few
	  releases of <productname>eCos</productname>, all the packages will move along
	  in step, i.e. Release 1.3.x will feature Version
	  1.3.x of every package, and so forth. But in future,
	  especially when third party packages become available, it is
	  intended that the package be the unit of software
	  distribution, so it will be possible to build a system from
	  a selection of packages with different version numbers, and
	  even differing versioning <EMPHASIS>schemes</EMPHASIS>. A
	  Tcl script <command>ecosadmin.tcl</command> is
	  provided in the <productname>eCos</productname> repository to manage the installation
	  and removal of packages in this way.</PARA>
<PARA>Many users will have their own source code control system,
version control system or equivalent, and will want to use it with
<productname>eCos</productname> sources. In that case, since a new release of <productname>eCos</productname> comes with
different pathnames for all the source files, a bit of work is necessary
to import a new release into your source repository. </PARA>
<PARA>One way of handling the import is to rename all the version
parts to some common name, for example &ldquo;current&rdquo;,
and continue to work. &ldquo;current&rdquo; is suggested because <command>ecosconfig</command> recognizes
it and places it first in any list of versions. In the future, we
may provide a tool to help with this, or an option in the install
wizard. Alternatively, in a POSIX shell environment (Linux or Cygwin
on Windows) use the following command: </PARA>
<SCREEN>find . -name <replaceable>&Version;</replaceable> -type d -printf 'mv &percnt;p &percnt;h/current\n' | sh</SCREEN>
<PARA>Having carried out such a renaming operation, your
	  source tree will now look like this: </PARA>
<SCREEN><REPLACEABLE>BASE_DIR</REPLACEABLE>/kernel/current/include/
<REPLACEABLE>BASE_DIR</REPLACEABLE>/kernel/current/src/
<REPLACEABLE>BASE_DIR</REPLACEABLE>/kernel/current/tests/
	...
<REPLACEABLE>BASE_DIR</REPLACEABLE>/compat/uitron/current/include/
<REPLACEABLE>BASE_DIR</REPLACEABLE>/compat/uitron/current/src/
<REPLACEABLE>BASE_DIR</REPLACEABLE>/compat/uitron/current/tests/
	</SCREEN>
<PARA>which is a suitable format for import into your own
	  source code control system. When you get a subsequent
	  release of <productname>eCos</productname>, do the same thing and use your own source
	  code control system to manage the new source base, by
	  importing the new version from </PARA>
<SCREEN><REPLACEABLE>NEW_BASE_DIR</REPLACEABLE>/kernel/current/include/</SCREEN>
<PARA>and so on. </PARA>
<PARA>The <productname>eCos</productname> build tool will now offer only the
	  &ldquo;current&rdquo; version of each package; select this
	  for the packages you wish to use. </PARA>
<PARA>Making such a change has implications for any build
	  trees you already have in use. A configured build tree
	  contains information about the selected packages and their
	  selected versions. Changing the name of the
	  &ldquo;versioning&rdquo; folder in the source tree
	  invalidates this information, and in consequence it also
	  invalidates any local configuration options you have set up
	  in this build tree. So if you want to change the version
	  information in the source tree, do it first, before
	  investing any serious time in configuring and building your
	  system. When you create a new build tree to deal with the
	  new source layout, it will contain default settings for all
	  the configuration options, just like the old build tree did
	  before you configured it. You will need to redo that
	  configuration work in the new tree. </PARA>
<PARA>Moving source code around also invalidates debugging information
in any programs or libraries built from the old tree; these will
need to be rebuilt. </PARA>
</SECT1>
</CHAPTER>
</PART>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:nil
sgml-shorttag:t
sgml-namecase-general:t
sgml-general-insert-case:lower
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:2
sgml-indent-data:t
sgml-parent-document:("user-guide.sgml" "book" "part")
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->