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
Tweet

More Decks by Morteza Ansarinia

Other Decks in Research

Transcript

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

    Single integrated hardware. Softwares control subsystems
  2. 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
  3. 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
  4. Operating System MicroC/OS-II Cons No Object Oriented Support Complicated Message

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

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

    Queue Event Message Mutex List Priority Queue Semaphore Scheduler Port
  7. 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 ) ;
  8. Operating System Thread Structure • Main() • init() • halt()

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

    Robin Thread Scheduling • Same Priority • Avoid Priority Inversion • Dynamic Priority
  10. 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
  11. 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
  12. Operating System Priority Inversion a low priority task holds a

    shared resource that is required by a high priority task
  13. 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()
  14. Operating System Priority Inversion Solutions 3. Priority Inheritance • Keep

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

    Component Micro Rebooting 3. Watchdog-Based Recovery
  16. 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”.
  17. Operating System Self Healing and Recovery 2. Component Micro-Rebooting -

    Most of OS components supports init(), reset() and stop()
  18. 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();