📄 c-booting3.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title> Booting over the Network </title></head><body bgcolor="FFFFFF"><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="c-booting.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="c-booting.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-booting2.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-booting4.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p><font face="Helvetica, sans-serif" class="sans"><h3 class="H2"><i><a name="86619">13.3 Setting the VxWorks Boot Parameters</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="86621"> </a>To set boot parameter values, you can enter the parameter values manually at boot time, or you can set various <b class="symbol_lc">#define</b>s to create a default boot line. You also have the option of using either a DHCP or BOOTP client to retrieve certain parameters (such as IP address, boot file name, and so on) from a remote server. </p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="84655">13.3.1 Supplying Boot Parameters Using <b class="symbol_lc">#define</b> Values </a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84658"> </a>The default boot line is specified during configuration. The relevant configuration macro is <b class="symbol_UC">DEFAULT_BOOT_LINE</b>. A valid setting looks like:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84659">"ei(0,0)host:/vw/config/mv166/vxWorks h=90.0.0.3 e=90.0.0.50 u=target"</a></b></pre></dl><dd><p class="Body"><a name="84660"> </a>When control passes to the run-time VxWorks image, VxWorks parses the boot line at the known memory location and loads the values into a <b class="symbol_UC">BOOT_PARAMS</b> structure and checks for missing boot parameters. At this point, if you booted using TFTP, the only parameters that could be missing are: <b class="symbol_lc">hostName</b>, <b class="symbol_lc">targetName</b>, <b class="symbol_lc">usr</b>, <b class="symbol_lc">passwd</b>, <b class="symbol_lc">startupScript</b>, and <b class="symbol_lc">other</b>. Otherwise, the boot would have failed.<sup><a href="#foot"><b class="FootnoteMarker">1</b></a></sup></p><dd><p class="Body"><a name="84664"> </a>However, these parameters can be useful to the run-time image even if they were not essential to the boot program. Therefore, it is possible to include values for these parameters in the run-time VxWorks image. To do this, reconfigure VxWorks. For more information on configuring VxWorks, see the <i class="title">Tornado User's Guide: Projects</i>. The relevant configuration macros are the following:</p></dl><dl class="margin"><dd><div class="Item"><a name="85308"> </a><b class="symbol_UC">HOST_NAME_DEFAULT</b> </div><dl class="margin"><dd><div class="Indent"><a name="84674"> </a>Supplies a <b class="symbol_lc">hostName</b> value, the name of the system that supplied the boot file, <b class="symbol_lc">bootFile</b>. This name is added to the target's host table to provide a convenient label for the host machine at the IP address, <b class="symbol_lc">had</b>. The <b class="symbol_lc">hostName</b> is added to the host and route tables. At startup, the run-time VxWorks image creates a <b class="symbol_lc">netDrv</b> device named "<i class="textVariable">hostName</i>:". </div><br></dl><dd><div class="Item"><a name="84676"> </a><b class="symbol_UC">TARGET_NAME_DEFAULT</b> </div><dl class="margin"><dd><div class="Indent"><a name="84677"> </a>Supplies a <b class="symbol_lc">targetName </b>value, the name of the target. This name is added to the target's host table to provide a convenient label for the target's IP address, <b class="symbol_lc">had</b>.</div><br></dl><dd><div class="Item"><a name="84679"> </a><b class="symbol_UC">HOST_USER_DEFAULT</b> </div><dl class="margin"><dd><div class="Indent"><a name="84680"> </a>Supplies a <b class="symbol_lc">usr</b> value, the login name that this target's <b class="symbol_lc">netDrv</b> device should use. </div><br></dl><dd><div class="Item"><a name="84682"> </a><b class="symbol_UC">HOST_PASSWORD_DEFAULT</b> </div><dl class="margin"><dd><div class="Indent"><a name="84683"> </a>Supplies a <b class="symbol_lc">passwd</b> value, the password (if any), to use. If there is a non-empty <b class="symbol_lc">passwd</b>, this has configuration consequences for <b class="symbol_lc">netDrv</b> as well as for remote login from the VxWorks target to a remote system. A password here tells <b class="symbol_lc">netDrv</b> device, "<i class="textVariable">hostName</i>:",<sup><a href="#foot"><b class="FootnoteMarker">2</b></a></sup> to use FTP for remote file access. Otherwise, it uses RSH. </div><br></dl><dd><div class="Item"><a name="84688"> </a><b class="symbol_UC">SCRIPT_DEFAULT</b> </div><dl class="margin"><dd><div class="Indent"><a name="84689"> </a>Supplies a value for <b class="symbol_lc">startupScript</b>, the startup script for the VxWorks target-based shell (if any). You can use this script to do things such as redirect output. </div><br></dl><dd><div class="Item"><a name="84691"> </a><b class="symbol_UC">OTHER_DEFAULT</b> </div><dl class="margin"><dd><div class="Indent"><a name="84692"> </a>Supplies an <b class="symbol_lc">other </b>value. If the booted VxWorks image must access a local SCSI disk, you can use the <b class="symbol_lc">other</b> parameter to specify which network interface to attach. </div><br></dl></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="84694">13.3.2 Supplying Boot Parameters Manually </a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84696"> </a>If you supply a boot line manually, its values take precedence over parameters specified by any other source (except those few parameters retrieved by DHCP or BOOTP). To check the values of all currently set boot parameters, type <b class="command">p </b>at the VxWorks prompt. This command lists all currently set boot parameters and their values. For example:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84697"></b><tt class="output">[VxWorks Boot]: </tt><b>p </b><tt class="output">boot device : ln processor number : 0 flags (f) : 0xc0 unit number : 0</tt><b></a></b></pre></dl><dd><p class="Body"><a name="84698"> </a>Before you can boot the target from the network, you must enter appropriate values for <b class="symbol_lc">bootDev</b> (boot device), <b class="symbol_lc">procNum</b> (processor number), <b class="symbol_lc">flags</b>, and <b class="symbol_lc">unitNum</b> (unit number). The target can store these values in NVRAM (if available) and use them in subsequent boot sessions. </p><dd><p class="Body"><a name="84699"> </a>To change the boot device, processor number, flags value, or unit number, enter a <b class="command">c</b> at the boot prompt. This runs a script that prompts you for individual boot parameters. To bypass the script and enter the whole boot line all at once, enter a <b class="symbol_lc">$</b> followed by the boot line. </p><dd><p class="Body"><a name="85584"> </a>If you intend to use a DHCP or BOOTP message to supply additional parameters, make sure that you specify a <b class="symbol_lc">flags</b> value that sets the 0x40 bit (the dynamic configuration bit). Although this setting is the same for both DHCP and BOOTP, the VxWorks startup code automatically uses DHCP if available. If DHCP is unavailable, the startup code uses BOOTP. Typically, the boot image contains either a DHCP or BOOTP client and not both. However, if, for some reason, you have included both clients in the boot image, the BOOTP client is ignored and the boot image is larger than it need be. </p><dd><p class="Body"><a name="85585"> </a>To make a DHCP or BOOTP client available at boot time, you must construct boot ROMs that contain the client code. </p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="84703">13.3.3 Supplying Boot Parameters from a DHCP or BOOTP Server</a></i></h4></font><dl class="margin"><dl class="margin">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -