Design Article
Choosing the best system software architecture for your wireless smart sensor design: Part 2
Anton Hristozov, Union Switch & Signal - Pittsburgh, PA
12/10/2007 3:13 PM EST
One of the uses of a real-time OS (RTOS) is to guarantee determinism for real-time performance. It is equipped with facilities which can help the user to meet their application's real-time goals. For the OS to be real time it needs to have a special architecture, especially in the scheduler, a main component of the RTOS.
RTOSes are often classified as either soft real time or hard real time. A hard real-time RTOS is guaranteed to meet the timing requirements, while soft real-time solutions only guarantee these timing deadlines within a range of probability. One of the first design decisions to be made is to answer two questions:
1) Is the system real time or not? (The definition of 'real time' depends on the requirements and absolute time will be a different value for different projects.)
2) If the system is real-time, is it hard real time or soft real time? The answers to these questions will help in the selection of the software architecture. The requirements of the smart sensor wireless sensor network described in Part 1 can be used to help you pin down which alternative you need to deploy.
Shown in Figure 4 below is the typical interaction of the application, the RTOS, the Board Support Package (BSP) and the hardware. The BSP is the collection of drivers that an RTOS would define in order to interface with different hardware. As can be seen, the application can request services from the RTOS, or bypass the RTOS to talk directly to the BSP or hardware.
Depending on how the system is architected some of those links are optional and most RTOS vendors would recommend that it all be done through the RTOS and have the RTOS use its BSP to control the hardware.
![]() |
| Figure 4: Typical Interactions in an embedded design |
Concurrency and IPC
A smart sensor design may implement layers through the full range of
the seven-layer OSI model. Some layers may not be required for certain
applications. For example, the Physical Layer, Data Link Layer and
Application Layer must be present for the WSN to function as such. The
control of the Physical and Data Link Layers is a parallel activity in
the RTOS.
The same can be said for energy control of the smart sensor chip. Adding the networking and transportation layers requires another independent activity. That is why the question of concurrency becomes serious when the networking layer needs to do routing independently from the application layer.
If the smart sensor runs a mesh networking protocol such as Zigbee, and or has a TCP/IP stack in the case of a Zigbee gateway, then the convenience of an RTOS or at least a simple scheduler becomes necessary. With the concurrent execution facilities comes the need for IPC.
Memory Management
Memory management in embedded systems is handled differently depending
on speed and capacity restrictions. Another restriction may come from
the lack of a Memory Management Unit (MMU) in the smaller embedded
CPUs.
This is especially true for smart sensors, where in some cases the CPU is 8-bit and the memory is restricted to several tens of kilobytes. Therefore the usual approach in the RTOS is to use static resource allocation [18]. This means that all buffers are allocated at compile time, thus exposing problems in the design and avoiding unexpected dynamic behavior.
In addition, the RTOS needs to optimize memory usage during resource allocation and during runtime [2]. It seems to me that there is a potential for tools to help the designer of the application to verify the memory offline and during the initial design.
I/O Management
It is hard to come up with an abstraction about all the possible I/O
configurations, but there is an opportunity for an RTOS to standardize
the reading and control of I/O [2]. Interfaces to common sensors can
hide the details in the device drivers' implementation and the RTOS can
provide a unified interface for classes of devices to the user.
This means that changing the underlying hardware would not lead to application code changes, but will simply require a new driver which complies with the established interface. The challenge is that the number of possible device driver classes is overwhelming compared to a standard embedded system with just serial and Ethernet interfaces and no sensors attached.
Similarly to how Zigbee classifies types of devices, an RTOS can support classes of drivers. Another issue in handling I/O is buffering, which also can be done by the RTOS and not the application code.
Network Management
A big portion of the RTOS functionality is the support for network
protocols. Routing protocols in WSNs are special and can be tailored to
the specific needs of the application. The energy conserving approach
requires routing to be done efficiently. The same is true for data
exchanges between nodes in the network.
Therefore the RTOS needs to have an architecture that supports easy
installation of new wireless networking protocols. Handling collisions
with special protocols is a subject of ongoing research in the area.
Aggregating several packets into one and transferring in one burst is
another feature of these protocols [2]. Nano-RK takes the approach of
socket-like abstraction for the application, which is a convenient and
well-known approach for software developers.





RaffaeleMegabyte
12/18/2007 1:27 PM EST
Hello Mr. Hristozov,
Well, I think that you can also try to evaluate these OSs:
1) AmigaOS, small footprint, no resource consuming, OS run starting from 256 Kilobytes RAM, yes! KILObytes, versions 1.3, 2.0, 2.1, 3.0 runs flawlessly with 512 Kilobytes of memory (more RAM required on recent releases), a typical installation of modern AmigaOS 4.0 requires only circa 20/40 megabytes of HD space, yes! MEGAbytes.
It features multitasking preemptive with round-robin algorythm engine, and message passing between tasks. It is not certified as RTOS, but could being used as it could be a RTOS.
NASA used it for years tracking multiple satellites in low orbits.
See this article:
http://obligement.free.fr/articles_traduction/amiganasa_en.php
Modern versions (AmigaOS 4.0) implemented also "on the fly memory defragmentation" and virtual and protected memory system.
See these articles here:
http://os4.hyperion-entertainment.biz/index.php%3Foption=content&task=view&id=22&Itemid=.html
http://os4.hyperion-entertainment.biz/index.php%3Foption=content&task=view&id=23&Itemid=.html
AmigaOS runs on old Morotola 68xxx processors and recent versions of it runs on Freescale(ex Motorola), IBM, AMCC PowerPC (PPC) processors...
(And PPC are nowadays used in many emebedded devices).
2) Then there is AROS, that is an Open Source replacement of AmigaOS 3.1, which could be run from various devices: X86, PPC, PALM, etcetera.
It has same small footprint characteristics as AmigaOS, with the benefit that it cuold used on normal Intel X86 devices, as native standalone OS.
http://www.aros.org
You could download an installation version of AROS, or even a distro which could run hosted into Windows or Linux, or a slighty recent ISO and then burn a CD and run a demo of AROS from LIVECD, or you could even try a recent release of it to be tested on VMWARE virtual Machines, it is called VMWAROS.
More recent CD ISO is here:
http://aros.sourceforge.net/cgi-bin/nightly-download?20071215/Binaries/AROS-20071215-i386-pc-boot-iso.zip
VMWAROS is here:
http://www.vmwaros.org/
See also in the download section of AROS main site for more releases, such as those built for AMD64bit Athlon processor based machines.
64bit version of AROS has also memory protection.
3) In the end these is MorphOS.
MorphOS it is a small footprint near-RTOS or RTOS-like system based on a microkernel called Quark.
It is similar to AmigaOS only in the aspect, because it just runs Amiga-like API embedded in a sandbox called A-Box.
This is done because AmigaOS characteristics are very user-friendly, and because the filesystems and hardware drivers, and software for Amiga are easy to be implemented and/or purchased.
Typical MorphOS installation takes 17 Megabytes of HD space...
These are the features of MorphOS. It has almost all AmigaOS features, small footprint, etcetera, but it also features:
-SMP (Symmetrical Multi Processing)
-Memory Protecion
-Virtual Memory
And more...
Here an article on OSNews site from a MorphOS Power-user who tested it and uses it at home currently, professor Fulvio Peruggi from department of Physics at Univesità degli Studi di Napoli Federico II (Italy)
http://www.osnews.com/story.php/15209/
Article revised and updated here:
http://www.webalice.it/fulvio.peruggi/public/Pegasos&MorphOS/Articles/06_MorphOS_TLOS/MorphOS_extended_en_frames.html
If you need more informations features, then contact me at my e-mail.
Ciao,
Raffaele
Sign in to Reply
RaffaeleMegabyte
12/29/2007 8:55 AM EST
I just recall I forgot to allow you to see some Amiga software, so here is a link to a site showing a list of screenshots of Amiga programs, either for productivity and games...
Don't be afraid if you spot software whcih has names completely different from those common in Windows...
Here a little hint for it:
ATC AmiTradeCenter it is a good FTP handler
Sputnik it is a browser for MorphOS (and soon for AmigaOS too)
BurnIt and FryingPAN are software for creating CDs and DVDs
APDF obviously it is a software to read PDF files
ShowGirls it is a image viewer such as ACDSee or IrfanView into Windows world (And yes... The name of the program is due to the fact Amiga programmers have a good sense of humor)
Jabberwocky it is an interstandard program to handle instan messaging (compliant with MS Messenger) and IRC
Euphoria spectrum viewer it is a logical complement for AmigaAMP (the same as WinAmp in Windows world)
TwinVNC and remote Desktop will pilote remote Windows Machines
Blender it is the well known Open Source 3D rendering program
And so on...
(I avoided to mention games beacuse I want just to point you for the serious software only that it is necessary to proof that AmigaOS has some valid points for being adopted in embedded devices too)
Sign in to Reply
RaffaeleMegabyte
12/29/2007 9:00 AM EST
Here is the link...
http://bbrv.blogspot.com/2007/07/efika-morphos.html
Sorry I missed it in the previous message, but it seems this forum does not allow comments to be edited... :-\
Sign in to Reply