source: SVN/cambria/redboot/docs/redboot/html/rebuilding-redboot.html @ 1

Last change on this file since 1 was 1, checked in by Tim Harvey, 2 years ago

restored latest version of files from server backup

Signed-off-by: Tim Harvey <tharvey@…>

File size: 11.3 KB
Line 
1<!-- Copyright (C) 2007 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<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
10<HTML
11><HEAD
12><TITLE
13>Rebuilding RedBoot</TITLE
14><meta name="MSSmartTagsPreventParsing" content="TRUE">
15<META
16NAME="GENERATOR"
17CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
18REL="HOME"
19TITLE="RedBoot&#8482; User's Guide"
20HREF="redboot.html"><LINK
21REL="PREVIOUS"
22TITLE="Executing Programs from RedBoot"
23HREF="executing-programs.html"><LINK
24REL="NEXT"
25TITLE="Updating RedBoot"
26HREF="updating-redboot.html"></HEAD
27><BODY
28CLASS="CHAPTER"
29BGCOLOR="#FFFFFF"
30TEXT="#000000"
31LINK="#0000FF"
32VLINK="#840084"
33ALINK="#0000FF"
34><DIV
35CLASS="NAVHEADER"
36><TABLE
37SUMMARY="Header navigation table"
38WIDTH="100%"
39BORDER="0"
40CELLPADDING="0"
41CELLSPACING="0"
42><TR
43><TH
44COLSPAN="3"
45ALIGN="center"
46>RedBoot&#8482; User's Guide: Document Version 2.04, February 2007</TH
47></TR
48><TR
49><TD
50WIDTH="10%"
51ALIGN="left"
52VALIGN="bottom"
53><A
54HREF="executing-programs.html"
55ACCESSKEY="P"
56>Prev</A
57></TD
58><TD
59WIDTH="80%"
60ALIGN="center"
61VALIGN="bottom"
62></TD
63><TD
64WIDTH="10%"
65ALIGN="right"
66VALIGN="bottom"
67><A
68HREF="updating-redboot.html"
69ACCESSKEY="N"
70>Next</A
71></TD
72></TR
73></TABLE
74><HR
75ALIGN="LEFT"
76WIDTH="100%"></DIV
77><DIV
78CLASS="CHAPTER"
79><H1
80><A
81NAME="REBUILDING-REDBOOT"
82></A
83>Chapter 3. Rebuilding RedBoot</H1
84><DIV
85CLASS="SECT1"
86><H1
87CLASS="SECT1"
88><A
89NAME="AEN972"
90>Introduction</A
91></H1
92><P
93>In
94normal circumstances it is only necessary to rebuild RedBoot if it has been
95modified, for example if you have extended the command set or applied patches.
96See the <SPAN
97CLASS="emphasis"
98><I
99CLASS="EMPHASIS"
100>Getting Started with eCos</I
101></SPAN
102> document, which provides
103information about the portability and extendability of RedBoot in an eCos
104environment. </P
105><P
106>Most platform HALs provide configuration export files. Before proceding
107with the following procedures, check &#8220;Configuration export files&#8221;, <A
108HREF="rebuilding-redboot.html#CONFIGURATION-EXPORT-FILES"
109>the Section called <I
110>Configuration export files</I
111></A
112> first, which may simplify the process
113for your platform.</P
114><P
115> RedBoot is configured
116and built using configuration technology based on Configuration Description
117Language (CDL). The detailed instructions for building the command-line tool <SAMP
118CLASS="COMPUTEROUTPUT"
119>ecosconfig</SAMP
120> on Linux can be found in host/README. For example:
121   <TABLE
122BORDER="5"
123BGCOLOR="#E0E0F0"
124WIDTH="70%"
125><TR
126><TD
127><PRE
128CLASS="PROGRAMLISTING"
129>mkdir $TEMP/redboot-build
130cd $TEMP/redboot-build
131$ECOSDIR/host/configure --prefix=$TEMP/redboot-build --with-tcl=/usr
132make</PRE
133></TD
134></TR
135></TABLE
136></P
137><P
138>The simplest version of RedBoot can be built by setting the
139environment variable ECOS_REPOSITORY to point at the eCos/RedBoot source
140tree, and then typing:  <TABLE
141BORDER="5"
142BGCOLOR="#E0E0F0"
143WIDTH="70%"
144><TR
145><TD
146><PRE
147CLASS="PROGRAMLISTING"
148>ecosconfig new TARGET redboot
149ecosconfig tree
150make</PRE
151></TD
152></TR
153></TABLE
154>where TARGET is the eCos name for the desired platform,
155for example assabet. You will need to
156have set the environment variable ECOS_REPOSITORY to point at the
157eCos/RedBoot source tree. Values of TARGET for each board are given in the
158specific installation details for each board in
159<A
160HREF="installation-and-testing.html"
161>Chapter 5</A
162>.</P
163><P
164>The above command sequence would build a very simple version of
165RedBoot, and would not include, for example, networking, FLASH or Compact Flash
166Ethernet support on targets that supported those. Such features could
167be included with the following commands:
168<TABLE
169BORDER="5"
170BGCOLOR="#E0E0F0"
171WIDTH="70%"
172><TR
173><TD
174><PRE
175CLASS="PROGRAMLISTING"
176>ecosconfig new TARGET redboot
177ecosconfig add flash
178ecosconfig add pcmcia net_drivers cf_eth_drivers
179ecosconfig tree
180make</PRE
181></TD
182></TR
183></TABLE
184></P
185><P
186>In practice, most platform HALs include configuration export files,
187described in <A
188HREF="rebuilding-redboot.html#CONFIGURATION-EXPORT-FILES"
189>the Section called <I
190>Configuration export files</I
191></A
192>, to ensure that
193the correct configuration of RedBoot
194has been chosen to avoid needing to worry about which extra packages
195to add.</P
196><P
197>The above commands would build a version of RedBoot
198suitable for testing. In particular, the result will run from RAM. Since RedBoot
199normally needs to be installed in ROM/flash, type the following: </P
200><TABLE
201BORDER="5"
202BGCOLOR="#E0E0F0"
203WIDTH="70%"
204><TR
205><TD
206><PRE
207CLASS="PROGRAMLISTING"
208>cat &#62;RedBoot_ROM.ecm &lt;&lt;EOF
209cdl_component CYG_HAL_STARTUP {
210       user_value ROM
211};
212EOF
213ecosconfig import RedBoot_ROM.ecm
214ecosconfig tree
215make</PRE
216></TD
217></TR
218></TABLE
219><P
220>This set of commands will adjust the configuration to be ROM oriented.</P
221><P
222>Each of these command sequences creates multiple versions of RedBoot
223in different file formats. The choice of which file to use will depend upon
224the actual target hardware and the tools available for programming ROM/flash.
225The files produced (typically) are:</P
226><P
227><SAMP
228CLASS="COMPUTEROUTPUT"
229>install/bin/redboot.elf </SAMP
230>This is the
231complete version of RedBoot, represented in ELF format. It is most useful
232for testing with tools such as embedded ICE, or other debug tools. </P
233><P
234><SAMP
235CLASS="COMPUTEROUTPUT"
236>install/bin/redboot.srec</SAMP
237> This version
238has been converted to Motorola S-record format. </P
239><P
240><SAMP
241CLASS="COMPUTEROUTPUT"
242>install/bin/redboot.bin</SAMP
243> This version
244has been flattened; that is, all formatting information removed and just the
245raw image which needs to be placed in ROM/flash remains. </P
246><P
247>The details of putting the RedBoot code into ROM/flash are target specific.
248Once complete, the system should come up with the RedBoot prompt. For example,
249the version built using the commands above looks like: <TABLE
250BORDER="5"
251BGCOLOR="#E0E0F0"
252WIDTH="70%"
253><TR
254><TD
255><PRE
256CLASS="PROGRAMLISTING"
257>RedBoot(tm) debug environment [ROM]
258Red Hat certified release, version R1.xx - built 07:54:25, Oct 16 2000
259Platform: Assabet development system (StrongARM 1110)
260Copyright (C) 2000, Red Hat, Inc.
261RAM: 0x00000000-0x02000000
262flash: 0x50000000 - 0x50400000, 32 blocks of 0x00020000 bytes ea.
263Socket Communications, Inc: Low Power Ethernet CF Revision C
2645V/3.3V 08/27/98
265IP: 192.168.1.29, Default server: 192.168.1.101
266RedBoot&#62; </PRE
267></TD
268></TR
269></TABLE
270></P
271><DIV
272CLASS="SECT2"
273><H2
274CLASS="SECT2"
275><A
276NAME="CONFIGURATION-EXPORT-FILES"
277>Configuration export files</A
278></H2
279><P
280>To
281help with rebuilding RedBoot from source, some platforms HALs provide configuration
282export files. First locate the configuration export files for your platform
283in the eCos source repository. The RAM and ROM startup configuration exports
284can usually be found in a directory named "misc" in the platform HAL in the
285eCos source repository, named:  <TABLE
286BORDER="5"
287BGCOLOR="#E0E0F0"
288WIDTH="70%"
289><TR
290><TD
291><PRE
292CLASS="PROGRAMLISTING"
293>1432 Feb  1 13:27 misc/redboot_RAM.ecm
2941487 Feb  1 14:38 misc/redboot_ROM.ecm</PRE
295></TD
296></TR
297></TABLE
298>All dates and sizes
299are just examples.</P
300><DIV
301CLASS="SECT3"
302><H3
303CLASS="SECT3"
304><A
305NAME="MAKING-REDBOOT-FOR-RAM-STARTUP"
306>Making RedBoot for RAM startup</A
307></H3
308><P
309>Throughout the following instructions, several environmental variables
310are referred to:</P
311><P
312></P
313><DIV
314CLASS="VARIABLELIST"
315><DL
316><DT
317><CODE
318CLASS="ENVAR"
319>$REDBOOTDIR</CODE
320></DT
321><DD
322><P
323>Full path to the toplevel RedBoot source release.</P
324></DD
325><DT
326><CODE
327CLASS="ENVAR"
328>$BUILDDIR</CODE
329></DT
330><DD
331><P
332>Full path to where RedBoot will be built,
333e.g. <TT
334CLASS="FILENAME"
335>redboot.RAM</TT
336>.</P
337></DD
338><DT
339><CODE
340CLASS="ENVAR"
341>$ECOS_REPOSITORY</CODE
342></DT
343><DD
344><P
345>Full path to the RedBoot package source. Typically, this should
346be <TT
347CLASS="FILENAME"
348><CODE
349CLASS="ENVAR"
350>$REDBOOTDIR</CODE
351>/packages</TT
352>.</P
353></DD
354><DT
355><CODE
356CLASS="ENVAR"
357>$TARGET</CODE
358></DT
359><DD
360><P
361>e.g.atlas_mips32_4kc.</P
362></DD
363><DT
364><CODE
365CLASS="ENVAR"
366>$ARCH_DIR</CODE
367></DT
368><DD
369><P
370>The directory for the architecture, e.g. mips.</P
371></DD
372><DT
373><CODE
374CLASS="ENVAR"
375>$PLATFORM_DIR</CODE
376></DT
377><DD
378><P
379>The directory for the platform, e.g. atlas.</P
380></DD
381><DT
382><CODE
383CLASS="ENVAR"
384>$VERSION</CODE
385></DT
386><DD
387><P
388>The version of the release, e.g. current.</P
389></DD
390></DL
391></DIV
392><P
393>You must make sure these variables are correctly set in your environment
394before proceeding, or the build will fail. The values for
395<CODE
396CLASS="ENVAR"
397>$TARGET</CODE
398>, <CODE
399CLASS="ENVAR"
400>$ARCH_DIR</CODE
401> and
402<CODE
403CLASS="ENVAR"
404>$PLATFORM_DIR</CODE
405> for each board are given in the
406specific installation details for each board
407in <A
408HREF="installation-and-testing.html"
409>Chapter 5</A
410>. The value for
411<CODE
412CLASS="ENVAR"
413>$VERSION</CODE
414> is the name of the package subdirectories -
415usually 'current' for sources checked out of CVS, or something like
416'vX_Y' for a regular X.Y release.</P
417><P
418>With the environment variables set, use the following sequence of commands to
419build a RedBoot image suitable for loading into RAM:<TABLE
420BORDER="5"
421BGCOLOR="#E0E0F0"
422WIDTH="70%"
423><TR
424><TD
425><PRE
426CLASS="PROGRAMLISTING"
427>mkdir $BUILDDIR
428cd $BUILDDIR
429ecosconfig new $TARGET redboot
430ecosconfig import \
431  ${ECOS_REPOSITORY}/hal/${ARCH_DIR}/${PLATFORM_DIR}/${VERSION}/misc/redboot_RAM.ecm
432ecosconfig tree
433make </PRE
434></TD
435></TR
436></TABLE
437></P
438><P
439>To build a ROM or ROMRAM version, in a different build/config directory, just
440use the configuration export file <TT
441CLASS="FILENAME"
442>redboot_ROM.ecm</TT
443>
444or <TT
445CLASS="FILENAME"
446>redboot_ROMRAM.ecm</TT
447> instead.</P
448><P
449>The resulting files will be, in each of the ROM, ROMRAM and RAM
450    startup build places: <TABLE
451BORDER="5"
452BGCOLOR="#E0E0F0"
453WIDTH="70%"
454><TR
455><TD
456><PRE
457CLASS="PROGRAMLISTING"
458>    $BUILDDIR/install/bin/redboot.bin
459    $BUILDDIR/install/bin/redboot.elf
460    $BUILDDIR/install/bin/redboot.img
461    $BUILDDIR/install/bin/redboot.srec</PRE
462></TD
463></TR
464></TABLE
465></P
466><P
467>Some targets may have variations, or extra files generated in addition.</P
468></DIV
469></DIV
470><DIV
471CLASS="SECT2"
472><H2
473CLASS="SECT2"
474><A
475NAME="PLATFORM-SPECIFIC-BUILD-INSTRUCTIONS"
476>Platform specific instructions</A
477></H2
478><P
479>The platform specific information in <A
480HREF="installation-and-testing.html"
481>Chapter 5</A
482>
483should be consulted, as there may be other special instructions
484required to build RedBoot for particular boards.</P
485></DIV
486></DIV
487></DIV
488><DIV
489CLASS="NAVFOOTER"
490><HR
491ALIGN="LEFT"
492WIDTH="100%"><TABLE
493SUMMARY="Footer navigation table"
494WIDTH="100%"
495BORDER="0"
496CELLPADDING="0"
497CELLSPACING="0"
498><TR
499><TD
500WIDTH="33%"
501ALIGN="left"
502VALIGN="top"
503><A
504HREF="executing-programs.html"
505ACCESSKEY="P"
506>Prev</A
507></TD
508><TD
509WIDTH="34%"
510ALIGN="center"
511VALIGN="top"
512><A
513HREF="redboot.html"
514ACCESSKEY="H"
515>Home</A
516></TD
517><TD
518WIDTH="33%"
519ALIGN="right"
520VALIGN="top"
521><A
522HREF="updating-redboot.html"
523ACCESSKEY="N"
524>Next</A
525></TD
526></TR
527><TR
528><TD
529WIDTH="33%"
530ALIGN="left"
531VALIGN="top"
532>Executing Programs from RedBoot</TD
533><TD
534WIDTH="34%"
535ALIGN="center"
536VALIGN="top"
537>&nbsp;</TD
538><TD
539WIDTH="33%"
540ALIGN="right"
541VALIGN="top"
542>Updating RedBoot</TD
543></TR
544></TABLE
545></DIV
546></BODY
547></HTML
548>
Note: See TracBrowser for help on using the repository browser.