Runtime Integration: Difference between revisions

From STRIDE Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 27: Line 27:
Fully tested PALs are provided for Linux and Windows, included as <tt>palIO.c</tt> and <tt>palOS.c</tt> in their respective SDKs. Other PALs are also available or under development. Please contact S2 for availability.
Fully tested PALs are provided for Linux and Windows, included as <tt>palIO.c</tt> and <tt>palOS.c</tt> in their respective SDKs. Other PALs are also available or under development. Please contact S2 for availability.


== Configuring the PAL ==
== Configuring I/O parameters ==
Refer to the [[Platform Abstraction Layer|Platform Abstraction Layer]] page and the [[Media:s2sPAL.pdf|PAL Specification]] document for a more detailed description of the PAL and its interfaces.
If your target will communicate with the host computer via the default of TCP/IP port 8000, you can skip this step.
[[Platform Abstraction Layer|PAL details]]


<tt>[[palcfg.h]]</tt>
Otherwise, refer to <tt>[[palcfg.h]]</tt> for a list of configuration parameters.


For complete information, refer to the [[Platform Abstraction Layer|Platform Abstraction Layer]] page and the [[Media:s2sPAL.pdf|PAL Specification]] document.


== Building the STRIDE Runtime Library ==
== Including the STRIDE Runtime Sources ==
The STRIDE runtime sources are distributed in source form. The source files are available as a stand-alone package and are also included with each flavor of SDK package.


=== Source Files ===
The runtime sources are supplied in three directories:
;GRS
: [[GRS|Generic RTOS Services]]
;Runtime
: [[Runtime Reference|STRIDE runtime]]
;SLAP
: [[SLAP|Simplified Link-layer Application Protocol]]
 
If you are using an S2-supplied PAL, files in each of these directories should be included in your target build.
 
If you are using an S2-supplied PAL, additional required sources can be found in the SDK's <tt>src</tt> directory:
 
* PAL implementation
** palcfg.h
** palIO.c
** palOS.c
 
* Convenience functions (these wrap low-level STRIDE runtime calls)
** stride.c
** stride.h
 
The SDKs inlclude the runtime sources by building them into a library that is then linked with the target application.


== Target Source Changes ==
== Target Source Changes ==

Revision as of 23:17, 4 June 2009

Overview

This page discuses how to incorporate the STRIDE runtime in your target application build.

Recommendations

The STRIDE target environment offers lots of flexibility to accommodate different target scenarios. For an initial target integration, we recommend that you pursue the simplest STRIDE configuration that will yield results. Once this configuration is successfully integrated you can make adjustments as desired.

Here are a few specific recommendations:

STRIDE runtime library
Build and link with the static STRIDE runtime library (libstride.a or stride.lib)
STRIDE I/O
Build and use the single process configuration instead of building and employing the STRIDE daemon

Integrating STRIDE Into Your Target Build

To add the STRIDE runtime to your build process, the following changes must be made:

  • Secure a PAL targeted to your target operating system
  • Configure the PAL I/O parameters to conform the your target hardware
  • Edit your target application's source code to start the runtime's I/O thread
  • Add steps to your target build process to include the STRIDE runtime source files

Securing a PAL

The Platform Abstraction Layer (PAL) provides the glue between the STRIDE runtime and services offered by your OS. It is the only piece of the runtime that is customized between operating systems.

Fully tested PALs are provided for Linux and Windows, included as palIO.c and palOS.c in their respective SDKs. Other PALs are also available or under development. Please contact S2 for availability.

Configuring I/O parameters

If your target will communicate with the host computer via the default of TCP/IP port 8000, you can skip this step.

Otherwise, refer to palcfg.h for a list of configuration parameters.

For complete information, refer to the Platform Abstraction Layer page and the PAL Specification document.

Including the STRIDE Runtime Sources

The STRIDE runtime sources are distributed in source form. The source files are available as a stand-alone package and are also included with each flavor of SDK package.

The runtime sources are supplied in three directories:

GRS
Generic RTOS Services
Runtime
STRIDE runtime
SLAP
Simplified Link-layer Application Protocol

If you are using an S2-supplied PAL, files in each of these directories should be included in your target build.

If you are using an S2-supplied PAL, additional required sources can be found in the SDK's src directory:

  • PAL implementation
    • palcfg.h
    • palIO.c
    • palOS.c
  • Convenience functions (these wrap low-level STRIDE runtime calls)
    • stride.c
    • stride.h

The SDKs inlclude the runtime sources by building them into a library that is then linked with the target application.

Target Source Changes

  • Runtime Package
  • STRIDE thread initialization

<source lang="c">

  1. include <stdlib.h>
  2. include <unistd.h>

/* STRIDE runtime includes */

  1. include <stride.h>

Example startup code: <source lang="c"> int main(int argc, char **argv) {

  ...

/* initialize the STRIDE subsytem using default I/O */

  strideIO_t io = {strideIO_t::strideDEFAULT};
  if (strideInit(&io) != srTRUE)
      return -1;
  }
  ...

/* this call blocks until a SIGTERM is received, omit if not needed */

  strideExWaitForExit();

/* terminate all STRIDE threads and uninitialize STRIDE subsystem */

  strideUninit();
  return 0;   
}
    • Single process
    • Multiprocess


Testing the Runtime Integration