cubesatlab / cubedos

A flight software framework in SPARK/Ada
48 stars 5 forks source link

CubedOS

A flight software framework for CubeSat spacecraft written in SPARK/Ada.

This folder contains the CubedOS system. It also contains two supporting applications: Mercury, a tool for generating CubedOS API encoder/decoder subprograms, and ScriptBuilder, a command script editor for CubedOS.

The core of CubedOS is written in SPARK/Ada with the verification goal of being proved free of runtime error. Mercury is written in Scala. ScriptBuilder is written in Python.

The subfolders are as follows:

When you clone this repository, also use the command:

$ git submodule update --init --recursive

To fetch the Ada Drivers Library repository as a submodule. This will populate the ADL folder. Some of the sample projects depend on this library.

Development Environment

The official development platform for CubedOS is x86-64-based Ubuntu Linux 22.04. Development, at least to some degree, on Windows and macOS is probably possible, but we do not use those systems. Most of the test, sample, and benchmark programs can be compiled and run on the development host. Some programs that target other platforms are also included.

With generous support from AdaCore, we are able to use the GNAT Pro tool set (currently version 24.2) for our development. Some experimentation with using Alire and the community tool chain has been done, but that build environment is not officially supported at this time.

In addition to GNATstudio for the SPARK/Ada components of the project, we also support using Visual Studio Code. The advantage of VSCode is that it supports development of the entire project from a single environment: Ada, Scala, Python, and LaTeX. We describe how to set up VSCode in more detail below. JetBrains IDEs (IntelliJ and PyCharm) can also be used for the Scala and Python portions of the project, respectively.

The README files in the mercury and scriptbuilder folders give more information about those subprojects.

Build & Test Instructions

The basic build of CubedOS can be done by opening the src/cubedos.gpr project file using GNATstudio. Various executables are defined as follows.

These programs are all written to the src/check/build folder.

The sample programs have their own project files. An aggregate project for the samples is also available in samples/samples.gpr.

Visual Studio Code

The file CubedOS.code-workspace contains a workspace definition for VSCode. It includes the folders for all the subprojects, including the documentation folder. To use VSCode, simply open that workspace and navigate to the folders and files you wish to edit.

The following extensions are recommended:

The configurations for some or all of these extensions may be committed to version control, so you may not have to adjust the configurations (very much). Also, be aware that some of these extensions will install additional extensions as dependencies.

The Ada & SPARK extension expects the Ada compiler and tools to be in the PATH environment when VSCode is started. This is true for recent releases of the Skynet virtual machine that is used by the CubeSat Laboratory team, but you may have to configure this separately if you are not using Skynet.