27-Nov-2008
The eMOS user manual is available in Acrobat PDF Format: eMOS User Manual. Opens in new browser window.
eMOS is a modern RTOS designed for embedded projects. Features such as a preemptive kernel, message passing for synchronization and interprocess communication, and mutex with priority inheritance make for a clean design; use of a single kernel stack, careful design of the internal data structures and use of compiler pragma minimizes resource consumption; and system safety features such as stack checking, virtual watchdog and memory tracking set eMOS apart from other RTOSes..
eMOS can be used on devices ranging from low-end 8-bit AVR microcontrollers with 8K of flash (with minimal functionality) and 2K of RAM to 32-bit ARM devices with lots of memory. The kernel API takes just a few kilobytes and can be used by itself in a minimal system to provide basic multitasking services.
In designing the eMOS tasking model, we feel that a preemptive priority-based round robin scheduler is the simplest model for users, because it allows the natural “functions as tasks” style of writing programs. It places no restriction on how users may structure their code, and users do not need to work around the tasking model. The scheduler gets called whenever a high-priority task becomes ready to run, providing very fast response to real-time events.
To minimize resource consumption, a separate kernel stack is used by the kernel calls, so that each task does not need to provide the stack resources needed by the kernel.
The general philosophy is to provide flexibility rather than to optimize the design for a particular niche (e.g., memory constraint devices). Thus, eMOS uses dynamic memory allocation (via a best-fit always-merge allocator to lessen memory fragmentation). It places no arbitrary limits on the number of tasks or task priorities except as constrained by the memory size or datatype size, and allows dynamic task creation and deletion. This approach allows eMOS to scale up and down except in the most memory-constrained situations.
Memory overwrite and, in particular, stack overflow are common sources of problems in embedded software. As most CPUs do not have any support for stack checking, this problem can manifest in mysterious system crashes that are difficult to track down. eMOS provides stack checking at every task switch (which may be turned off for final production builds) to ensure stack overflows are caught.
A slow or resource-constrained CPU can be replaced with a faster CPU or one with more resources, but there is no substitute for 100% reliable embedded software. Failing that, a system should at least allow postmortem analysis and failsafe recovery. As more embedded products are deployed in the world and in mission-critical environments, it is of the upmost importance for the RTOS to provide as many system safety features as possible without compromising the performance of the system. In the worst case scenario, a hardware anomaly such as alpha particles affecting SRAM cells is a real possibility under some conditions. eMOS provides a virtual watchdog to check the health of the processes. You can combine the virtual watchdog with a hardware watchdog and increase the chance of preserving the integrity of the system even if the system fails.
