![]() |
![]() |
![]() |
6.5 pSOSystem Source Projects
The pRISM+ Application Development Framework is application-centric, designed specifically for pSOSystem-based application development. To develop with pSOSystem, you must first understand pSOSystem and its structure, its contents, and its interface to the application code. This critical understanding of pSOSystem-based code can be accomplished with the aid of the powerful SNiFF+ source code browsers.
This section describes the pre-parsed pSOSystem source projects that are shipped with pRISM+, which you can browse to gain the key understanding of pSOSystem.
This section focuses on one particular kind of source projects; pSOSystem sample applications. These sample applications are perfect for studying the pSOSystem-to-application interface since they are also designed as starting points for users to begin development with pSOSystem.
NOTE: This integration sets the file attributes of the standard pSOSystem applications to read-only to prevent them from being changed by accident.
Refer to the SNiFF+ manuals for related concepts on source projects, how to create them and share them with team members. This section does not replace the SNiFF+ reference material on these subjects. While all the SNiFF+ features are available to pRISM+ users, this document describes the use of these features within pRISM+.
NOTE: There is a Tutorial available in the directory $SNIFF_DIR/integrations/pRISM2.0
.
6.5.1 File and Directory View of a pSOSystem Sample Application
pSOSystem sample applications are designed to serve as perfect starting points for developing a pSOSystem application. Some very simple applications, such as
hello
andpdemo
, can also be used by Board Support Package (BSP) developers to test the basic working condition of newly developed BSPs.Each sample application is designed to illustrate one aspect of pSOSystem, but all of them have some things in common. Each application is made up of the following:
Sample Application Code
Sample application code is the actual sample code that shows how to use certain pSOSystem features.
sys_conf.h
The
sys_conf.h
file is used to configure pSOSystem for your application. pSOSystem is a scalable operating system. In thesys_conf.h
file, you can simply sayYES
orNO
for each operating-system component to either include or exclude it from the application.For operating-system components to be included in an application, you can also use the
sys_conf.h
file to configure them. This file includes many other configurable settings, such as boot mode and I/O devices to include. This file is the key to configuring pSOSystem for your application.drv_conf.c
The
drv_conf.c
file is used to configure and initialize pSOSystem drivers based on information entered in thesys_conf.h
file. For each I/O device included bysys_conf.h
file, a setup routine is called in this file for the device.makefile
The makefile associated with each sample application is set up for building the sample application. Each makefile is a precise definition of files from pSOSystem needed to make a target executable for this application.
By invoking the make command using the pSOSystem makefile, you can build a target execution image from the following:
- files of sample application code
- operating system configuration code and start-up code from the directory
$PSS_ROOT/config/std
- an object library known as the Board Support Package,
libbsp.a
, located in the$PSS_BSP
directory.BSP
libbsp.a
also contains high-level driver code located in$PSS_ROOT/drivers
and device code located in directory$PSS_ROOT/bsps/devices
- an object library,
libsys.a
, which contains all the operating-system components in the$PSS_ROOT/sys/os
directory- other object libraries required by sample applications in directory
$PSS_ROOT/sys/libc
- any other libraries an application might need
NOTE: The $PSS_ROOT
points to the location of pSOSystem, and$PSS_BSP
identifies one of the Board Support Packages in the$PSS_ROOT/bsps
directory.
6.5.2 pSOSystem Projects
In pRISM+, pSOSystem comes as a set of pre-parsed shared source projects. These source projects are provided so you can get a quick start without having to learn all about SNiFF+ right away. They are pre-parsed so they can be browsed immediately for code comprehension. Most importantly, the sample application projects can serve as starting points for development.
Other projects such as BSP projects and driver projects can be integrated with your code as subprojects in much the same way as they are used as subprojects for pSOSystem sample application projects.
This section looks closely at these pSOSystem source projects and how they are used.
Types of pSOSystem Projects
Pre-parsed pSOSystem projects can be categorized into the following groups:
General pSOSystem Projects
pSOSystem Libraries Source Projects
sysclass.shared
Project for C++ pSOS class library source files in $PSS_ROOT/sys/libc/src/sysclass
directory.
pSOSystem Drivers Project
NOTE: This list may vary depending on the version of pRISM+.
driver_name_drv.shared
Project for pSOSystem drivers in $PSS_ROOT/drivers/
directory.
Board Support Package (BSP)
Sample Application Projects
<app_name>.shared
Project for pSOSystem sample application in $PSS_ROOT/apps/<app_name>
directory.
For a complete list of all the source projects that are available in pSOSystem, refer to Appendix E.
Sample Application Projects
We have established that in order to build a target executable for a sample application, we also need many other parts of pSOSystem. In SNiFF+ terminology, the project for which the executable target is defined is the super-project. Other projects that are needed for building the executable target in the super-project are its subprojects.
In the case of a pSOSystem sample application project, it is the super-project. It includes things such as a Board Support Package and operating system components as subprojects.
A typical pSOSystem application is made up of the following:
- a sample application (super-project).
include.shared
(added as a subproject to the sample application super-project).sys_os.shared
(added as a subproject to the sample application super-project).configs_std.shared
(as a subproject to the sample application super-project).bsp_src.shared
(subproject to the sample application super-project). Each bsp_src.shared also includes as its subprojects all the devices projects that are relevant for this BSP.bsp.shared
(subproject to the sample application super-project).- any other projects from the
$PSS_ROOT/drivers
directory, added as subproject(s), if referred by the application- any other projects from the
$PSS_ROOT/sys/libc/src
directory, added as subproject(s), if referred by the applicationFigure 6-11 on page 6-31 shows the
pdemo.shared
example used throughout this chapter. Note the project and subproject relationship that exists betweenpdemo.shared
and its subprojects.
FIGURE 6-11 Private View of a Shared ProjectpSOSystem as Source Project
For your development, the pSOSystem sample application is analogous to the software you are developing. The Board Support Package is analogous to the drivers you are developing for your custom hardware. All the other pieces in pSOSystem such as the operating systems components and configuration code are additional supporting software for your application. They can be thought of as pre-made, ready-to-use supporting subprojects for your application project.
Converting Your Application to a pSOSystem Application Project
As we will show you in the tutorial, pRISMSpace Wizard can help you turn your existing code base into a shared source project. When this source project is made, it is automatically converted to a pSOSystem Application. So the pSOSystem subprojects are appended to your project. Depending on the type of application you have, you may need to adjust the subproject list slightly.
Figure 6-12 on page 6-32 shows an example of a source project made by pRISM+ out of an existing code base prior to automatically Converting to pSOSystem App Proj.
FIGURE 6-12 Source Project without pSOSystem ProjectsIn Figure 6-13 on page 6-33, you can see the results of the automatically Converted to pSOSystem App Proj of your project.
FIGURE 6-13 Source Project containing pSOSystem ProjectsAs you can see in Figure 6-13, the conversion made a pSOSystem superproject
pss_main.shared
and added your code as a subproject. It also added other pSOSystem subprojects to thepss_main.shared
superproject.Depending on what kind of application you are developing, the default pSOSystem projects added by the conversion might not be sufficient. Refer to Appendix E for other source projects your application might also need.
pss_main.shared Project
pss_main.shared
is the top-most pSOSystem super project which integrates your code base with pSOSystem code.pss_main.shared
contains the set of three files that are essential to every pSOSystem application:sys_conf.h
,drv_conf.c
and a pSOSystem makefile.The
sys_conf.h
anddrv_conf.c
files used inpss_main.shared
are generic template files. They are sufficient for a simple application such as thepdemo
sample application but they might not entirely fulfill your application requirements.Compare the
sys_conf.h
anddrv_conf.c
files in a pSOSystem sample application that closely resembles the type of application you are developing with the template files. If there are differences, you can either import the changes needed by yourself or simply copysys_conf.h
anddrv_conf.c
from the pSOSystem sample application that most closely resembles the type of application you are developing.If your application code already contains
sys_conf.h
anddrv_conf.c
, your working version should replace the template version.To see the role that
pss_main.shared
plays in the build stage, refer to Section 6.6.8 Hybrid Make Model on page 6-46.6.5.3 Browse View Versus Build View of pSOSystem Source Projects
pSOSystem is make-centric. Each pSOSystem sample application is defined by the makefile used to build that application. Each pSOSystem application is defined by a set of makefiles, each requiring a different set of files from the same pSOSystem directory structure. Depending on the kind of application, the makefile explicitly includes other makefiles from other parts of pSOSystem to pull in all the other files necessary to build the application.
In order to present an accurate browse view for pRISM+ users, each pSOSystem sample application project is specially constructed based on a unique file list as defined by each sample application's makefile. There are, however, several exceptions where the browse view contains more files than what's actually used to make a target.
The following table shows the level of accuracy of the "browse view" of pSOSystem sample applications projects compared to the "build view" of the same projects as defined by pSOSystem makefiles.
The slight deviation in the file list does not affect the building of an executable because the pSOSystem makefiles ultimately decide which files are included in the build.
The slight deviation in file lists does affect accuracy in browsing. You can make adjustments to the project file list by simply adding or removing files, or subprojects, from the projects. For example, the
beginapp.s
can be removed from theconfigs_std.shared
if you are not going to build theapp.elf
target, and consequently will not need to browsebeginapp.s
with the application.Refer to the pSOSystem makefiles for a complete file list for each target. Use this as your guide to adjusting the file list for browsing.
6.5.4 Browsing pSOSystem
Browsing pSOSystem with SNiFF+
Refer to the SNiFF+ User's Guide for instructions on how to use SNiFF+ browsers.
Browsing pSOSystem with Preprocessing Enabled
pSOSystem code makes heavy use of preprocessing macros. Refer to the SNiFF+ User's Guide for information on how to enable preprocessing for browsing.
6.5.5 Utilities Programs
pSOSystem source projects were created using some utility programs in the form of Bourne shell scripts. These scripts are included in pRISM+ so you can use them to create source projects for your existing code base. These scripts are located in
$PSS_ROOT/bin/source/plugins/scripts
directory (This location is included in the search path for executables ). Functional descriptions of these scripts are included in the script source and in Appendix E.It is recommended that you follow the steps in Using the pRISM+ Application Development Framework with SNiFF+ on page 6-50 to create and work with projects until you are familiar with SNiFF+.
![]() |
![]() |
![]() |