]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - doc/html/cdl-guide/language.database.html
RedBoot TX53 Release 2012-02-15
[karo-tx-redboot.git] / doc / html / cdl-guide / language.database.html
1 <!-- Copyright (C) 2003 Red Hat, Inc.                                -->
2 <!-- This material may be distributed only subject to the terms      -->
3 <!-- and conditions set forth in the Open Publication License, v1.0  -->
4 <!-- or later (the latest version is presently available at          -->
5 <!-- http://www.opencontent.org/openpub/).                           -->
6 <!-- Distribution of the work or derivative of the work in any       -->
7 <!-- standard (paper) book form is prohibited unless prior           -->
8 <!-- permission is obtained from the copyright holder.               -->
9 <HTML
10 ><HEAD
11 ><TITLE
12 >Updating the ecos.db database</TITLE
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
14 <META
15 NAME="GENERATOR"
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
17 "><LINK
18 REL="HOME"
19 TITLE="The eCos Component Writer's Guide"
20 HREF="cdl-guide.html"><LINK
21 REL="UP"
22 TITLE="The CDL Language"
23 HREF="language.html"><LINK
24 REL="PREVIOUS"
25 TITLE="Interfaces"
26 HREF="language.interface.html"><LINK
27 REL="NEXT"
28 TITLE="The Build Process"
29 HREF="build.html"></HEAD
30 ><BODY
31 CLASS="SECT1"
32 BGCOLOR="#FFFFFF"
33 TEXT="#000000"
34 LINK="#0000FF"
35 VLINK="#840084"
36 ALINK="#0000FF"
37 ><DIV
38 CLASS="NAVHEADER"
39 ><TABLE
40 SUMMARY="Header navigation table"
41 WIDTH="100%"
42 BORDER="0"
43 CELLPADDING="0"
44 CELLSPACING="0"
45 ><TR
46 ><TH
47 COLSPAN="3"
48 ALIGN="center"
49 >The <SPAN
50 CLASS="APPLICATION"
51 >eCos</SPAN
52 > Component Writer's Guide</TH
53 ></TR
54 ><TR
55 ><TD
56 WIDTH="10%"
57 ALIGN="left"
58 VALIGN="bottom"
59 ><A
60 HREF="language.interface.html"
61 ACCESSKEY="P"
62 >Prev</A
63 ></TD
64 ><TD
65 WIDTH="80%"
66 ALIGN="center"
67 VALIGN="bottom"
68 >Chapter 3. The CDL Language</TD
69 ><TD
70 WIDTH="10%"
71 ALIGN="right"
72 VALIGN="bottom"
73 ><A
74 HREF="build.html"
75 ACCESSKEY="N"
76 >Next</A
77 ></TD
78 ></TR
79 ></TABLE
80 ><HR
81 ALIGN="LEFT"
82 WIDTH="100%"></DIV
83 ><DIV
84 CLASS="SECT1"
85 ><H1
86 CLASS="SECT1"
87 ><A
88 NAME="LANGUAGE.DATABASE">Updating the <SPAN
89 CLASS="DATABASE"
90 >ecos.db</SPAN
91 > database</H1
92 ><P
93 >The current implementation of the component framework requires that
94 all packages be present in a single component repository and listed in
95 that repository's <SPAN
96 CLASS="DATABASE"
97 >ecos.db</SPAN
98 > database. This is not
99 generally a problem for application developers who can consider the
100 component repository a read-only resource, except when adding or
101 removing packages via the administration tool. However it means that
102 component writers need to do their development work inside a
103 component repository as well, and update the database with details of
104 their new package or packages. Future enhancements to the component
105 framework may allow new components to be developed outside a
106 repository. </P
107 ><P
108 >Like most files related to the component framework, the
109 <SPAN
110 CLASS="DATABASE"
111 >ecos.db</SPAN
112 > database is actually a <SPAN
113 CLASS="APPLICATION"
114 >Tcl</SPAN
115 > script.
116 Typical package entries would look like this:</P
117 ><TABLE
118 BORDER="5"
119 BGCOLOR="#E0E0F0"
120 WIDTH="70%"
121 ><TR
122 ><TD
123 ><PRE
124 CLASS="PROGRAMLISTING"
125 >package CYGPKG_LIBC {
126         alias           { "C library" libc clib clibrary }
127         directory       language/c/libc
128         script          libc.cdl
129         description  "
130 This package enables compatibility with the ISO C standard - ISO/IEC
131 9899:1990. This allows the user application to use well known standard
132 C library functions, and in eCos starts a thread to invoke the user
133 function main()"
134 }
135
136 package CYGPKG_IO_PCI   {
137         alias           { "PCI configuration library" io_pci }
138         directory       io/pci
139         script          io_pci.cdl
140         hardware
141         description "
142            This package contains the PCI configuration library."
143 }</PRE
144 ></TD
145 ></TR
146 ></TABLE
147 ><P
148 >The <TT
149 CLASS="LITERAL"
150 >package</TT
151 > command takes two arguments, a name and
152 a body. The name must be the same as in the <TT
153 CLASS="LITERAL"
154 >cdl_package</TT
155 > command in
156 the package's top-level <SPAN
157 CLASS="APPLICATION"
158 >CDL</SPAN
159 > script. The body can contain the
160 following five commands: <TT
161 CLASS="LITERAL"
162 >alias</TT
163 >,
164 <TT
165 CLASS="LITERAL"
166 >directory</TT
167 >, <TT
168 CLASS="LITERAL"
169 >script</TT
170 >,
171 <TT
172 CLASS="LITERAL"
173 >hardware</TT
174 > and <TT
175 CLASS="LITERAL"
176 >description</TT
177 >.</P
178 ><P
179 ></P
180 ><DIV
181 CLASS="VARIABLELIST"
182 ><DL
183 ><DT
184 ><TT
185 CLASS="LITERAL"
186 >alias</TT
187 ></DT
188 ><DD
189 ><P
190 >Each package should have one or more aliases. The first alias is
191 typically used when listing the known packages, because a string like
192 <TT
193 CLASS="LITERAL"
194 >C&nbsp;library</TT
195 > is a bit easier to read and
196 understand than <TT
197 CLASS="VARNAME"
198 >CYGPKG_LIBC</TT
199 >. The other aliases are
200 not used for output, but are accepted on input. For example the
201 <SPAN
202 CLASS="APPLICATION"
203 >ecosconfig</SPAN
204 > command-line
205 tool will accept <TT
206 CLASS="LITERAL"
207 >add&nbsp;libc</TT
208 > as an option, as well
209 as <TT
210 CLASS="LITERAL"
211 >add&nbsp;CYGPKG_LIBC</TT
212 >.</P
213 ></DD
214 ><DT
215 ><TT
216 CLASS="LITERAL"
217 >directory</TT
218 ></DT
219 ><DD
220 ><P
221 >This is used to specify the location of the package relative to the
222 root of the component repository. It should be noted that in the
223 current component framework this location cannot be changed in
224 subsequent releases of the package: if for some reason it is desirable
225 to install a new release elsewhere in the repository, all the old
226 versions must first be uninstalled; the database cannot hold two
227 separate locations for one package.</P
228 ></DD
229 ><DT
230 ><TT
231 CLASS="LITERAL"
232 >script</TT
233 ></DT
234 ><DD
235 ><P
236 >The <TT
237 CLASS="LITERAL"
238 >script</TT
239 > command specifies the location of the
240 package's top-level <SPAN
241 CLASS="APPLICATION"
242 >CDL</SPAN
243 > script, in other words the one containing the
244 <TT
245 CLASS="LITERAL"
246 >cdl_package</TT
247 > definition. If the package follows the <A
248 HREF="package.html#PACKAGE.HIERARCHY"
249 >directory layout conventions</A
250 > then
251 this script will be in the <TT
252 CLASS="FILENAME"
253 >cdl</TT
254 >
255 sub-directory, otherwise it will be relative to the package's top-level
256 directory. Again once a release has been made this file should not
257 change in later releases. In practice the top-level script is generally
258 named after the package itself, so changing its name is unlikely to be
259 useful. </P
260 ></DD
261 ><DT
262 ><TT
263 CLASS="LITERAL"
264 >hardware</TT
265 ></DT
266 ><DD
267 ><P
268 >Packages which are tied to specific hardware, for example device
269 drivers and HAL packages, should indicate this in both the
270 <TT
271 CLASS="LITERAL"
272 >cdl_package</TT
273 > command of the <SPAN
274 CLASS="APPLICATION"
275 >CDL</SPAN
276 > script and in the database entry.</P
277 ></DD
278 ><DT
279 ><TT
280 CLASS="LITERAL"
281 >description</TT
282 ></DT
283 ><DD
284 ><P
285 >This should give a brief description of the package. Typically the
286 text for the <SPAN
287 CLASS="PROPERTY"
288 >description</SPAN
289 > property in the <TT
290 CLASS="LITERAL"
291 >cdl_package</TT
292 > command will
293 be re-used.</P
294 ></DD
295 ></DL
296 ></DIV
297 ><DIV
298 CLASS="NOTE"
299 ><BLOCKQUOTE
300 CLASS="NOTE"
301 ><P
302 ><B
303 >Note: </B
304 >Most of the information in the <SPAN
305 CLASS="DATABASE"
306 >ecos.db</SPAN
307 > file could
308 be obtained by a relatively simple utility. This would be passed a
309 single argument identifying a package's top-level <SPAN
310 CLASS="APPLICATION"
311 >CDL</SPAN
312 > script. The
313 directory path relative to the component repository root could be
314 determined from the filename. The name, <TT
315 CLASS="LITERAL"
316 >description</TT
317 >
318 and <TT
319 CLASS="LITERAL"
320 >hardware</TT
321 > fields could be obtained from the
322 script's <TT
323 CLASS="LITERAL"
324 >cdl_package</TT
325 > command. The <SPAN
326 CLASS="PROPERTY"
327 >display</SPAN
328 > property would supply
329 the first alias, additional aliases could be obtained by extending the
330 syntax of that property or by other means. Something along these lines
331 may be provided by a future release of the component framework.</P
332 ></BLOCKQUOTE
333 ></DIV
334 ><P
335 >Currently the <SPAN
336 CLASS="DATABASE"
337 >ecos.db</SPAN
338 > database also holds
339 information about the various targets. When porting to a new target it
340 will be necessary to add information about the target to the database,
341 as well as the details of the new platform HAL package and any related
342 packages. </P
343 ></DIV
344 ><DIV
345 CLASS="NAVFOOTER"
346 ><HR
347 ALIGN="LEFT"
348 WIDTH="100%"><TABLE
349 SUMMARY="Footer navigation table"
350 WIDTH="100%"
351 BORDER="0"
352 CELLPADDING="0"
353 CELLSPACING="0"
354 ><TR
355 ><TD
356 WIDTH="33%"
357 ALIGN="left"
358 VALIGN="top"
359 ><A
360 HREF="language.interface.html"
361 ACCESSKEY="P"
362 >Prev</A
363 ></TD
364 ><TD
365 WIDTH="34%"
366 ALIGN="center"
367 VALIGN="top"
368 ><A
369 HREF="cdl-guide.html"
370 ACCESSKEY="H"
371 >Home</A
372 ></TD
373 ><TD
374 WIDTH="33%"
375 ALIGN="right"
376 VALIGN="top"
377 ><A
378 HREF="build.html"
379 ACCESSKEY="N"
380 >Next</A
381 ></TD
382 ></TR
383 ><TR
384 ><TD
385 WIDTH="33%"
386 ALIGN="left"
387 VALIGN="top"
388 >Interfaces</TD
389 ><TD
390 WIDTH="34%"
391 ALIGN="center"
392 VALIGN="top"
393 ><A
394 HREF="language.html"
395 ACCESSKEY="U"
396 >Up</A
397 ></TD
398 ><TD
399 WIDTH="33%"
400 ALIGN="right"
401 VALIGN="top"
402 >The Build Process</TD
403 ></TR
404 ></TABLE
405 ></DIV
406 ></BODY
407 ></HTML
408 >