📄 c-builder3.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title> Projects </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="c-builder.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-builder2.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-builder4.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="90407">4.3 Creating a Custom VxWorks Image</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="98886"> </a>The Tornado distribution includes a VxWorks system image for each target shipped. The <i class="term">system image</i> is a binary module that can be booted and run on a target system. The system image consists of all desired system object modules linked together into a single non-relocateable object module with no unresolved external references. In most cases, you will find the supplied system image adequate for initial development. However, later in the cycle you may want to create a custom VxWorks image.</p><dd><p class="Body"><a name="98883"> </a>VxWorks is a flexible, scalable operating system with numerous facilities that can be tuned, and included or excluded, depending on the requirements of your application and the stage of the development cycle. For example, various networking and file system components may be required for one application and not another, and the project facility provides a simple means for either including them in, or excluding them from, a VxWorks application. In addition, it may be useful to build VxWorks with various target tools during development (such as the target-resident shell), and then exclude them from the production application.</p><dd><p class="Body"><a name="90465"> </a>Once you create a customized VxWorks, you can boot your target with it and then download and run applications. You can also create a bootable application simply by linking your application to VxWorks and adding application startup calls to the VxWorks system initialization routines (see <a href="c-builder4.html#89245"><i class="title">4.4 Creating a Bootable Application</i></a>). </p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="90498">4.3.1 Creating a Project for VxWorks</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="95660"> </a>All work that you do with the project facility, whether a downloadable application, a customized version of VxWorks, or a bootable application, takes place in the context of a project. </p><dd><p class="Body"><a name="103474"> </a>If the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Create Project </font></b>window is open (the default when you first start Tornado<sup><a href="#foot"><b class="FootnoteMarker">1</b></a></sup>), click the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">New</font></b> tab. Otherwise, click <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">File</font></b>><b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">New Project</font></b>. Then choose the selection for a bootable application, and click <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">OK </font></b>(<a href="c-builder3.html#100543">Figure 4-17</a>)<div class="frame"><h4 class="EntityTitle"><a name="100543"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure 4-17: Create Bootable Application</font></a></h4><dl class="margin"><div class="CellBody"><a name="100548"> </a><img class="figure" border="0" src="images/c-builder51.gif"></div></dl></div>. </p><dd><p class="Body"><a name="105620"> </a>The application wizard appears (<a href="c-builder3.html#105628">Figure 4-18</a>). This wizard is a tool that guides you through the steps of creating a new project. </p><dd><p class="Body"><a name="105621"> </a>First, enter the full directory path and name of the directory you want to use for the project (only one project is allowed in a directory), and enter the project name. It is usually most convenient to use the same name for the directory and project, but it is not required. </p></dl></dl><dl class="margin"><dd><p class="table" callout><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td valign="top" width="40"><br><img border="0" alt="*" src="icons/note.gif"></td><td><hr><div class="CalloutCell"><a name="105582"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">NOTE: </font></b></a>You may create your projects anywhere on your file system. However, it is preferable to create them outside of the Tornado directory tree to simplify the process of future Tornado upgrades.</div></td></tr><tr valign="top"><td></td><td><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p callout><dl class="margin"><dd><p class="Body"><a name="105591"> </a>You may also enter a description of the project, which will later appear in the property sheet for the project. Finally, identify the workspace in which the project should be created. Click <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Next</font></b> to continue.<div class="frame"><h4 class="EntityTitle"><a name="105628"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure 4-18: Application Wizard: Step One for Bootable Application</font></a></h4><dl class="margin"><div class="CellBody"><a name="105633"> </a><img class="figure" border="0" src="images/c-buildera38.gif"></div></dl></div> </p><dd><p class="Body"><a name="103041"> </a>Then you identify the BSP with which you will build the project. You can do so by referring to an existing project, or by identifying a BSP that you have installed. </p></dl><dd><p class="table" callout><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td valign="top" width="40"><br><img border="0" alt="*" src="icons/note.gif"></td><td><hr><div class="CalloutCell"><a name="105962"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">NOTE: </font></b></a>If you are creating a customized VxWorks image or a bootable application, the project will be generated faster if you base it on an existing project rather than a BSP. This is because the project facility does not have to regenerate configuration information from BSP configuration files. All Tornado 2.x BSPs include project files for this purpose. Options for BSP projects are available in the drop-down list for existing projects. For example, the mv162 BSP project file is: <br><b class="file"> <br> c:\tornado\target\proj\mv162_vx.wpj <br></b> <br>Projects can only be created from BSPs installed in the Tornado 2.x directory tree. If you want to use a BSP from an earlier version of Tornado (or any third-party BSP that is compliant with Wind River Systems coding conventions for BSPs), you must install it in the current tree before creating your project.</div></td></tr><tr valign="top"><td></td><td><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p callout><dl class="margin"><dd><p class="Body"><a name="103059"> </a>Basing a project on an existing one means that the new project will reference the <i class="emphasis">same</i> source files as the one on which it was based, but it will start with <i class="emphasis">copies</i> of the original project's VxWorks configuration and build specifications. The build specifications and VxWorks configuration for the new project can be modified without affecting the original project, but changes to any shared source files will be reflected in both. </p><dd><p class="Body"><a name="95700"> </a>For example, to create a project for a module that will run on a 486 PC target, select <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">An existing project </font></b>and then select <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">pc486_vx.wpj </font></b>from the drop-down list (<a href="c-builder3.html#95703">Figure 4-19</a>). Click <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Next</font></b>. <div class="frame"><h4 class="EntityTitle"><a name="95703"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure 4-19: Application Wizard: Step Two for Bootable Application</font></a></h4><dl class="margin"><div class="CellBody"><a name="95708"> </a><img class="figure" border="0" src="images/c-builder38.gif"></div></dl></div></p><dd><p class="Body"><a name="95726"> </a>The wizard confirms your selections (<a href="c-builder3.html#95720">Figure 4-20</a>). Click <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Finish</font></b>. <div class="frame"><h4 class="EntityTitle"><a name="95720"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure 4-20: Application Wizard: Step Three for Bootable Application</font></a></h4><dl class="margin"><div class="CellBody"><a name="95725"> </a><img class="figure" border="0" src="images/c-builder39.gif"></div></dl></div> </p><dd><p class="Body"><a name="95736"> </a>The <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Workspace</font></b> window appears.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="97280">4.3.2 Project Files for VxWorks </a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="97298"> </a>The project facility generates, or includes copies of, a variety of files for a VxWorks project. The names of the files that you may need to work with are displayed in the workspace <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">File</font></b> view (<a href="c-builder3.html#95730">Figure 4-21</a>). <div class="frame"><h4 class="EntityTitle"><a name="95730"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure 4-21: VxWorks Project Files</font></a></h4><dl class="margin"><div class="CellBody"><a name="95735"> </a><img class="figure" border="0" src="images/c-builder40.gif"></div></dl></div> </p></dl></dl><dl class="margin"><dd><p class="table" callout><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td valign="top" width="40"><br><img border="0" alt="*" src="icons/note.gif"></td><td><hr><div class="CalloutCell"><a name="102311"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">NOTE: </font></b></a>Context menus provide access to all commands that can be used with the objects displayed in, and the pages that make up, the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Workspace</font></b> window (use the right mouse button).</div></td></tr><tr valign="top"><td></td><td><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p callout><dl class="margin"><dd><p class="Body"><a name="105658"> </a>During typical use of the project facility you do not need to be concerned with these files, except to avoid accidental deletion, to check them in or out of a source management system, or to share your projects or workspaces with others. You will need to edit <b class="file">userAppInit.c</b>, however, when you create a bootable application (see <a href="c-builder4.html#89245"><i class="title">4.4 Creating a Bootable Application</i></a>). </p><dd><p class="Body"><a name="97337"> </a>The VxWorks project files serve the following purposes:</p></dl><dl class="margin"><dd><div class="Item"><a name="97338"> </a><b class="file">linkSyms.c</b></div><dl class="margin"><dd><div class="Indent"><a name="97339"> </a>A dynamically generated configuration file that includes code from the VxWorks archive by creating references to the appropriate symbols. It contains symbols for components that do not have initialization routines.</div><br></dl><dd><div class="Item"><a name="97391"> </a><b class="file">prjConfig.c</b></div><dl class="margin"><dd><div class="Indent"><a name="97392"> </a>A dynamically generated configuration file that contains initialization code for components included in the current configuration of VxWorks. </div><br></dl><dd><div class="Item"><a name="97398"> </a><b class="file">romInit.s</b></div><dl class="margin"><dd><div class="Indent"><a name="97399"> </a>Contains the entry code for the VxWorks boot ROM.</div><br></dl><dd><div class="Item"><a name="97405"> </a><b class="file">romStart.c</b></div><dl class="margin"><dd><div class="Indent"><a name="97406"> </a>Contains routines to load VxWorks system image into RAM.</div><br></dl><dd><div class="Item"><a name="97413"> </a><b class="file">sysALib.s</b></div><dl class="margin"><dd><div class="Indent"><a name="97414"> </a>Contains system startup code, the first code executed after booting (which is the entry point for VxWorks in RAM).</div><br></dl><dd><div class="Item"><a name="97423"> </a><b class="file">sysLib.c</b></div><dl class="margin"><dd><div class="Indent"><a name="97424"> </a>Contains board-specific routines.</div><br></dl><dd><div class="Item"><a name="97441"> </a><b class="file">userAppInit.c</b></div><dl class="margin"><dd><div class="Indent"><a name="97442"> </a>Contains a stub for adding user application initialization routines for a bootable application.</div><br></dl></dl><dl class="margin"><dd><p class="Body"><a name="97431"> </a>The following files are created in the main project directory as well, but are not visible in the workspace:</p></dl><dl class="margin"><dd><div class="Item"><a name="97340"> </a><b class="file">prjComps.h</b></div><dl class="margin">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -