You can edit almost every page by Creating an account. Otherwise, see the FAQ.

Pharos RTOS

From EverybodyWiki Bios & Wiki




Pharos.[1] is a Real-time operating system (RTOS). Its name comes from one of the Seven Wonders of the Ancient World: the Lighthouse of Alexandria. The idea behind it is to, as best as possible, "shine some light" in RTOS in the subject of safety and security.

Pharos is provided in open-source and under Apache License 2.0 license. The rationale behind this license is to prevent the distribution of modified source code without prominent notices stating that the code has been changed[2].

Pharos main goal is to allow real-time critical applications to run in the same CPU with bounded interference with each other[3]. To support this, Pharos uses the Memory management unit (MMU) or the simpler Memory Protection Unit (MPU), depending on what the CPU hardware supports, to provide memory protection [4]. Additionally and very important in real-time applications, temporal protection is provided through the use of an extra hardware timer to enforce that a thread does not execute for more time than it is supposed to (Worst Case Execution Time). Pharos is built to allow applications to be divided into several partitions where each partition contains a set of threads, semaphores and other intra-partition synchronization/communication objects (e.g. message queues, etc)[5]. A partition can synchronize/communicate with another partition through inter-partition objects (e.g. resource, channel).

Memory protection[edit]

The authors claim memory protection is ensured by Pharos through the use of the CPU MMU or MPU[6]. Each partition has its own memory address space and if an attempt is made to use a memory address outside of its space, Pharos will detect it and stop the offending thread.

To be able to achieve this level of protection (specially using MPU), Pharos applications have their memory address space defined at compilation time. That is, it is defined by the global variables that each partition use. Dynamic memory ("malloc") are not supported at this time. At a later stage, dynamic memory may be supported for CPUs that provide an MMU.

Time protection[edit]

The authors claim Pharos ensures that each partition thread has enough time to execute by defining the Worst-case execution time of each periodic or sporadic thread. This way, there is a form of "contract" on the application configuration where it is defined the temporal properties of each thread (e.g. priority, Worst-case execution time, period, etc). This way, the application designer can derive conclusions whether the application is schedulable or not.

There are other solutions where each partition has its own time window to execute (e.g. ARINC 653[7]). However, these solutions make it very difficult to create a responsive system (that is, a system that could respond quickly to an an external stimulae, such as an interrupt) due to the time windows being fixed.

Inter-partition communication and protection[edit]

Pharos provides mechanisms for partitions to communicate with each other and use special filters[8]. A filter is an application provided method that allows (or not) a partition to send messages (or any other form of inter-partition communication) to another partitions. These filters methods operate on their own stack, on the memory area of the callee partition and also on the time window of the calling thread. This prevents Babbling idiot scenarios where a low-critical erroneous thread is trying to overload another partition by sending a continuous stream of messages. The filter method can prevent this by filtering out the unwanted messages. Also, since the filter operates on the time window of the calling thread, if the thread attempts to overload another partition with messages, it will only exhaust its own time window and will not damage the time properties of other threads.

Supported Hardware[edit]

Currently, Pharos supports only ARM architecture, with the following CPUs:

Other architectures, such as x86 or RISC-V are not supported at this time.

Comparison to other operating systems[edit]

Unlike Linux, Windows, or other well-known operating systems, Pharos applications must be built along with the OS itself. That is, a single executable is downloaded into the target platform (i.e. board) and executed. It cannot, at runtime, add more applications to be executed.

References[edit]


This article "Pharos RTOS" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:Pharos RTOS. Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.