]> git.karo-electronics.de Git - karo-tx-redboot.git/blob - packages/redboot/v2_0/doc/redboot.sgml
Initial revision
[karo-tx-redboot.git] / packages / redboot / v2_0 / doc / redboot.sgml
1 <!-- {{{ Banner                         -->
2
3 <!-- =============================================================== -->
4 <!--                                                                 -->
5 <!--     redboot.sgml                                                -->
6 <!--                                                                 -->
7 <!--     RedBoot package                                             -->
8 <!--                                                                 -->
9 <!-- =============================================================== -->
10 <!-- ####COPYRIGHTBEGIN####                                          -->
11 <!--                                                                 -->
12 <!-- =============================================================== -->
13 <!-- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.  -->
14 <!-- This material may be distributed only subject to the terms      -->
15 <!-- and conditions set forth in the Open Publication License, v1.0  -->
16 <!-- or later (the latest version is presently available at          -->
17 <!-- http://www.opencontent.org/openpub/)                            -->
18 <!-- Distribution of the work or derivative of the work in any       -->
19 <!-- standard (paper) book form is prohibited unless prior           -->
20 <!-- permission obtained from the copyright holder                   -->
21 <!-- =============================================================== -->
22 <!--                                                                 -->      
23 <!-- ####COPYRIGHTEND####                                            -->
24 <!-- =============================================================== -->
25 <!-- #####DESCRIPTIONBEGIN####                                       -->
26 <!--                                                                 -->
27 <!-- ####DESCRIPTIONEND####                                          -->
28 <!-- =============================================================== -->
29
30 <!-- }}} -->
31
32 <!-- uncomment to build this documentation as a DocBook part
33 <part id="redboot"><beginpage>
34 <title>RedBoot&trade; User's Guide</title>
35 -->
36 <toc id="Getting-Started-with-Redboot2"></toc>
37 <chapter id="Getting-Started-with-RedBoot">
38 <title>Getting Started with RedBoot</title>
39 <para><indexterm><primary>Red Boot</primary><secondary>getting started</secondary>
40 </indexterm>RedBoot&trade; is an acronym for "Red Hat Embedded Debug and Bootstrap",
41 and is the standard embedded system debug/bootstrap environment from Red Hat,
42 replacing the previous generation of debug firmware: <indexterm><primary>CygMon</primary>
43 </indexterm>CygMon and <indexterm><primary>GDB stubs</primary></indexterm>GDB
44 stubs. It provides a complete bootstrap environment for a range of embedded
45 operating systems, such as embedded Linux&trade; and eCos&trade;, and includes facilities
46 such as network downloading and debugging. It also provides a simple flash
47 file system for boot images.</para>
48 <para>RedBoot provides a wide set of tools for downloading and executing programs
49 on embedded target systems, as well as tools for manipulating the target system's
50 environment. It can be used for both product development (debug support) and
51 for end product deployment (flash and network booting).</para>
52 <para>Here are some highlights of <indexterm><primary>RedBoot's capabilities
53 </primary></indexterm>RedBoot&rsquo;s capabilities:  </para>
54 <itemizedlist>
55 <listitem><para>Boot scripting support</para>
56 </listitem>
57 <listitem><para>Simple command line interface for RedBoot configuration and
58 management, accessible via serial (terminal) or Ethernet (telnet) </para>
59 </listitem>
60 <listitem><para>Integrated GDB stubs for connection to a host-based debugger
61 via serial or ethernet. (Ethernet connectivity is limited to local network
62 only)</para>
63 </listitem>
64 <listitem><para>Attribute Configuration - user control of aspects such as
65 system time and date (if applicable), default Flash image to boot from, default
66 failsafe image, static IP address, etc.</para>
67 </listitem>
68 <listitem><para>Configurable and extensible, specifically adapted to the target
69 environment </para>
70 </listitem>
71 <listitem><para>Network bootstrap support including setup and download, via
72 BOOTP, DHCP and TFTP</para>
73 </listitem>
74 <listitem><para>X/YModem support for image download via serial</para>
75 </listitem>
76 <listitem><para>Power On Self Test</para>
77 </listitem>
78 </itemizedlist>
79 <para>Although RedBoot is derived from eCos, it may be used as a generalized
80 system debug and bootstrap control software for any embedded system and any
81 operating system. For example, with appropriate additions, RedBoot could replace
82 the commonly used BIOS of PC (and certain other) architectures. Red Hat is
83 currently installing RedBoot on all embedded platforms as a standard practice,
84 and RedBoot is now generally included as part of all Red Hat Embedded Linux
85 and eCos ports. Users who specifically wish to use RedBoot with the eCos operating
86 system should refer to the <emphasis>Getting Started with eCos</emphasis>
87 document, which provides information about the portability and extendability
88 of RedBoot in an eCos environment.</para>
89 <sect1 id="redboot-on-the-web">
90 <title>More information about RedBoot on the web</title>
91 <para>The <ulink url="http://sources.redhat.com/redboot/">RedBoot Net
92 Distribution web site</ulink> contains downloadable sources and documentation
93 for all publically released targets, including the latest features and updates.
94 </para>
95 </sect1>
96 <sect1 id="installing-redboot">
97 <title>Installing RedBoot</title>
98 <para><indexterm><primary>installing RedBoot</primary><secondary>general procedures
99 </secondary></indexterm><indexterm><primary>RedBoot installation</primary>
100 <secondary>general procedures</secondary></indexterm>To install the RedBoot
101 package, follow the procedures detailed in the accompanying README. </para>
102 <para>Although there are other possible configurations, RedBoot is usually
103 run from the target platform&rsquo;s flash boot sector or boot ROM, and is
104 designed to run when your system is initially powered on. The method used
105 to install the RedBoot image into non-volatile storage varies from platform
106 to platform. In general, it requires that the image be programmed into flash
107 in situ or programmed into the flash or ROM using a device programmer. In
108 some cases this will be done at manufacturing time; the platform being delivered
109 with RedBoot already in place. In other cases, you will have to program RedBoot
110 into the appropriate device(s) yourself. Installing to flash in situ may require
111 special cabling or interface devices and software provided by the board manufacturer.
112 The details of this installation process for a given platform will be found
113 in Installation and Testing. Once installed, user-specific configuration options
114 may be applied, using the <command>fconfig</command> command,
115 providing that persistent data storage in flash is present in the relevant
116 RedBoot version. See <xref linkend="Configuring-the-RedBoot-Environment">
117 for details.</para>
118 </sect1>
119 <sect1 id="user-interface">
120 <title>User Interface</title>
121 <para><indexterm><primary>user interface</primary></indexterm><indexterm>
122 <primary>ui</primary></indexterm><indexterm><primary>cli</primary></indexterm>RedBoot
123 provides a command line user interface (CLI). At the minimum, this interface
124 is normally available on a serial port on the platform. If more than one serial
125 interface is available, RedBoot is normally configured to try to use any one
126 of the ports for the CLI. Once command input has been received on one port,
127 that port is used exclusively until the board is reset or the channel
128 is manually changed by the
129 user. If the platform has networking
130 capabilities, the RedBoot CLI is also accessible using the <computeroutput>
131 telnet</computeroutput> access protocol. By default, RedBoot runs <computeroutput><indexterm>
132 <primary>telnet</primary></indexterm>telnet</computeroutput> on port TCP/9000,
133 but this is configurable and/or settable by the user. </para>
134 <para>RedBoot also contains a set of <indexterm><primary>GDB stubs</primary>
135 </indexterm>GDB "stubs", consisting of code which supports the GDB remote
136 protocol. GDB stub mode is automatically invoked when the '$' character appears
137 anywhere on a command line unless escaped using the '\' character. 
138 The platform will remain in GDB
139 stub mode until explicitly disconnected (via the GDB protocol). The GDB stub
140 mode is available regardless of the connection method; either serial or network.
141 Note that if a GDB connection is made via the network, then special care must
142 be taken to preserve that connection when running user code. eCos contains
143 special network sharing code to allow for this situation, and can be used
144 as a model if this methodology is required in other OS environments.</para>
145 </sect1>
146
147 <sect1 id="RedBoot-Editing-Commands">
148 <title>RedBoot Editing Commands</title>
149 <para><indexterm><primary>RedBoot</primary><secondary>editing commands</secondary>
150 </indexterm><indexterm><primary>editing commands</primary></indexterm><indexterm>
151 <primary>commands</primary><secondary>editing</secondary></indexterm>RedBoot
152 uses the following line editing commands. 
153 <note><title>NOTE</title>
154 <para>
155 In this description, <guibutton>^A</guibutton> means the character formed
156 by typing the letter &ldquo;A&rdquo; while holding down the control key.
157 </para></note>
158 <itemizedlist>
159 <listitem><para><guibutton>Delete</guibutton> (0x7F) or 
160 <guibutton>Backspace</guibutton> (0x08) 
161 erases the character to the left of the cursor.
162 </para></listitem>
163 <listitem><para>
164 <guibutton>^A</guibutton> or <guibutton>HOME</guibutton>
165 moves the cursor (insertion point) to the beginning of the line.
166 </para></listitem>
167 <listitem><para>
168 <guibutton>^K</guibutton>
169 erases all characters on the line from the cursor to the end.
170 </para></listitem>
171 <listitem><para>
172 <guibutton>^E</guibutton> or <guibutton>END</guibutton>
173 positions the cursor to the end of the line.
174 </para></listitem>
175 <listitem><para>
176 <guibutton>^D</guibutton> or <guibutton>DELETE</guibutton>
177 erases the character under the cursor.
178 </para></listitem>
179 <listitem><para>
180 <guibutton>^F</guibutton> or <guibutton>RIGHT-ARROW</guibutton>
181 moves the cursor one character to the right.
182 </para></listitem>
183 <listitem><para>
184 <guibutton>^B</guibutton> or <guibutton>LEFT-ARROW</guibutton>
185 moves the cursor one character to the left.
186 </para></listitem>
187 <listitem><para>
188 <guibutton>^P</guibutton> or <guibutton>UP-ARROW</guibutton>
189 replaces the current line by a previous line from the history buffer.  
190 A small number of lines
191 can be kept as history.  Using ^P (and ^N), the current line can be replaced
192 by any one of the previously typed lines.
193 </para></listitem>
194 <listitem><para>
195 <guibutton>^N</guibutton> or <guibutton>DOWN-ARROW</guibutton>
196 replaces the current line by the next line from the history buffer.  
197 </para></listitem>
198 </itemizedlist></para>
199 <para>In the case of the <command>fconfig</command>
200 command, additional editing commands are possible. 
201 As data are entered for this command, the current/previous value
202 will be displayed and the cursor placed at the end of that data.
203 The user may use the editing keys (above) to move around in the data
204 to modify it as appropriate.
205 Additionally, when certain
206 characters are entered at the end of the current value, 
207 i.e. entered separately, certain behavior is elicited.</para>
208 <para><itemizedlist>
209 <listitem>
210 <para>^ (caret) switch to editing the previous item in the 
211 <command>fconfig</command> list. If fconfig edits item A, followed by item B,
212 pressing ^ when changing item B, allows you to change item A. This is similar
213 to the up arrow.
214 Note: ^P and ^N do not have the same meaning while editing 
215 <command>fconfig</command> data and should not be used.
216 </para>
217 </listitem>
218 <listitem><para>. (period) stop editing any further items. This does not change
219 the current item.</para>
220 </listitem>
221 <listitem><para><guibutton>Return</guibutton> leaves the value
222 for this item unchanged. Currently it is not possible to step through the
223 value for the start-up script; it must always be retyped.</para>
224 </listitem>
225 </itemizedlist></para>
226 </sect1>
227
228 <sect1 id="RedBoot-Command-History">
229 <title>RedBoot Command History</title>
230 <para>
231 <indexterm><primary>RedBoot</primary><secondary>command history</secondary></indexterm>
232 <indexterm><primary>command history</primary></indexterm>
233 <indexterm><primary>commands</primary><secondary>history</secondary></indexterm>
234 RedBoot provides support for listing and repeating previously entered commands. A
235 list of previously entered commands may be obtained by typing <command>history</command>
236 at the command line:
237 <screen>
238 RedBoot> <userinput>history</userinput>
239   0 fis list
240   1 fconfig -l
241   2 load -m ymodem
242   3 history
243 </screen>
244 </para><para>
245 The following history expansions may be used to execute commands in the history list:
246 <itemizedlist>
247 <listitem><para>
248 !! repeats last command.
249 </para></listitem>
250 <listitem><para>
251 !<userinput>n</userinput> repeats command <userinput>n</userinput>.
252 </para></listitem>
253 <listitem><para>
254 !<userinput>string</userinput> repeats most recent command starting with
255 <userinput>string</userinput>.
256 </para></listitem>
257 </itemizedlist>
258 </para>
259 </sect1>
260
261 <sect1 id="startup-mode">
262 <title>RedBoot Startup Mode</title>
263 <para>
264   <indexterm><primary>RedBoot</primary><secondary>mode</secondary></indexterm>
265   <indexterm><primary>RedBoot</primary><secondary>startup mode</secondary></indexterm>
266 </para>
267
268 <para>RedBoot can normally be configured to run in a number of startup
269 modes (or just "modes" for short), determining its location of
270 residence and execution:
271 <variablelist>
272  <varlistentry><term>ROM mode</term>
273  <listitem><para>In this mode, RedBoot both resides and executes from
274  ROM memory (flash or EPROM). This mode is used when there are limited
275  RAM resources. The flash commands cannot update the region of flash
276  where the RedBoot image resides. In order to update the RedBoot image
277  in flash, it is necessary to run a RAM mode instance of
278  RedBoot.</para></listitem>
279  </varlistentry>
280
281  <varlistentry><term>ROMRAM mode</term>
282  <listitem><para>In this mode, RedBoot resides in ROM memory (flash or
283  EPROM), but is copied to RAM memory before it starts executing. The
284  RAM footprint is larger than for ROM mode, but there are two
285  advantages to make up for this: it normally runs faster (relevant
286  only on slower boards) and it is able to update the flash region
287  where the image resides.</para></listitem>
288  </varlistentry>
289
290  <varlistentry><term>RAM mode</term>
291  <listitem><para>In this mode, RedBoot both resides and executes from
292  RAM memory. This is used for updating a primary ROM
293  mode image in situ and sometimes as part of the RedBoot installation
294  on the board when there's already an existing (non-RedBoot) boot
295  monitor available.</para>
296
297  <para> You can only use ROM and ROMRAM mode images for booting a
298  board - a RAM mode image cannot run unless loaded by another ROM
299  monitor. There is no need for this startup mode if a RedBoot ROMRAM
300  mode image is the primary boot monitor.  When this startup mode is
301  programmed into flash (as a convenience as it's fast to load from
302  flash) it will generally be named as "RedBoot[RAM]" in the FIS
303  directory.  </para></listitem>
304  </varlistentry>
305 </variablelist>
306
307 The chosen mode has influence on flash and RAM resource usage (see
308 <xref linkend="resource-usage">) and the procedure of an in situ update
309 of RedBoot in flash (see <xref linkend="Updating-Redboot">).</para>
310
311 <para>The startup mode is controlled by the option CYG_HAL_STARTUP
312 which resides in the platform HAL. Some platforms provide only some of
313 the RAM, ROM, and ROMRAM modes, others provide additional
314 modes.</para>
315
316 <para>To see mode of a currently executing RedBoot, issue the
317 <command>version</command> command, which prints the RedBoot banner,
318 including the startup mode (here ROM):
319 <screen>RedBoot><userinput>version</userinput>
320
321 RedBoot(tm) bootstrap and debug environment <emphasis>[ROM]</emphasis>
322 Non-certified release, version UNKNOWN - built 13:31:57, May 17 2002
323 </screen>
324 </para>
325
326 </sect1>
327
328 <sect1 id="resource-usage">
329 <title>RedBoot Resource Usage</title>
330 <para>
331   <indexterm><primary>RedBoot</primary><secondary>resource usage</secondary></indexterm>
332 </para>
333
334 <para>RedBoot takes up both flash and RAM resources depending on its
335 startup mode and number of enabled features. There are also other
336 resources used by RedBoot, such as timers. Platform-specific resources
337 used by RedBoot are listed in the platform specific parts of this
338 manual.</para>
339
340 <para>Both flash and RAM resources used by RedBoot depend to some
341 degree on the features enabled in the RedBoot configuration. It is
342 possible to reduce in particular the RAM resources used by RedBoot by
343 removing features that are not needed. Flash resources can also be
344 reduced, but due to the granularity of the flash (the block sizes),
345 reductions in feature size do not always result in flash resource
346 savings.</para>
347
348
349 <sect2>
350 <title>Flash Resources</title>
351 <para>On many platforms, a ROM mode RedBoot image resides in the first
352 flash sectors, working as the board's primary boot monitor. On these
353 platforms, it is also normal to reserve a similar amount of flash for
354 a secondary RAM mode image, which is used when updating the primary
355 ROM mode image.</para>
356 <para>On other platforms, a ROMRAM mode RedBoot image is used as the
357 primary boot monitor. On these platforms there is not normally
358 reserved space for a RAM mode RedBoot image, since the ROMRAM mode
359 RedBoot is capable of updating the primary boot monitor image.</para>
360 <para>Most platforms also contain a FIS directory (keeping track of
361 available flash space) and a RedBoot config block (containing RedBoot
362 board configuration data).</para>
363 <para>To see the amount of reserved flash memory, run the <command>fis
364 list</command> command:
365 <screen>RedBoot> <userinput>fis list</userinput>
366 Name              FLASH addr  Mem addr    Length      Entry point
367 RedBoot           0x00000000  0x00000000  0x00020000  0x00000000
368 RedBoot[RAM]      0x00020000  0x06020000  0x00020000  0x060213C0
369 RedBoot config    0x0007F000  0x0007F000  0x00001000  0x00000000
370 FIS directory     0x00070000  0x00070000  0x0000F000  0x00000000
371 </screen>
372 </para>
373
374 <para>To save flash resources, use a ROMRAM mode RedBoot, or if using
375 a ROM mode RedBoot, avoid reserving space for the RedBoot[RAM] image
376 (this is done by changing the RedBoot configuration) and download the
377 RAM mode RedBoot whenever it is needed. If the RedBoot image takes up
378 a fraction of an extra flash block, it may be possible to reduce the
379 image size enough to free this block by removing some features.</para>
380
381 </sect2>
382
383 <sect2>
384 <title>RAM Resources</title>
385
386 <para>RedBoot reserves RAM space for its run-time data, and such
387 things as CPU exception/interrupt tables. It normally does so at the
388 bottom of the memory map. It may also reserve space at the top of the
389 memory map for configurable RedBoot features such as the net stack
390 and zlib decompression support.</para>
391 <para>To see the actual amount of reserved space, issue the
392 <command>version</command> command, which prints the RedBoot banner,
393 including the RAM usage:
394 <screen>RedBoot> <userinput>version</userinput>
395
396 RedBoot(tm) bootstrap and debug environment [ROM]
397 Non-certified release, version UNKNOWN - built 13:31:57, May 17 2002
398
399 Platform: FooBar (SH 7615)
400 Copyright (C) 2000, 2001, 2002, Red Hat, Inc.
401
402 <emphasis>RAM: 0x06000000-0x06080000, 0x06012498-0x06061000 available</emphasis>
403 FLASH: 0x00000000 - 0x00080000, 8 blocks of 0x00010000 bytes each.
404 </screen>
405 </para>
406
407 <para>To simplify operations that temporarily need data in free
408 memory, the limits of free RAM are also available as aliases (aligned
409 to the nearest kilo-byte limit). These are named
410 <indexterm><primary>FREEMEMLO</primary></indexterm>FREEMEMLO and
411 <indexterm><primary>FREEMEMHI</primary></indexterm>FREEMEMHI, and can
412 be used in commands like any user defined alias:
413 <screen>RedBoot> <userinput>load -r -b %{FREEMEMLO} file</userinput>
414 Raw file loaded 0x06012800-0x06013e53, assumed entry at 0x06012800
415 </screen>
416 <screen>
417 RedBoot> <userinput>x -b %{FREEMEMHI}</userinput>
418 06061000: 86 F5 EB D8 3D 11 51 F2  96 F4 B2 DC 76 76 8F 77  |....=.Q.....vv.w|
419 06061010: E6 55 DD DB F3 75 5D 15  E0 F3 FC D9 C8 73 1D DA  |.U...u]......s..|
420 </screen>
421 </para>
422
423 <para>To reduce RedBoot's RAM resource usage, use a ROM mode
424 RedBoot. The RedBoot features that use most RAM are the net stack, the
425 flash support and the gunzip support. These, and other features, can
426 be disabled to reduce the RAM footprint, but obviously at the cost of
427 lost functionality.</para>
428
429 </sect2>
430 </sect1>
431
432 <sect1 id="Configuring-the-RedBoot-Environment">
433 <title>Configuring the RedBoot Environment</title>
434 <para><indexterm><primary>configuring the RedBoot environment</primary><secondary></secondary>
435 </indexterm><indexterm><primary>RedBoot </primary><secondary>environment configuration
436 </secondary></indexterm><indexterm><primary>environment configuration</primary>
437 </indexterm>Once installed, RedBoot will operate fairly generically. However,
438 there are some features that can be configured for a particular installation.
439 These depend primarily on whether <indexterm><primary>flash and/or networking
440 support</primary></indexterm><indexterm><primary>networking and/or flash support
441 </primary></indexterm>flash and/or networking support are available. The remainder
442 of this discussion assumes that support for both of these options is included
443 in RedBoot.</para>
444 <sect2 id=target-network-configuration>
445 <title>Target Network Configuration</title>
446 <para><indexterm><primary>target network configuration</primary></indexterm><indexterm>
447 <primary>network configuration</primary></indexterm><indexterm><primary>configuration
448 </primary><secondary>secondary</secondary></indexterm>Each node in a networked
449 system needs to have a unique address. Since the network support in RedBoot
450 is based on <indexterm><primary>TCP/IP</primary></indexterm>TCP/IP, this address
451 is an IP (Internet Protocol) address. <indexterm><primary>IP address type
452 </primary></indexterm>There are two ways for a system to &ldquo;know&rdquo;
453 its IP address. First, it can be stored locally on the platform. This is known
454 as having a static IP address. Second, the system can use the network itself
455 to discover its IP address. This is known as a dynamic IP address. RedBoot
456 supports this dynamic IP address mode by use of the <indexterm><primary>BOOTP
457 </primary></indexterm>BOOTP (a subset of <indexterm><primary>DHCP</primary>
458 </indexterm>DHCP) protocol. In this case, RedBoot will ask the network (actually
459 some generic server on the network) for the IP address to use.</para>
460 <note><title>NOTE</title>
461 <para>Currently, RedBoot only supports BOOTP. In future releases, DHCP may
462 also be supported, but such support will be limited to additional data items,
463 not lease-based address allocation.</para>
464 </note>
465 <para>The choice of <indexterm><primary>IP address type</primary></indexterm>IP
466 address type is made via the <indexterm><primary>fconfig command</primary>
467 </indexterm><command>fconfig</command> command. Once a selection
468 is made, it will be stored in flash memory. RedBoot only queries the flash
469 configuration information at reset, so any changes will require restarting
470 the platform.</para>
471 <para>Here is an example of the RedBoot <command>fconfig</command>
472 command, showing network addressing:    </para>
473 <programlisting>RedBoot> <userinput>fconfig -l</userinput>
474 Run script at boot: false
475 Use BOOTP for network configuration: false
476 Local IP address: 192.168.1.29
477 Default server IP address: 192.168.1.101
478 DNS server IP address: 192.168.1.1
479 GDB connection port: 9000
480 Network debug at boot time: false  </programlisting>
481 <para>In this case, the board has been configured with a static IP address
482 listed as the Local IP address. The default server IP address specifies which
483 network node to communicate with for TFTP service. This address can be overridden
484 directly in the <indexterm><primary>TFTP commands</primary></indexterm>TFTP
485 commands.</para>
486 <para>The <computeroutput>DNS server IP address</computeroutput> option
487 controls where RedBoot should make DNS lookups<indexterm><primary>DNS
488 lookups</primary></indexterm>. A setting of 0.0.0.0 will disable DNS
489 lookups. The DNS server IP address can also be set at runtime.</para>
490 <para>If the selection for <computeroutput>Use BOOTP for network configuration
491 </computeroutput> had been <computeroutput>true</computeroutput>, these IP
492 addresses would be determined at boot time, via the BOOTP protocol. The final
493 number which needs to be configured, regardless of IP address selection mode,
494 is the <indexterm><primary>GDB connection port</primary></indexterm><computeroutput>
495 GDB connection port</computeroutput>. RedBoot allows for incoming commands
496 on either the available serial ports or via the network. This port number
497 is the TCP port that RedBoot will use to accept incoming connections.  </para>
498 <para>These connections can be used for GDB sessions, but they can also be
499 used for generic RedBoot commands. In particular, it is possible to communicate
500 with RedBoot via the <indexterm><primary>telnet</primary></indexterm>telnet
501 protocol. For example, on Linux&reg;: </para>
502 <programlisting>% telnet redboot_board 9000
503 Connected to redboot_board
504 Escape character is &lsquo;^]&rsquo;.
505 RedBoot>  </programlisting>
506 </sect2>
507 <sect2>
508 <title>Host Network Configuration</title>
509 <para><indexterm><primary>host network configuration</primary></indexterm><indexterm>
510 <primary>network configuration</primary><secondary>host</secondary></indexterm><indexterm>
511 <primary>configuration</primary><secondary>network</secondary></indexterm>RedBoot
512 may require three different classes of service from a network host:   </para>
513 <itemizedlist>
514 <listitem><para>dynamic IP address allocation, using BOOTP   </para>
515 </listitem>
516 <listitem><para>TFTP service for file downloading </para>
517 </listitem>
518 <listitem><para>DNS server for hostname lookups </para>
519 </listitem>
520 </itemizedlist>
521 <para>Depending on the host system, these services may or may not be available
522 or enabled by default. See your system documentation for more details.</para>
523 <para>In particular, on Red Hat Linux, neither of these services will be configured
524 out of the box. The following will provide a limited explanation of how to
525 set them up. These configuration setups must be done as <computeroutput>root
526 </computeroutput> on the host or server machine.</para>
527 <sect3>
528 <title>Enable TFTP on Red Hat Linux 6.2</title>
529 <procedure>
530 <step><para><indexterm><primary>TFTP</primary><secondary>enabling on Red Hat
531 Linux 6.2</secondary></indexterm><indexterm><primary>Red Hat Linux</primary>
532 <secondary>enabling TFTP on version 6.2</secondary></indexterm>Ensure that
533 you have the tftp-server RPM package installed. By default, this installs
534 the TFTP server in a disabled state. These steps will enable it:</para>
535 </step>
536 <step><para>Make sure that the following line is uncommented in the control
537 file <filename>/etc/inetd.conf</filename> <screen>tftp dgram   udp     wait    root    /usr/sbin/tcpd      /usr/sbin/in.tftpd
538 </screen></para>
539 <para></para>
540 </step>
541 <step><para>If it was necessary to change the line in Step 2, then the inetd
542 server must be restarted, which can be done via the command:    <programlisting>
543 # service inet reload</programlisting></para>
544 </step>
545 </procedure>
546 </sect3>
547 <sect3>
548 <title>Enable TFTP on Red Hat Linux 7 (or newer)</title>
549 <procedure>
550 <step><para><indexterm><primary>TFTP</primary><secondary>enabling on Red Hat
551 Linux 7</secondary></indexterm><indexterm><primary>Red Hat Linux</primary>
552 <secondary>enabling TFTP on version 7</secondary></indexterm>Ensure that the
553 xinetd RPM is installed.</para>
554 </step>
555 <step><para>Ensure that the tftp-server RPM is installed.</para>
556 </step>
557 <step><para>Enable TFTP by means of the following: <programlisting>/sbin/chkconfig tftp on
558 </programlisting>Reload the xinetd configuration using the command:<programlisting>
559  /sbin/service xinetd reload </programlisting>Create the directory /tftpboot
560 using the command <programlisting>mkdir /tftpboot</programlisting></para>
561 </step>
562 <step><para>If you are using Red Hat 8 or newer, you may need to configure
563 the built-in firewall to allow through TFTP. Either edit
564 <filename>/etc/sysconfig/iptables</filename> or run
565 <command>redhat-config-securitylevel</command> on the command line or from
566 the menu as System Settings->Security Settings to lower the security level.
567 You should only do this with the permission of your systems administrator and
568 if you are already behind a separate firewall.</para>
569 </step>
570 </procedure>
571 <note><title>NOTE</title>
572 <para>Under Red Hat 7 you must address files by absolute pathnames, for example: <filename>
573 /tftpboot/boot.img</filename> not <filename>/boot.img</filename>, as you may have done with
574 other implementations.
575 On systems newer than Red Hat 7 (7.1 and beyond), filenames are once again relative to the
576 <filename>/tftpboot</filename> directory.
577 </para>
578 </note>
579 </sect3>
580 <sect3>
581 <title>Enable BOOTP/DHCP server on Red Hat Linux</title>
582 <para><indexterm><primary>DHCP</primary><secondary>enabling on Red Hat Linux
583 </secondary></indexterm><indexterm><primary>BOOTP</primary><secondary>
584 enabling on Red Hat Linux</secondary></indexterm>First, ensure that you have
585 the proper package, <computeroutput>dhcp</computeroutput> (not <computeroutput>
586 dhcpd</computeroutput>) installed. The DHCP server provides Dynamic Host Configuration,
587 that is, IP address and other data to hosts on a network. It does this in
588 different ways. Next, there can be a fixed relationship between a certain
589 node and the data, based on that node&rsquo;s unique Ethernet Station Address
590 (ESA, sometimes called a MAC address). The other possibility is simply to
591 assign addresses that are free. The sample DHCP configuration file shown does
592 both. Refer to the DHCP documentation for more details.</para>
593 <example><title>Sample DHCP configuration file</title>
594 <programlisting>--------------- /etc/dhcpd.conf -----------------------------
595 default-lease-time 600;
596 max-lease-time 7200;
597 option subnet-mask 255.255.255.0;
598 option broadcast-address 192.168.1.255;
599 option domain-name-servers 198.41.0.4, 128.9.0.107;
600 option domain-name &ldquo;bogus.com&rdquo;;
601 allow bootp;
602 shared-network BOGUS {
603 subnet 192.168.1.0 netmask 255.255.255.0 {
604          option routers 192.168.1.101;
605          range 192.168.1.1 192.168.1.254;
606 }
607  }
608 host mbx {
609          hardware ethernet 08:00:3E:28:79:B8;
610          fixed-address 192.168.1.20;
611          filename &ldquo;/tftpboot/192.168.1.21/zImage&rdquo;;
612          default-lease-time -1;
613          server-name &ldquo;srvr.bugus.com&rdquo;;
614          server-identifier 192.168.1.101;
615          option host-name &ldquo;mbx&rdquo;;
616 } </programlisting></example>
617 <para>Once the DHCP package has been installed and the configuration file
618 set up, type:<screen>
619 # <userinput>service dhcpd start</userinput></screen></para>
620 </sect3>
621 <sect3>
622 <title>Enable DNS server on Red Hat Linux</title>
623 <para><indexterm><primary>DNS</primary><secondary>enabling on Red Hat
624 Linux</secondary></indexterm>First, ensure that you have the proper
625 RPM package, <computeroutput>caching-nameserver</computeroutput>
626 installed. Then change the configuration
627 (in <filename>/etc/named.conf</filename>) so that the
628 <computeroutput>forwarders</computeroutput> point to the primary
629 nameservers for your machine, normally using the nameservers listed in
630 <filename>/etc/resolv.conf</filename>.</para>
631
632 <example><title>
633 Sample <filename>/etc/named.conf</filename> for Red Hat Linux 7.x
634 </title>
635
636 <programlisting>--------------- /etc/named.conf -----------------------------
637 // generated by named-bootconf.pl
638
639 options {
640         directory "/var/named";
641         /*
642          * If there is a firewall between you and nameservers you want
643          * to talk to, you might need to uncomment the query-source
644          * directive below.  Previous versions of BIND always asked
645          * questions using port 53, but BIND 8.1 uses an unprivileged
646          * port by default.
647          */
648         // query-source address * port 53;
649
650
651         forward first;
652         forwarders {
653                 212.242.40.3;
654                 212.242.40.51;
655         };
656 };
657
658 //
659 // a caching only nameserver config
660 //
661 // Uncomment the following for Red Hat Linux 7.2 or above:
662 // controls {
663 //         inet 127.0.0.1 allow { localhost; } keys { rndckey; };
664 // };
665 // include "/etc/rndc.key";
666 zone "." IN {
667         type hint;
668         file "named.ca";
669 };
670
671 zone "localhost" IN {
672         type master;
673         file "localhost.zone";
674         allow-update { none; };
675 };
676
677 zone "0.0.127.in-addr.arpa" IN {
678         type master;
679         file "named.local";
680         allow-update { none; };
681 };
682
683 </programlisting></example>
684
685 <para>Make sure the server is started with the command:
686 <screen># <userinput>service named start</userinput></screen> and is
687 started on next reboot with the command
688 <screen># <userinput>chkconfig named on</userinput></screen>
689 Finally, you may wish to change
690 <filename>/etc/resolv.conf</filename> to use
691 <computeroutput>127.0.0.1</computeroutput> as the nameserver for your
692 local machine.</para>
693 </sect3>
694 <sect3>
695 <title>RedBoot network gateway</title>
696 <para><indexterm><primary>RedBoot network gateway</primary></indexterm><indexterm>
697 <primary>network gateway</primary></indexterm>RedBoot cannot communicate with
698 machines on different subnets because it does not support routing. It always
699 assumes that it can get to an address directly, therefore it always tries
700 to ARP and then send packets directly to that unit. This means that whatever
701 it talks to must be on the same subnet. If you need to talk to a host on a
702 different subnet (even if it's on the same &lsquo;wire&rsquo;), you need to
703 go through an ARP proxy, providing that there is a Linux box connected to
704 the network which is able to route to the TFTP server. For example: <filename>
705 /proc/sys/net/ipv4/conf/<replaceable>&lt;interface></replaceable>/proxy_arp </filename>where <replaceable>
706 &lt;interface></replaceable>should be replaced with whichever network interface
707 is directly connected to the board.</para>
708 </sect3></sect2>
709 <sect2>
710 <title>Verification</title>
711 <para><indexterm><primary>verification (network)</primary></indexterm><indexterm>
712 <primary>network verification</primary></indexterm>Once your network setup
713 has been configured, perform simple verification tests as follows: <itemizedlist>
714 <listitem><para>Reboot your system, to enable the setup, and then try to &lsquo;ping&rsquo;
715 the target board from a host.</para>
716 </listitem>
717 <listitem><para>Once communication has been established, try to ping
718 a host using the RedBoot ping command - both by IP address and hostname.</para>
719 </listitem>
720 <listitem><para>Try using the RedBoot load command to download a file
721 from a host.</para>
722 </listitem>
723 </itemizedlist></para>
724 </sect2></sect1></chapter>
725
726 <!-- Commands -->
727 <!-- &redboot-current-doc-redboot-cmds-sgml; -->
728
729 <!-- Rebuilding -->
730 <!-- &redboot-current-doc-redboot-rebuilding-sgml; -->
731
732 <!-- Installing and testing -->
733 <!-- &redboot-current-doc-redboot-installing-sgml; -->
734
735 <!-- Epilogue -->
736 <!-- &redboot-current-doc-redboot-epilogue-sgml; -->