Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MicroSatellite: Software and Operating System

MicroSatellite: Software and Operating System


Morteza Ansarinia

February 08, 2010


  1. AUTSat MicroSatellite Software and Operating System Morteza Ansarinia Mostafa Salarirad

  2. • Separated functionality into multiple physically independent hardware subsystems •

    Single integrated hardware. Softwares control subsystems
  3. • Multitasking • Resource allocation • Reliability, safety and software

  4. None
  5. None
  6. Application Layer Operating System Hardware Abstract Layer Hardware

  7. Processor Reset Initialize Hardware Initialize C/C++ Runtime. Jump to main()

    Initialize and Start Kernel Create Default Threads (Supervisor, ...) Power Thread Thermal Thread Health Checker Thread ACDS Thread Payload Thread Supervisor Thread Telecommand Thread Telemetry Thread Hardware Abstract Layer
  8. Operating System MicroC/OS-II Pros ANSI C Preemptive Multitasking Semaphore, Mutex,

    Timer, Message Management Fixed Sized Memory Management Low Cost (Free), Low Size Reliable, Low Interrupt Latency
  9. Operating System MicroC/OS-II Cons No Object Oriented Support Complicated Message

    and IO Management No Error Recovery Fixed Sized Memory Management ...
  10. Operating System Improvements • Object Oriented Kernel • Integrate Interrupts,

    IO, Message, ... into “Message” • Hardware Abstract Layer • Filesystem • Exception Handling • Error Recovery • Bootloader • ...
  11. Operating System AnytimeOS Kernel namespace OS { } Thread Timer

    Queue Event Message Mutex List Priority Queue Semaphore Scheduler Port
  12. Operating System Filesystem • saveBool ( “power.health” , true )

    ; • saveInt ( “thermal.sensors.count” , 50 ) ; • saveDouble ( “power.temp” , 24.2 ) ; • saveString ( “error.module.name” , “c&dh” ) ; • bool health = getBool ( “c&dh.health” , true ) ;
  13. Operating System Thread Structure • Main() • init() • halt()

    • Thread Workspace • newInt() • newDouble() • newBool()
  14. Operating System Scheduler • Unlimited number of threads • Round

    Robin Thread Scheduling • Same Priority • Avoid Priority Inversion • Dynamic Priority
  15. Operating System Mars Pathfinder (1997) • A few days into

    the mission, the spacecraft began experiencing system resets. • Official Report: • software glitches • the computer was trying to do too many things at once
  16. Operating System Mars Pathfinder (1997) ... The failure was identified

    by the spacecraft as a failure of the bc_dist task to complete its execution before the bc_sched task started. The reaction to this by the spacecraft was to reset the computer. This reset reinitializes all of the hardware and software. It also terminates the execution of the current ground commanded activities. No science or engineering data is lost that has already been collected (the data in RAM is recovered so long as power is not lost). However, the remainder of the activities for that day were not accomplished until the next day. The failure turned out to be a case of priority inversion. ... Glenn E Reeves Software Team Leader
  17. Operating System Priority Inversion a low priority task holds a

    shared resource that is required by a high priority task
  18. Operating System Priority Inversion Solutions 1. Disable all interrupts to

    protect critical section • Keep critical sections very brief, under 100uS in practical systems • Core::lock() • Core::unlock()
  19. Operating System Priority Inversion Solutions 2. Priority Ceiling

  20. Operating System Priority Inversion Solutions 3. Priority Inheritance • Keep

    medium priority threads from preempting the low priority thread • Scheduler::doSchedule() • Thread::waitOnSemaphore() • Thread::waitOnMutex()
  21. Operating System Self Healing and Recovery 1. Exception Handling 2.

    Component Micro Rebooting 3. Watchdog-Based Recovery
  22. Operating System Self Healing and Recovery 1. Exception Handling -

    Commonly used to signal error conditions in application codes. - Allows system developers to write code to handle errors like illegal opcodes in the OS using C++ “catch”.
  23. Operating System Self Healing and Recovery 1. Software Watchdog Recover

    Livelocks (can’t prevent infinite loops)
  24. Operating System Self Healing and Recovery 2. Component Micro-Rebooting -

    Most of OS components supports init(), reset() and stop()
  25. Simple Application

  26. Simple Application simple.hpp #include <os.h> using namespace OS; Workspace workspace

    (1024); Class SimpleThread : Thread { public: SimpleThread() : Thread(“SimpleThread”, 100, workspace); protected: virtual void Main(); } SimpleThread simpleThread1(); SimpleThread simpleThread2(); SimpleThread simpleThread3();
  27. Simple Application simple.cpp #include <simple.hpp> virtual void SimpleThread::Main(){ printf(“Hello World!”);

  28. Operating System Bootloader - Two Operating System (Simple, Normal) -

    Download OS image from the ground station