4.4   Creating a Bootable Application

A bootable application is completely initialized and functional after a target has been booted, without requiring interaction with Tornado development tools.

Once you have created and tested a downloadable application and a customized version of VxWorks with which your application is designed to run, creating a bootable application is straightforward. To do so, you need to add application modules to a VxWorks project, and include application startup calls in the VxWorks system initialization routines. There are various ways to go about this, but if you have already created one or more projects for application code and a project for a custom VxWorks, you could simply:

For information about developing applications with the project facility, see 4.2 Creating a Downloadable Application. For information about configuring and building VxWorks, see 4.3 Creating a Custom VxWorks Image. For information about additional build options, see 4.5 Working With Build Specifications.

4.4.1   Using Automated Scaling of VxWorks

The auto scale feature of the project facility determines if your code, or your custom version of VxWorks, requires any components that are not included in your VxWorks project, and adds them as required. It also provides information about components that may not be required for your application. To automatically scale VxWorks, select Auto Scale from the context menu in the VxWorks view of the workspace window to display the Auto Scale dialog box, and click OK.


*

NOTE: The auto scale feature detects only statically calculable dependencies between the application code and VxWorks. Some components may be needed even if they are not called by your application. This is especially true for servers such as WDB, NFS, and so on.

4.4.2   Adding Application Initialization Routines

When VxWorks boots, it initializes operating system components (as needed), and then passes control to the user's application for initialization. To add application initialization calls to VxWorks, double-click on userAppInit.c to open the file for editing, and add the call(s) to usrAppInit( ). Figure 4-33, for example, illustrates the addition of a call to runItAll( ), the main routine in the application file helloWorld.c.