Reconfiguring RTOS design for the IoT
Zeidman Technologies
With the rollout of the Internet of Things, intelligent devices are proliferating, and they will all need processors, real-time operating systems, and applications to run on top of those operating systems. Today, design often begins with hardware, then moves on to the operating system and finally the app.
Embedded systems designers can buy an operating system, but an off-the-shelf RTOS may be too complex and costly (often entailing royalties) for the project at hand. Consequently, said Bob Zeidman, president of Zeidman Technologies, over half of embedded software developers write their own operating systems.
That presents its own problems—developers need operating-system expertise. Zeidman wants to ease that requirement by reconfiguring the whole design process. “What we want to do is enable you to write your applications in an abstract sense—you don’t care what the hardware is, and you don’t care what the operating system is,” said Zeidman in an interview at the Embedded Systems Conference Boston in May. The enabling technology for this reconfiguration is the company’s SynthOS tool, which allows embedded developers to automatically generate operating systems yet maintain full visibility into the code.
With SynthOS, you can write code in C and insert simple SynthOS statements to specify intertask communications. Then, Zeidman said, “You push a button, and SynthOS creates an operating system and puts in all the data structures, message queues, mailboxes, semaphores, mutexes, and schedulers. You don’t have to understand operating systems. You don’t have to learn APIs. You focus on what you are good at—your basic algorithms.” SynthOS, he said, creates an OS that can run on a tiny processor with a tiny memory footprint.
Zeidman described the SynthOS concept as a reboot of an idea he had some years back. He had suggested a small operating system that could, for a given application, perhaps allow the use of an 8-bit processor instead of 16-bit one, thereby saving 25 or 50 cents. If you could eliminate a memory chip, you might save a dollar.
At the time of those discussions, prospective users of the concept were building products like routers, for which 50 cents or a dollar doesn’t make much difference. Further, the companies involved already employed teams who knew how to write operating systems.
“But now you’ve got people putting processors in light bulbs,” Zeidman said, “and 25 cents is a huge deal. And a light bulb company doesn’t want to hire a team of OS experts.” It makes sense, he said, to use a tool that can automatically synthesize an OS.
Zeidman said that writing your own OS is analogous to writing code in assembly language, which had long remained the method of choice for embedded systems. Using SynthOS, on the other hand, is like using a compiler. With assembly language, he said, programmers are constantly pushing data onto a stack and popping it off, adding, “Probably most programmers don’t know what a stack is these days—the compiler takes care of that.”
A consideration of testing issues is one possibility for future efforts for Zeidman Technologies. Critical aerospace or medical systems, for example, may require an OS certified for the application, but even with a certified OS, the application running on top can cause problems. With SynthOS, Zeidman said, you are basically compiling your application and OS into one big system that can be completely tested. Ultimately, he said, the issue would need to be addressed with the relevant certification groups.
For now, Zeidman Technologies has created several projects to demonstrate the usefulness of SynthOS and its advantages over off-the-shelf RTOSes, as described in a white paper.1
First, an Altera Cyclone EP1C20 FPGA with an embedded NIOS 32-bit soft processor controls a web server performing low-level hardware tasks while serving up web pages. The development for this very first application of SynthOS took several weeks. The resulting RTOS kernel was about 3 kB. This same code was resynthesized and compiled for an 8-bit Cypress PSoC yielding an RTOS of about 1.2 kB.
In addition, a Xilinx Virtex II-Pro FPGA containing an embedded 32-bit PowerPC hard processor and an embedded 32-bit MicroBlaze soft processor controls a serial-port mouse and a multiple-joint robot arm. SynthOS was able to create an RTOS for each processor in three days, most of which was spent setting up the workstation that ran SynthOS. The resulting RTOS for the PowerPC was 1.2 kB while the RTOS for the MicroBlaze was less than 900 bytes.
And finally, a Lego Mindstorms robot ships with 26 kB of total memory. The operating system uses about 22 kB, leaving only 4 kB for applications. The widely available brickOS takes about 11 kB, leaving 15 kB for applications. SynthOS for a Mindstorms robot resulted in an RTOS that used only 2 kB, leaving 24 kB for user applications. The white paper concludes, “SynthOS increased the user space by a factor of six and also supported more tasks and more global variables, allowing much more complexity for the applications.”
Reference
- Zeidman, Bob, SynthOS White Paper, Zeidman Technologies, February 2015.