Adjusting System Functionality and Capabilities in LYNX MOSA.ic
I recently set up a demo to showcase how a customer can use subjects, also known as rooms, like containers. What I mean by that is that software...
4 min read
James Deutch | Principal Field Applications Engineer : Sep 29, 2023 9:00:00 AM
I recently set up a demo to showcase how a customer can use subjects, also known as rooms, like containers. What I mean by that is that software engineers can build guest images and reload them on the fly into the subjects. This gives the ability to easily and rapidly create images, and then update them on the target to provide it with new personalities and behaviors – all without having to restart or reboot the target system as a whole.
context and backgroundBefore I discuss how to do that, it is worth providing a quick recap as to what a subject is in the context of a Lynx-powered system. A subject is a set of resources and permissions. Resources include things like RAM, cores, and assigned I/O devices (both physical and virtual). If a subject isn’t assigned a resource, it doesn’t exist as far as a guest running in that subject is concerned. The permissions dictate whether or not a guest running within the subject is allowed to make a hypercall to perform an action like restarting, stopping, pausing, resuming another subject, or restarting the target board. If permission isn’t explicitly given to a subject, its guest doesn’t have the ability to perform that action. A guest is entirely constrained by the subject’s assigned resources and permissions. |
|
|
SubjectsThe diagram below shows two categories of subjects.
|
the two subjects on the lefthand side are:
Using a pair of FIFOs for bidirectional communication, one in each direction, the system drives data from the Buildroot Linux to the LSA. The LSA subject has extra permissions to allow it to restart, stop and pause the other subjects. |
. |
The gateway itself has two purposes:
|
Also, note that there is a method to send data between the LynxElement and LynxOS-178 subjects, using sampling and queuing ports. We provide commands to zero out the boot memory regions to which the LSA has read/write access, to overwrite and put in a new boot image, and then start, stop, pause and resume. The LynxElement subject is running several tasks including:
|
|
SHELL SCRIPTS: STEP-BY-STEPI created a few shell scripts that drive a Buildroot application called the "FITP controller”. This communicates using the FIFO Image Transfer Protocol (FITP) and is used to issue commands across the pair of FIFOs between the gateway and the LSA. Some applications on the LynxOS-178 side are used to talk across the sampling ports and queuing ports, sending and receiving information in JSON format. These applications are listed in the images below. |
By default, subjects come up in the “running” state, and begin executing as soon as they have their assigned core(s). However, I have chosen to initially have the LynxElement and LynxOS-178 subjects come up in the “stopped” state, so that they're not initially running. I can then kick them off with the FITP controller when I’m ready to run them.
When I change my LynxElement subject, I go into the $ENV_PREFIX/sys/userapp directory, edit my source files, and then build the image with the command “make clean appimage”. I then use shell scripts that SCP the image to the Gateway subject, drive the FITP controller app to wipe the LynxElement subject’s boot region, load the image into the LynxElement subject’s boot region, and then restart the LynxElement subject.
Let’s take a look at an example application and see how we can quickly iterate through some changes while we’re debugging it. Suppose someone has set up a queuing port reader on a LynxElement subject that is expecting to get queuing port messages from a LynxOS-178 subject. The LynxElement subject is making blocking calls waiting for data on that queuing port before echoing the messages out a serial port. I can make a change to the source code to remove that blocking call to the queuing port, rebuild the image, and then quickly push it to the subject and restart it.
I have found that this is a pretty easy development path. I tend to be a fan of modifying one thing at a time and testing it, so this update process is an effective way to accomplish that.
Please engage with us! Tell us if this helped, if you have questions, and if you'd like to see more content like this!
I recently set up a demo to showcase how a customer can use subjects, also known as rooms, like containers. What I mean by that is that software...
Based on several customers inquiries the purpose of this blog is to outline how to Allocate memory to a RAM disk Mount and unmount a RAM disk ...
Not many companies have the expertise to build software to meet the DO-178C (Aviation), IEC61508 (Industrial), or ISO26262 (Automotive) safety...