Design of a device handling interface in Rust for the flight software framework
Date
Authors
Journal Title
Journal ISSN
Volume Title
Publisher
Abstract
The Flight Software Framework (FSFW), developed by the Institute of Space Systems (IRS) at the University of Stuttgart, is a framework for building flight software for small satellites. Originally developed in C++, the FSFW is being rewritten in Rust for the upcoming ROMEO mission to take advantage of Rust’s memory safety guarantees, modern tooling and ecosystem. An important feature of the FSFW is the device handling concept, which allows control of hardware devices using standardized interfaces. This thesis focuses on transferring the device handling concept from the C++ framework to Rust, aiming to improve flexibility and usability for developers. The transformation process is guided by the Horseshoe model for software reengineering. An analysis of device handling in the existing C++ framework is conducted, focussing on the DeviceHandlerBase class. Then a new architecture for device handling is derived based on the analysis of the C++ implementation and developer feedback. A prototype is implemented in Rust using the new architecture while mirroring most of the functionality of the C++ DeviceHandlerBase class. Additionally, a device handler for a demonstrator device is implemented to showcase the prototype’s functionality. The evaluation of the prototype using maintainability metrics shows improvements in code complexity and maintainability compared to the original C++ implementation. The prototype is also ready for use in an embedded environment with minimal changes. With the new modular architecture, a basis is set for a more flexible and extensible device handling as part of the FSFW.
Das Flight Software Framework (FSFW), entwickelt vom Institut für Raumfahrtsysteme (IRS) der Universität Stuttgart, ist ein Framework zur Entwicklung von Flugsoftware für Kleinsatelliten. Ursprünglich in C++ entwickelt, wird das FSFW für die bevorstehende ROMEO-Mission in Rust neu geschrieben, um von den Memory-Safety-Garantien, modernen Dev-Tools und dem Ecosystem von Rust zu profitieren. Ein wichtiges Merkmal des FSFW ist das Konzept zur Steuerung von Hardwarekomponenten, über standardisierte Schnittstellen, genannt ”Device-Handling”. Diese Arbeit konzentriert sich auf die Übertragung dieses Konzepts vom C++-Framework nach Rust, mit dem Ziel die Flexibilität und Benutzerfreundlichkeit für Entwickler zu verbessern. Der Transformationsprozess wird durch das Horseshoe-Modell für Software-Reverse-Engineering geleitet. Es wird eine Analyse des Device-Handling-Konzepts im bestehenden C++-Framework durchgeführt, wobei der Fokus auf der DeviceHandlerBase-Klasse liegt. Anschließend wird eine neue Architektur für das Device-Handling abgeleitet, basierend auf der Analyse der C++-Implementierung und dem Feedback der Entwickler. Dann wird ein Prototyp in Rust unter Verwendung der neuen Architektur implementiert, wobei die meiste Funktionalität der C++ DeviceHandlerBase-Klasse nachgebildet wird. Zusätzlich wird eine Implementierung für ein Demonstrationsgerät erstellt, um die Funktionalität des Prototyps zu veranschaulichen. Die Evaluation des Prototyps anhand von Wartbarkeitsmetriken zeigt Verbesserungen in der Codekomplexität und Wartbarkeit im Vergleich zur ursprünglichen C++-Implementierung. Der Prototyp ist bereit für den Einsatz in einer Embedded-Umgebung, wofür nur minimale Änderungen nötig sind. Mit der neuen modularen Architektur wird die Grundlage für ein flexibleres und erweiterbares Device-Handling als Teil des FSFW gelegt.