Runtime Integration
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 the PAL
palcfg.h
Building the STRIDE Runtime Library
Source Files
Target Source Changes
- Runtime Package
- STRIDE thread initialization
<source lang="c">
- include <stdlib.h>
- include <unistd.h>
/* STRIDE runtime includes */
- 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