This document examines the 3rd-generation of the CLS' orbit control system, implementing so-called fast corrections on the order of 100 Hz. The 2nd-generation system is documented in, "SR1 Orbit Control Design Note - 5.2.39.4- Rev 0". That document should also be consulted, as its contents are still relevent, http://www.lightsource.ca/operations/pdf/5.2.39.4.Rev.0-SR1_Orbit_Control_Design_Note-Chabot.pdf.

Project Source Structure

The source code for this project has the following layout:

project-root/
            .hg/                # Mercurial repo. Contains complete history of project.
            docs/
            orbitcontroller/    # root of the base, RTEMS OrbitController application
                include/
                src/
                    hardware/
                    main/
                    states/
                    test/
                    utils/
            orbitcontrolUI/     # root of the EPICS-based user interface (UI)
                configure/
                iocBoot/
                orbitcontrolUIApp/
                    Db/
                    src/
                orbitcontrolUI.cmd # start-up script

Required Tools

  • RTEMS CVS development HEAD. The development HEAD is the RTEMS version that would be released as version 4.10. This branch contains the important addition to the i386-rtems architecture of PCI interrupt sharing. There are also other features available in RTEMS 4.9 and later revisions that are utilized in the orbit control software (eg: RTEMS thread barriers).

  • The cross-development toolchain associated with RTEMS CVS HEAD (Current at the time of last modifications to the project. These are now somewhat outdated):

    • binutils-2.19.1

    • gcc-4.3.3

    • newlib-1.17

    • gdb-6.8

Note
The toolchain components can be installed via YUM and RPM, see http://www.rtems.com/wiki/index.php/APT/Yum_Repository for more information. The tools may also be built from source. The tools' sources and patches are available from http://www.rtems.com/ftp/pub/rtems/SOURCES. Alternatively, a pre-built set of tools and RTEMS libraries is available (Dave Beauregard).
  • SIS1100/3100 RTEMS Driver

    • This is available in the MKS repository (repo).

  • SLAC RTEMS Tools

  • EPICS version 3.14.10. However this is not a strict requirement. The EPICS components of the system (source under orbitcontrolUI/) do not depend on any particular feature of EPICS Base found in versions later than 3.14.6. Having explained that, modifications to the build system of EPICS Base were necessary, thus the decision to use a developer-local copy of Base, thereby avoiding contamination of the standard CLS Base installation. The modifications are discussed below, and the simple patch to illicit the altered behavior from EPICS Base is available in Appendix [A].

    • Changes are required to orbitcontrolUI/configure/RELEASE. In particular, the value of EPICS_BASE will need to be modified to suit.

    • The call to osdTimeRegister(), in "orbitcontrolUI.cmd" was necessary for successful operation under Base 3.14.10. This call may be safely omitted if it is desired to use a version of Base < 3.14.10.

    • In order to coax EPICS' build system into generating "loadable modules" instead of statically-linked executables, modifications to that system are required. See patch in Appendix [A]. Specifically, a USE_GESYS Makefile variable was introduced to instruct EPICS' build system to produce either loadable modules or the traditional, statically-linked RTEMS exectuable image. From the root of the EPICS-based UI application (orbitcontrolUI), invoking Make as follows will produce a dynamically loadable module:

make USE_GESYS=YES
  • The Mercurial distributed version control software (DVCS) was used for fine-grained changeset management. All revisions are contained in the ".hg/" directory that accompanies the MKS project associated with the 3rd generation orbit control software system. Therefore, this "hidden" directory should also be checked out of MKS, in addition to all other relevant sources .

    • The latest version in MKS (assuming no one has worked on the source since the end of April/09) corresponds to the Mercurial version tagged as v3.0.1. This version was the last to be tested on production hardware on March 16/09.

    • Mercurial version 5.0.1 is the latest version of the software, exercised only on the test-bench setup (i.e. ioc1009-109). This version features a significant re-factoring of those classes involved with the power-supplies. This version has not been tested on production systems and should only be utilized after proper vetting. See Future Work, below, for further details.

Note
It must be realized that the entire revision history, from the deployed 2nd generation system to the experimental 3rd generation system, is captured in and accessible from the Mercurial system only. Thus, even though the Mercurial repo is preserved in MKS, it would be beneficial to continue using hg for day-to-day changeset management and developer interaction, and use MKS only to capture significant milestones in the project’s progression.

Deployment and Testing Infrastructure

The following are key pieces of physical and filesystem infrastructure supporting the OrbitController system:

  • ioc1009-109: test-bench RTEMS IOC

  • /export/tftpboot/epics/IOC1009-109: location of test-bench generic RTEMS system (GeSys) and startup script (st.sys). The orbitcontroller and orbitcontrolUI binaries can be served from the developers' srv-unix home directory, as these are NFS exported shares.

  • css2400-106: syslog server (ioc1009-109 console messages and status).

  • ioc2400-104: production RTEMS IOC

  • ioc2400-109: production Linux soft-IOC.

Note
in the 3rd-generation system, ioc2400-109 plays no role whatsoever. In fact, the softIoc running on it as part of the 2nd generation system must be killed prior to executing the 3rd generation OrbitController.
  • /iocApps/SR/ioc2400-104: location of production orbitcontroller and orbitcontrolUI binaries.

  • /export/tftpboot/epics/IOC2400-104: location of production generic RTEMS system (GeSys) and startup script (st.sys).

  • css1021-102: syslog server (ioc2400-104 console messages and status).

Modifications Required for New Power-Supply Hardware

Once the new, so-called "fast" power-supply controllers are in place for the sextupole magnets, several changes are required to supporting software. While the alterations necessary for the 3rd-generation system are small, they will require re-compiling the orbitcontroller software, and editing several substitution files in the orbitcontrolUI portion of the system. However, there are extensive changes required to the out-of-scope software responsible for serial communication with the power-supply controller channels for the sextupoles. The modifications to both the OrbitController and external software software systems are detailed in the following sections.

Modifications to External Software

Currently, the communication media between power-supply controllers and the software responsible for that communication is highly assymetric: the orbit-corrector magnet channels (aka fast channels) receive their setpoints from VME digital I/O modules (VMIC-2536 modules), and those same channels are polled for feedback values over slow RS-232 serial lines. To confuse matters even more, the communication channels to the sextupole power-supplies are exclusively serial-based.

Work is planned for the Fall of 2009 to install a VME-based setpoint-delivery interface for the sextupole control channels. Once this VME interface is in place, the IOCs responsible for the serial-communication and control will need to be re-structured such that their functional domain is limited to gathering channel feedback values only. Glen Wright and Neil Johnson should be consulted on this matter for further details.

Modifications to the OrbitControl App

Altering Compile-Time Constants

The number of orbit-control magnet (OCM) objects is currently defined in software as a preprocessor (compile-time) variable. To reflect the increased number of OCM channels introduced to the OrbitController’s domain as part of the hardware upgrades, the definition of NumOcm must be changed to follow suit (see orbitcontroller/include/Ocm.h).

NumOcm is used to derive NumHOcm and NumVOcm, the number of horizontal and vertical corrector channels, respectively. These variables are utilized primarily as bounds on looping operations over various containers. In particular, the dimensions of the (inverse) Response Matrices for each plane are partially determined by these parameters. Since the user interface (i.e. EPICS records) will create one Ocm object per record, it is possibleto do away entirely with the compile-time variables, as the number of Ocm objects will be implicitly given by the number that are created and stored in their respective containers. This approach will also permit the use of dynamically sized arrays, instead of fixed-size arrays. For example:

double hmat[NumHOcm][NumBpm];
double vmat[NumVOcm][NumBpm];

could then become:

vector<vector<double> > hmat;
vector<vector<double> > vmat;

with the dimensions given by:

PowerSupplyController::hocm.size();
OrbitController::bpmMap.size();

Altering EPICS Database Substitution Files

Changes must also be to the control system interface of the project, found under orbitcontrolUI/. These changes are somewhat less obtrusive than those required to the source under orbitcontroller/, as in this case only EPICS database substitution files must be modified. In particular, this affects files of the form Ocm24*.sub under orbitcontrolUI/orbitcontrolUIApp/Db.

The substitution file-fields that need to be modified are:

  1. vmeBaseAddr: base address of the VME digital I/O (DIO) modules, model VMIC-2536, responsible for communicating setpoints to power-supply controllers.

  2. channel: the channel of the power-supply controller corresponding to an individual OCM. The VME DIO modules encode the channel number in their interactions with the power-supply controllers.

  3. ringOrder: a number representing where in the geographical sequence (lattice) of magnets a particular OCM is situated. The OrbitController class uses the ringOrder to sort Ocm objects in their containers. This is necessary, as the Response Matrix elements are also sorted in "ring order".

Note
Two additional sources of very important information may be found in the files, orbitcontrolUI/README.1st, and orbitcontrolUI/orbitcontrolUIApp/Db/README.OCM.ringOrder. Also, the Engineering Notebooks of the author will also be a good source of information on this matter, as would Neil Johnson.

Operational Considerations

From an operational perspective, the function of the 3rd-generation OrbitController is relatively transparent. A new, simplified MatLab GUI was constructed, and it is this client that contains the logic for interacting with the latest control-system software. In fact, the older program, clsorb, may still be utilized in parallel with the new system. This configuration permits "slow" control over those magnet power-supplies which require it, while the newer program serves as the interface to affect the "fast" corrections. From the perspective of the orbit-control software, the new GUI simply serves to populate the waveform process-variable representations of the inverted Response Matrices, as well as affect state-transitions of the OrbitController.

Note
Tasha Summers should be consulted for further details regarding the MatLab interface to the orbit-control system.

Design Notes

Overview

Conceptually, the orbit-control system is simply those system components acting in concert to physically apply periodic solutions to the linear equation:

  • $\Delta \theta_x = R^{-1}\Delta x$

where, $\Delta \theta_x$ is the vector of horizontal orbit angular deflections (linearly related to the current through the corresponding power-supply channel), $R^{-1}$ is the inverted Response Matrix, and $\Delta x$ is the vector of desired horizontal beam positions. An analogous relationship also holds for the vertical plane.

From a control systems view, VME equipment is utilized to digitize BPM signals and deliver digital power-supply setpoints to horizontal and vertical corrector magnets, HCM and VCM, respectively. This may be visualized as in the [overview] figure, below.

System View
Figure 1. System overview.

The VME crates in all quadrants of the system are under the control of a single IOC: an "industrial" 3 GHz PC with 1 GB of RAM. The physical separation and multi-crate control requirements are satisfied via the Struck Innovative Systems PCI-VME interface (sis1100/3100). This interface permits multi-crate control and a high degree of flexibility with respect to VME crate and crate-controller positioning.

OrbitController

Structural

Structurally, The OrbitControl system is based on a Model-View-Controller architecture (see figure below). The model objects are simply instances of Bpm or Ocm classes, manipulated via concrete instances of their respective controllers, either BpmController or OcmController classes. These controllers are interfaces: C++ classes containing only pure virtual methods. It is important to realize that the OrbitController is both an OcmController and a BpmController: utilizing multiple-inheritance, the OrbitController provides implementations for both pure-virtual controller classes.

MVC Structure
Figure 2. MVC Structure of OrbitController system.

Conventionally, the "View" in an MVC design is a GUI element such as a text-field or button. In this case, the "View" is not a specific element, as the control-points of the software are exposed via Channel Access and therefore do not require a GUI at all in order to be accessed. In fact, it is probably more accurate to classify the system as simply a Model-Controller architecture, with Channel Access as the interface between the "Controller" and any conventional GUI widgets that might be utilized.

Resource and Concurrency View

Upon closer inspection of the architectural details, the classes and active objects (i.e. threads) appear as shown below ([resource-view]):

Resource-Concurrency View
Figure 3. Key classes and threads of the OrbitController system (Mercurial tag v5.0.1).

This representation of the OrbitController illustrates several key concepts:

  1. EPICS Device Support Interfaces: this is the only means by which a user may control and receive feedback from the system.

  2. Active Objects: These are indicated by their double-barred boxes. For example, the AdcReader objects. Note the relative priorities of the threads are also indicated (1 is highest priority). Since RTEMS schedules threads according to a priority-preemptive scheme, this information is vital to understanding which threads react to certain inputs, and what the flow of control (context) will be.

  3. Active Object Resources: these include the MVC-"Model" objects, their containers, their association with their respective Controller interfaces, and the objects that are private (in the OOP) sense to the OrbitController.

Note
The [resource-view] above, corresponds to the revision tagged as "v5.0.1" in the Mercurial repo. While there are a few important differences between what is illustrated and what is contained in revision "v3.0.1", the structural differences are small. Arguably most important are the behavioral differences between the two versions: v5.0.1 is capable of significantly more rapid orbit-corrections than is v3.0.1, and it scales better with increased numbers of orbit-corrector magnet channels.

Behavioral

From the user’s perspective, including the newer MatLab control program, the OrbitController is essentially a Finite State Machine (FSM). The runtime behavior of the OrbitController, including BPM data acquisition and orbit-correction algorithm application, may be altered simply by instructing the FSM to transition to one of the following states:

  1. Initializing: Upon instantiation, the OrbitController sets up its hardware from this state. This state cannot be transitioned to from the UI.

  2. Standby: Under certain conditions it may be necessary to cease BPM data acquisition, but still remain responsive to power-supply inputs originating from the UI (i.e. caputs to power-supply PVs).

  3. Assisted: This is the behavior of the RTEMS orbit control system as present in the 2nd generation system (AKA slow correction). BPM data acquisition is interrupt driven, yet still periodic at approximately 20 Hz. This mode relies power-supply setpoints to be calculated by and distributed from the MatLab program, srorb.

  4. Autonomous: In this mode, BPM data acquisition is identical to the Assisted mode. However, the OrbitController will autonomously calculate and distribute new power-supply setpoints at the same frequency as data acquisition occurs (i.e. 20 Hz)

  5. Timed: BPM data acquisition is timer driven in this mode, permitting faster rates that waiting for FIFO half-full interrupts. As with the Autonomous mode, the OrbitController applies the orbit-control algorithm with minimal intervention from other software.

  6. Testing: BPM DAQ is interrupt-driven. However only a single iteration of the acquire-BPM-data-→calculate-and-apply-correction algorithm is applied. This mode produces verbose debugging info (new corrector values are dumped to syslog, so one can verify the algorithm is producing correct deltas for the pwr supply updates).

The behavior of the OrbitController is represented in the following image of the [FSM]. However, it should be noted that not all states are depicted in this image (for purely aesthetic reasons).

OrbitController FSM
Figure 4. OrbitController FSM

From the developer’s point of view, the FSM is implemented using a variation of the State Pattern, as presented in the book, ""Design Patterns: Elements of Reusable Object-Oriented Software", by Erich Gamma et al. This pattern permits the addition of States by simply sub-classing the appropriate class, and implementing the required abstract (pure virtual) methods, stateAction(), stateEntry(), and stateExit().

OrbitControlUI

The portion of the system that the user sees and interacts with is the OrbitControlUI, or user-interface. This is simply a set of EPICS records backed by a set of corresponding Device Support routines. Although the average user does not directly interact with the Device Support, it is ultimately those pieces of software which inject into and receive data from the lower-level RTEMS OrbitController sub-system.

The EPICS Database comprising the user-interface contains approximately 1000 records as of version v3.0.1. This number can be expected to grow to the order of 1500 when the "slow" sextupole OCMs are added to the OrbitController’s domain. This surprisingly large number arises because their are 54 BPM sets (48 used for corrections) and 48 OCM sets, each with 2 planes of operation.

The next two sections will look in more detail at the BPM and OCM databases.

EPICS BPM Database

As mentioned, there are 54 sets of BPMs in the storage ring, each of which provides two, primary process variables: an x-position and a y-position, represented as analog input (ai) records. The OrbitController’s BpmControl thread simply produces averages of the digitized x and y BPM signals collected by the AdcReader threads (see [resource-view] figure). It is those averages that populate the database records, BPM14aa-bb:x and BPM14aa-bb:y.

Although not yet utilized by operations, there are also 54 sets of standard deviations produced for the corresponding x and y BPM average positions. These are records with names like, BPM14aa-bb:x:sigma or , BPM14aa-bb:y:sigma. These values are are also calculated by the BpmControl thread.

UI BPMs
Figure 5. OrbitControllerUI: BPM database.

As previously mentioned, the effect of disabling a BPM x or y channel is not fully understood or dealt with. However, the database binary-out records with names like, BPM14aa-bb:isInCorrection, are intended to provide the interface to such functionality. Note that this interface is intended to disable both the x and y BPM channels as a unit.

Two other groups of analog-output records utilized in the orbit-correction algorithm are those with names like BPM14aa-bb:x:ref (reference, or "Golden Orbit") and BPM14aa-bb:x:offs (offset). These values are typically set by the MatLab program as part of initializing the system for "fast", autonomous operations, and are seldom changed during operation. The OrbitController linearly combines these numbers with the current BPM average positions and this result forms the vector, $\Delta x$, utilized in the expression, $\Delta \theta_x = R^{-1}\Delta x$, given previously.

There are three, thus far undiscussed, records remaining in the [BPM-database] figure. These records may not properly be grouped with the others of that figure, but their placement is for reasons of conciseness. Actually, these records are part of the OrbitController's interface. Their utility is discussed below:

  1. BPM:samplesPerAvg: controls the number of BPM samples comprising the average published in the BPM14aa-bb:x records. Therefore, it also controls the frequency of publishing (record processing). This is a longout-type record. In any of the so-called "fast" modes of operation, the BPM values will be changing too rapidly for Channel Access monitors to keep up with. Yet, UI programs like clsorb still need relatively real-time BPM values to function. Therefore, the BpmControl thread triggers CA monitors at a rate determined by BPM:samplesPerAvg, while the autonomous orbit-correction algorithm operates using only a small, but current fraction of samples for its work. Note, BPM signals are currently digitized at 10 kHz, so 5000 samples is 0.5 [s].

  2. OrbitController:mode: controls the state of the OrbitController, as discussed in [FSM-behavior]. This is a multi-bit binary output record. Note, addition or deletion of OrbitController states will need to be reflected here. Note, there also exists a record that monitors the PCT-value (i.e. storage-ring current), and sets the OrbitController’s mode to Assisted if the value is less than 2.5 mA. This is to assure that the signal-to-noise (SNR) ratio of the BPMs is large enough to accurately perform corrections to the beam position.

  3. OrbitController:mode:fbk: feedback on the current state of the OrbitController. This is a multi-bit binary input record.

EPICS OCM Database

As of version v3.0.1 of the OrbitController, the set of "fast" orbit-correctors consists of 48 OCM. The records controlling the setpoints of the power-supplies for these have names ending in ":dac" (eg: OCM14aa-bb:dac). Those records with the suffix of ":fbk" are not feedback from the power-supply channels: they are feedback on the setpoint values, as the OrbitController has no physical means of obtaining true power-supply current values.

UI OCMs
Figure 6. OrbitControllerUI: OCM database.

Once the hardware modifications are in place to incorporate the dual-purpose sextupole magnets into the "fast" orbit-correction algorithm, there will need to be records created to control them. Place-holder values already exist in the various "*.sub" (substitution) files, but they are commented out. At this point, please consult the file, "orbitcontrolUI/Db/README.OCM.ringOrder". It contains crucial further details for this stage of the upgrade process.

The records with names of the pattern, OCM14aa-bb:delay, control the amount of spin-delay (in micro-seconds) required for correct operation of the OCM setpoint delivery. This delay is necessary, as the VMIC-2536 hardware contains optical-isolators with relatively long rise and (especially) fall-times. The nominal (worst-case) settings of 35 micro-seconds are issued to each channel upon record initialization, and need not be altered.

Enabling and disabling of OCM channels is accomplished via those records with names like, OCM14aa-bb:isInCorrection. Note that this does not actually enable or disable a channel, but rather only admits or omits that channel from participating in the orbit correction algorithm. Thus, the correction calculated for that channel may or may not be distributed depending on the setting of these records.

The three remaining families of records in the [OCM-database] figure are not actually associated with any physical OCM channel. They exist to provide support the mathematical operations of the orbit-control algorithm. Each record receives it values from the operator’s MatLab program. They are briefly discussed here:

  1. OCM:x/y:responseVector: These are actually the inverse Response matrices, as calculated and delivered by the MatLab support software. As EPICS waveform records have no innate support for multiply dimensioned arrays, the values are arranged in column order. So, if the matrix is 48x48, then waveform elements 0-47 are column one, elements 48-95 are column two, and so on. Note, these records are infrequently updated, typically once upon initialization, and never while the orbit-control is active.

  2. OCM:x/y:maxStep: These records are a form of gain control. They throttle the magnitude of the (absolute) values delivered to each OCM. This limits the size of correction applied at iteration of the orbit-control algorithm.

  3. OCM:x/y:corrFraction: These records are another form of gain control. Their values determine what fraction of the correction value is actually sent to a power-supply channel (OCM). For example, if one channel’s correction was clipped to the size of OCM:x:maxStep, and OCM:x:corrFraction was 0.5, then the correction sent to that channel would be 0.5*maxStep.

Future Work

  • The method for dealing with the scenario of disabled BPM and OCM channels is incomplete in the 3rd-generation OrbitControl system. This could be dealt with in two ways:

    1. Client-side: The MatLab program has the responsibliity of providing new inverted Response Matrices to account for the disabled BPM or OCM channel. This could be as simple as zeroing the appropriate row the matrix.

    2. OrbitController-side: There are enable/disable Binary Out process-variables associated with each BPM and OCM. In the case of the OCMs, if one is disabled (via a caput), that channel’s value is omitted from the channel-setpoint distribution process. Dealing with one or more disabled BPMs is complicated by the fact that they constitute one of the inputs to the equation which produces the OCM setpoint corrections.

Note
Disabling of OCM or BPM channels via Channel Access has NOT been tested !! In any case, the flexibility afforded via the presence of dynamically adjustable Response Matrices (see section on altering compile-time [constants]) would be well worth their (minimal) implementation effort, especially with respect to the solution of the disabled OCM/BPM problem.
  • The following comments pertain to version v5.0.1 (only!) of the OrbitController software. The power-supply setpoint distribution algorithm was heavily modified to distribute the cost of the spin-delays associated with affecting setpoint changes (thanks to Neil Johnson for the idea). A behavioral modification also permits application of the orbit control algorithm based on the number of ADC frames collected, rather than based on ADC or RTEMS Timer interrupts. Coupled with the faster technique of distributing power- supply setpoints, this change permits application of orbit corrections well in excess of 100 Hz. However, as stated, this version has not been tested on production systems and should only be utilized after proper vetting. Also, there is no way of changing, at run-time, the number of ADC frames that will trigger read-out of the ADCs and application of the orbit- correction algorithm (see FastAlgorithm.cc). However, although the EPICS interface does not yet exist to permit run-time alteration of the rate of orbit-correction application, the implementation of that functionality is already present in the OrbitController. What is required is a set of longin and longout records for getting and setting (respectively) the number of ADC-frames collected, and the appropriate Device Support to interact with the OrbitController instance.

Appendix A

Thanks to Michael Davidsaver for making a cleaner version of this patch.

From 8ea0edb9b6fdf64661a96112467b9672d37c7de7 Mon Sep 17 00:00:00 2001
From: Michael Davidsaver <mdavidsaver@bnl.gov>
Date: Wed, 1 Jul 2009 14:28:04 -0400
Subject: RTEMS Generic System

Optionally build RTEMS generic system loadable objects
---
 configure/os/CONFIG.Common.RTEMS      |   22 +++++++++++++++++++++-
 configure/os/CONFIG_SITE.Common.RTEMS |    6 ++++++
 2 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/configure/os/CONFIG.Common.RTEMS b/configure/os/CONFIG.Common.RTEMS
index 6057484..f2b5bb5 100644
--- a/configure/os/CONFIG.Common.RTEMS
+++ b/configure/os/CONFIG.Common.RTEMS
@@ -81,19 +81,39 @@ OPT_CXXFLAGS_YES = $(CFLAGS_OPTIMIZE_V)
 OPT_CFLAGS_NO    = $(CFLAGS_DEBUG_V)
 OPT_CXXFLAGS_NO  = $(CFLAGS_DEBUG_V)

+ifeq ($(USE_GESYS),YES)
+# Give loadable object a different extension
+override EXE=.obj
+STATIC_LDFLAGS_YES=
+
+# Don't product MUNCHed binary (ie myioc.boot)
+override MUNCHNAME=
+override MUNCH_CMD=
+endif
+
 #--------------------------------------------------
 # operating system class (include/os/<os_class>)
 OS_CLASS = RTEMS

 #--------------------------------------------------
 # Operating system flags
+OP_SYS_LDFLAGS += $(CPU_CFLAGS)
+ifeq ($(USE_GESYS),YES)
+# Assume all system libraries were linked with the generic image
+OP_SYS_LDLIBS =
+# A Generic object is just a set of objects which have been
+# incrementally linked to create an object.
+# The result is almost the same as a shared library.
+OP_SYS_LDFLAGS += -Wl,-r
+else
 OP_SYS_LDLIBS += -lrtemsCom -lc -lrtemscpu -lCom -lnfs -lm
-OP_SYS_LDFLAGS += $(CPU_CFLAGS) -u Init \
+OP_SYS_LDFLAGS += -u Init \
                  $(PROJECT_RELEASE)/lib/no-dpmem.rel \
                  $(PROJECT_RELEASE)/lib/no-mp.rel \
                  $(PROJECT_RELEASE)/lib/no-part.rel \
                  $(PROJECT_RELEASE)/lib/no-signal.rel \
                  $(PROJECT_RELEASE)/lib/no-rtmon.rel
+endif

 #--------------------------------------------------
 # RTEMS has neither shared libraries nor dynamic loading
diff --git a/configure/os/CONFIG_SITE.Common.RTEMS b/configure/os/CONFIG_SITE.Common.RTEMS
index 0133f69..4ff476e 100644
--- a/configure/os/CONFIG_SITE.Common.RTEMS
+++ b/configure/os/CONFIG_SITE.Common.RTEMS
@@ -12,6 +12,12 @@ RTEMS_VERSION ?= 4.9
 #
 RTEMS_PREFIX   ?= $(RTEMS_BASE)/bin/

+# Link Generic System loadable objects instead of full executable.
+#
+# A GeSys object is similar to a shared library.  It can be (un)loaded
+# at runtime by the Generic System loader which is available as a
+# patch against RTEMS.
+USE_GESYS=NO

 # If you're using neither BOOTP/DHCP nor FLASH to pick up your IOC
 # network configuration you must uncomment and specify your Internet
--
1.5.6.5