⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 x-9602.html

📁 this about vxworks operations systems
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title>    Intel i960   </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="GuideIX.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="x-960.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="x-9601.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="x-9603.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="84382">C.2  &nbsp;&nbsp;Building Applications</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84383"> </a>The Tornado 2.0 project facility is correctly preconfigured for building WRS BSPs. However, if you choose not to use the project facility or if you need to customize your build, you may need the information in the following sections. This includes a configuration constant, an environment variable, and compiler options that together specify the information the GNU toolkit requires to compile correctly for i960 targets. </p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="84386">Defining the CPU Type</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84387"> </a>Setting the preprocessor variable <b class="symbol_UC">CPU</b> ensures that VxWorks and your applications build with the appropriate architecture-specific features enabled. Define this variable to one of the following values, to match the processor you are using:</p></dl><dl class="margin"><ul class="DashSingle" type="circle"><li><a name="84388"> </a><b class="symbol_UC">I960CA</b> </li></ul><ul class="DashSingle" type="circle"><li><a name="84389"> </a><b class="symbol_UC">I960JX</b> </li></ul><ul class="DashSingle" type="circle"><li><a name="84390"> </a><b class="symbol_UC">I960KA</b> </li></ul><ul class="DashSingle" type="circle"><li><a name="84391"> </a><b class="symbol_UC">I960KB</b> </li></ul></dl><dl class="margin"><dd><p class="Body"><a name="84392"> </a>For example, to define <b class="symbol_UC">CPU</b> for a i960CA on the compiler command line, specify the following command-line option when you invoke the compiler:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84393">-DCPU=I960CA</a></b></pre></dl><dd><p class="Body"><a name="84394"> </a>To provide the same information in a header or source file instead, include the following line in the file:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84395">#define CPU I960CA</a></b></pre></dl></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="84397">Configuring the GNU ToolKit Environment</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84398"> </a>Tornado includes the GNU compiler and associated tools. Tornado is configured to use these tools by default. No change is required to the execution path, because the compilation chain is installed in the same <b class="file">bin</b> directory as the other Tornado executables. </p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="84400">Compiling C or C++ Modules </a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84401"> </a>The following is an example of a compiler command line for i960 cross-development. The file to be compiled in this example has a base name of <b class="file">applic</b>.</p><dl class="margin"><dd><pre class="Code2"><b><a name="84402"></b><tt class="output">% </tt><b>cc960 -fno-builtin -I $WIND_BASE/target/h -0 -c -mca\ -mstrict-align -fvolatile -nostdinc -DCPU=I960CA applic.c</a></b></pre></dl><dd><p class="Body"><a name="84406"> </a>The options shown in the example have the following meanings:<sup><a href="#foot"><b class="FootnoteMarker">1</b></a></sup></p></dl><dl class="margin"><dd><div class="Item"><a name="84408"> </a><b class="command">-fno-builtin</b> </div><dl class="margin"><dd><div class="Indent"><a name="84409"> </a>Required; uses library calls even for common library subroutines.</div><br></dl><dd><div class="Item"><a name="84411"> </a><b class="command">-I $</b><b class="symbol_UC">WIND_BASE</b><b class="command">/target/h </b></div><dl class="margin"><dd><div class="Indent"><a name="84412"> </a>Required; includes VxWorks header files. (Additional <b class="command">-I</b> flags may be included to specify other header files.)</div><br></dl><dd><div class="Item"><a name="84414"> </a><b class="command">-O</b> </div><dl class="margin"><dd><div class="Indent"><a name="84415"> </a>Optional; performs standard optimization.</div><br></dl><dd><div class="Item"><a name="84417"> </a><b class="command">-c</b> </div><dl class="margin"><dd><div class="Indent"><a name="84418"> </a>Required; specifies that the module is to be compiled only, and not linked for execution under the host.</div><br></dl><dd><div class="Item"><a name="84420"> </a><b class="command">-mca</b> </div><dl class="margin"><dd><div class="Indent"><a name="84421"> </a>Required for i960CA and i960JX; specifies the instruction set. For the i960KA and KB, use <b class="command">-mka</b> and <b class="command">-mkb</b>, respectively.</div><br></dl><dd><div class="Item"><a name="84424"> </a><b class="command">-mstrict-align</b> </div><dl class="margin"><dd><div class="Indent"><a name="84425"> </a>Required; do not permit unaligned accesses.</div><br></dl><dd><div class="Item"><a name="84427"> </a><b class="command">-fvolatile</b> </div><dl class="margin"><dd><div class="Indent"><a name="84428"> </a>Required; consider all memory references through pointers to be volatile.</div><br></dl><dd><div class="Item"><a name="84430"> </a><b class="command">-nostdinc</b> </div><dl class="margin"><dd><div class="Indent"><a name="84431"> </a>Required; searches only the directory(ies) specified with the <b class="command">-I</b> flag (see above) and the current directory for header files. Does not search host-system include files.</div><br></dl><dd><div class="Item"><a name="84433"> </a><b class="symbol_UC">-DCPU=I960CA</b> </div><dl class="margin"><dd><div class="Indent"><a name="84434"> </a>Required; defines the CPU type. If you are using an i960 processor other than the CA, specify the appropriate value (see <a href="x-9602.html#84386"><i class="title">Defining the CPU Type</i></a>).</div><br></dl><dd><div class="Item"><a name="84439"> </a><b class="file">applic.</b><i class="textVariable">language_id </i></div><dl class="margin"><dd><div class="Indent"><a name="84440"> </a>Required; the file(s) to compile. For C compilation, specify a suffix of <b class="file">.c</b>. For C++ compilation, specify a suffix of <b class="file">.cpp</b>. The output is an unlinked object module in <b class="symbol_UC">COFF</b> format with the suffix <b class="file">.o</b>; for the example, the output is <b class="file">applic.o</b>.</div><br><dd><div class="Indent"><a name="84441"> </a>During C++ compilation, the compiled object module (<b class="file">applic.o</b>) is <i class="term">munched</i>. Munching is the process of scanning an object module for non-local static objects, and generating data structures that VxWorks run-time support can use to call the objects' constructors and destructors. For details, see the <i class="title">VxWorks Programmer's Guide: C++ Development</i>.<b></b></div><br></dl></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="85147">Boot Loader Changes</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85148"> </a>The target-resident loader for i960 targets loads <b class="symbol_UC">COFF</b> format VxWorks images which are composed of multiple text sections and multiple data sections. The ability to load <b class="symbol_UC">COFF</b> files with multiple text and data sections facilitates the use of linker scripts which scatter-load the VxWorks image at boot time. In addition, because the number of relocation entries for any particular <b class="symbol_UC">COFF</b> section may not exceed 65,535 entries, it may be necessary to split very large images into multiple sections. </p><dd><p class="Body"><a name="85157"> </a>It is assumed that users implementing linker scripts are comfortable with the GNU linker, the GNU linker command language, the particular OMF used by the GNU tools, and the target memory architecture. In addition to the aforementioned requisite background, the target-resident loader implementation places certain restrictions on how fully-linked <b class="symbol_UC">COFF</b> files (for example, a VxWorks image) are organized. </p><dd><p class="Body"><a name="85164"> </a>The target-resident loader assumes that a <b class="symbol_UC">COFF</b> format VxWorks image is ordered such that the <b class="symbol_UC">COFF</b> file header, optional header, and section headers are followed immediately by the section contents for text, data, or lit sections in the binary file. Moreover, it is assumed that the section contents are contiguous in the binary file. <a href="x-9602.html#85376">Figure&nbsp;C-1</a> shows typical headers in the binary file. <div class="frame"><h4 class="EntityTitle"><a name="85376"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure C-1:&nbsp;&nbsp;COFF File Headers </font></a></h4><dl class="margin"><div class="Anchor"><a name="85378"> </a><img class="figure" border="0" src="images/x-960a3.gif"></div></dl></div></p><dd><p class="Body"><a name="85181"> </a>The fact that text, data, and lit sections must be contiguous with each other and follow the section headers in the binary file does not preclude using a linker script to locate multiple text and data sections at non-contiguous RAM addresses. For more information on the GNU linker and GNU linker command language, see the <i class="title">GNU ToolKit User's Guide</i>.</p><dd><p class="Body"><a name="85187"> </a>The target-resident loader for i960 reports the sizes of individual text and data sections in addition to the bss section when VxWorks is booted. For example, if a multiple text section image is booted, output similar to the following might be seen:</p><dl class="margin"><dd><pre class="Code2"><b><a name="85193"></b><tt class="output">Attaching network interface oli0... done. Attaching network interface lo0... done. Loading... 277764 + 82348 + 66664 + 7948 + 29692 Starting at 0x1000...</tt><b> </a></b><dd> <b><a name="85198"></b><tt class="output">Attached TCP/IP interface to oli unit 0 Attaching network interface lo0... done. NFS client support not included.</tt><b> </a></b><dd> <b><a name="85203"></b><tt class="output">                VxWorks</tt><b> </a></b><dd> <b><a name="85205"></b><tt class="output">Copyright 1984-1998  Wind River Systems, Inc.</tt><b> </a></b><dd> <b><a name="85207"></b><tt class="output">            CPU: Cyclone EP960Cx         VxWorks: 5.4     BSP version: 1.2/0 &nbsp; Creation date: Feb 10 1999             WDB: Ready.</tt><b> </a></b></pre></dl><dd><p class="Body"><a name="85214"> </a>This format is a slight cosmetic modification to the section size values which WRS boot loaders have traditionally reported as <i class="textVariable">size of text</i> + <i class="textVariable">size of data</i> + <i class="textVariable">size of bss</i>. Reporting the size of individual text and data sections rather than summing them up is intended to be an aid for developers working on VxWorks images which are organized by way of a linker script. This change is not likely to be noticed when the default VxWorks image types are used.</p></dl></dl><a name="foot"><hr></a><p class="FootnoteNumberMarker">1:&nbsp;<span class="Footnote"><a name="84405"> </a>For more information on these and other compiler options, see the <i class="title">GNU ToolKit User's Guide</i>. WRS supports compiler options used in building WRS software; a list of these options is included in the <i class="title">Guide</i>. Other options are not supported, although they are available with the tools as shipped.</span><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="GuideIX.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="x-960.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="x-9601.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="x-9603.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p></body></html><!---by WRS Documentation (), Wind River Systems, Inc.    conversion tool:  Quadralay WebWorks Publisher 4.0.11    template:         CSS Template, Jan 1998 - Jefro --->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -