Extending xdc.runtime System

From RTSC-Pedia

Jump to: navigation, search
revision tip
—— LANDSCAPE orientation
[printable version]  [offline version]offline version generated on 24-Feb-2019 01:02 UTC 

Extending xdc.runtime System

How to create customized System support service providers

Contents

Introduction

The xdc.runtime package contains two modules, Startup and System, that work together to provide a rich but portable foundation for bootstrapping an application, getting basic output, and cleanly shutting down. These modules form the basis for early application "bring up", and remain embedded within deployed systems to provide "fail-safe" mechanisms for diagnosing problems in higher software layers.

The System module provides both character output and basic system shutdown support. In order to enable embedding within virtually any execution environment, the System module relies on an underlying "support module" that implements the ISystemSupport interface. In the following sections we focus on how to use and create modules that implement the ISystemSupport interface.

Overview

The System module provides a platform independent interface that provides both character output and simple application termination services. The System module encapsulates the lowest level services necessary for the simplest applications. Many other modules in the xdc.runtime package build atop these services and, as a result, porting xdc.runtime to new environments really amounts to porting the System module to these environments. By restricting their external references to the services provided by the System module, xdc.runtime modules can be reused in virtually any execution environment: embedded Linux device drivers, SYS/BIOS applications, Windows applications, etc.

Porting System to a new environment requires no change to the System module's sources. To support a new environment, you must either configure one of the existing "back end" modules that implements the ISystemSupport interface (SysMin or SysStd) or create a new such module.

Architecture

The System module is designed to provide basic services while minimizing external dependencies. However, some of the services provided, such as character output, ultimately require platform specific support. To enable developers to adapt System to their platform without modifying anything in the xdc.runtime package, the System module requires that the end-user specify a module that implements the ISystemSupport interface as the "proxy" for the required platform or application-specific services.

The relationship between the System module and an ISystemSupport proxy is illustrated in the figure below.

ISystemProvider Architecture

Configuration

The only configuration parameter related to extending the System module is System.SupportProxy. If this parameter is not set by the system integrator, it defaults to the SysMin module. The effect of setting this parameter is to "bind" an alternative ISystemProvider module to System; i.e., every time System needs to calls a function specified by ISystemProvider, it will invoke the functions implemented by the module "bound" by the system integrator to System.SupportProxy.

 
 
var SysStd= xdc.useModule("xdc.runtime.SysStd");
System.SupportProxy = SysStd;

Examples

In the table below, we list examples that illustrate the key requirements of system support providers.

Example Description Purpose
Example 1 Simple ISystemSupport module illustrate the ability to add custom system services

Related Topics

Using System Services

[printable version]  [offline version]offline version generated on 24-Feb-2019 01:02 UTC 
Copyright © 2008 The Eclipse Foundation. All Rights Reserved
Personal tools
package reference