| |
| |
|
|
| |
|
|
 |
 |
| |
 |
|
| |
|
|
| |
Grab an Open RTOS
( 01 Dec 2005 )
BY JON TITUS, SENIOR TECHNICAL EDITOR, ECN
|

Developing software around a real-time operating system (RTOS) does not always require a big budget. Engineers can get started with free or low-cost RTOS packages, some of which provide open-source code.
UK-based software engineer Richard Barry developed an open-source RTOS out of necessity. He sought a small RTOS for a motor-control application, but found nothing suitable. His no-cost, open-source FreeRTOS.org software now runs commercial applications and operates with processors that include the STMicrosystems and Philips ARM7 devices, Renesas H8S2329 (Hitachi H8/S) processors and ICs in the Atmel AT91SAM7 family.
“You can run FreeRTOS.org as a preemptive or a cooperative RTOS, and it offers true real-time performance,” explained Barry. “Users receive demonstration programs preset for the preemptive mode, but you can turn off that capability.” When someone downloads the software, they receive two Mbytes of source code, which includes all processor ports and demo applications, which run on commercial development boards.
The demonstration programs let engineers run an application and observe how the RTOS’s application programming interfaces (APIs) work. Engineers can then adapt the demo code to their needs. Barry noted the demos come with linker scripts and compiler switches preset and ready to use. A forum hosted at SourceForge.net provides user-to-user support.
Barry offers a slightly modified General Public License (GPL) for FreeRTOS.org. Code that operates through the RTOS APIs remains proprietary to application developers. Any modifications to the RTOS, though, become public and may become part of the FreeRTOS.org code. “Sometimes people ask to modify the RTOS source code under special terms, and so far I have always said yes,” noted Barry.
Center on eCos
The Embedded Configurable Operating System (eCos), another open-source RTOS, finds use in consumer, industrial-control, military, and communication systems. The service company eCosCentric offers its version of eCos as eCosPro, which includes additional tools, enhanced drivers and guaranteed support. “Access to eCos source code provides security,” said Daniel Morris, sales and marketing director at eCosCentric. And, an open-source RTOS also frees a company from paying a royalty on each product unit shipped.
Although developers can download the free eCos RTOS, they may want to purchase support from a company such as eCosCentric. “We maintain an internal ‘source base’ that we test rigorously,” stressed Morris. “Our automated test systems run around the clock and perform over 21,000 regression tests per platform. When we release eCosPro for a particular processor, our tests have thoroughly exercised the software and the target processor.” Developers can run eCosPro right out of the box on many commercial development boards.
Before developers start an eCos-based design, Morris recommends a four-day trainingcourse. The hands-on program takes people from an introduction to a preemptive multitasking multithreading RTOS through to development and integration of drivers in a system.
Because engineers can quickly configure eCos capabilities, some use it simply to provide easy—and well-documented— access to serial, SPI, I2C, and other ports. Some eCosCentric customers also use eCos as a tested and documented board-support package, without the kernel. That way, developers obtain standard APIs and device drivers as well as test routines that exercised the on-chip or on-board components.
Nothing Small About MicroC/OS-II
Although the MicroC/OS-II RTOS does not exist as opensource code, engineers can still take a look. Jean Labrosse’s book, MicroC/OS-II: The Real Time Kernel, comes with a CDROM that includes source code. “Even though readers receive an older version of the RTOS, it still runs and matches the description of the code in the book,” said Labrosse.
“For MicroC/OS-II, we work on the honor system, so we expect engineers will tell us when they use our software in a product,” Labrosse added. His company, Micrium, charges a one-time license fee for use of the MicroC/OS-II software in any quantity of a single end-product.

MicroC/OS-II, often abbreviated as μC/OS-II, runs in many types of products; appliances, routers, switches, navigation systems and avionics. The royalty-free RTOS is certifiable in medical and avionics applications, and it passes the stringent Radio Technical Commission for Aeronautics (RTCA) DO-178B Level Arequirements adopted by the US Federal Aviation Administration (FAA).
Today, the code runs on over 45 processor architectures. However, Micrium does not directly support them all. “That would become an impossible task,” said Labrosse. “We could not stay current with all the compilers and development boards.” Instead, users who port the RTOS to a new processor or board post porting details on Micrium’s Web site. For an ARM processor—the one used most often with μC/OS-II—the operating system takes from 6 to 20 Kbytes and requires from a few kilobytes to 7 Kbytes for data storage.
When you want to use an RTOS, “do not write all your code, flip the switch and expect it all to work,” cautioned Labrosse. “You would be surprised how many people actually do that. They contact me and say their system does not work.” Develop and test in small increments. Get the OS to run and then start to add small pieces of code.
Is Linux Real Time?
No discussion of open-source operating systems can end without a discussion on Linux. Robert Whaley, Director of Linux Development at Applied Data Systems loves Linux, but said his company takes a neutral view of Linux and will work with customers to port almost any operating system to the company’s computer-board products.
“Linux is not an RTOS,” said Whaley. “But for most things developers want to do, Linux plus today’s fast hardware offer fine performance. Some applications that required an RTOS a few years ago no longer do.” Plenty of Linux systems handle high-speed Ethernet, serial and other I/O ports, according to Whaley. “Just because a system must handle bytes at a high rate does not automatically determine whether you need an RTOS.”
Whaley pointed out that ARM processors provide a fast interrupt request (FIRQ) input that Linux purposely does not use. So, if developers need fast response, they can write a FIRQ service routine and handle an interrupt request outside Linux. “The FIRQ works when you have one or two simple devices you must service quickly,” explained Whaley. “But it does not solve the problem of having lots of complex tasks that must interact and still offer guaranteed latency.” Some people will always need an RTOS. But the choices become somewhat self limiting. Developers who have RTOS experience may not understand Linux, so they do not consider it for use in an embedded system.
|
|
|
|
|
|
|
|