print

Embedded Linux Developer, Know Thyself

Armed with the right know-how, embedded developers can leverage
Linux to save money, enjoy full visibility into the source code,
and target complex applications like multicore processors.

As with anything free, embedded Linux is a tinkerer’s dream. Developers can download all of the source code off the Internet, which gives them full visibility. Of course, Linux isn’t a fit for every application or, for that matter, every individual. For example, it wouldn’t be suitable for an application in which the developer would need a real-time operating system (RTOS) with very narrow timeframes for scheduling tasks. Similarly, developers who lack the knowledge or resources to quickly take advantage of Linux can spend much more than they saved in time and other resources. Thus, the key to success with embedded Linux is to look objectively at the operating system’s capabilities and constraints and be realistic about one’s abilities as a developer.

According to Mukesh Lulla, president of TeamF1 Inc. (www. teamf1.com), “Linux is an attractive software platform when true real-time response is not needed—even with otherwise embedded software requirements. Its rich set of services and the wide variety of protocol stacks and robust applications available for it are a big plus. But one of the weaknesses of Linux-based devices (not so much of Linux itself ) is the use of some open-source software packages and applications, which do not lend themselves well to the stability, scalability, and rock-solid requirements that usually are a hallmark of embedded systems. Linux is an enabler of many creative technologies. But one has to be careful of what to enable with it because not all software written for Linux is created equal, and there is a wide variation in quality among packages available for Linux.”

Part of the problem is the seemingly endless pages of documentation on the web. As noted by Jeff Acampora, VP of sales and marketing at Arium (www.arium.com), “There are patches all over the place. People are trying to figure out, ‘How does it work if you take this patch?’ or ‘How about this combination?’ Think about someone who is taking Prozac and Xanax and Excedrin all at the same time and wondering how one drug interacts with another drug. Linux technology is kind of that way. People use different shared libraries and flavors of kernel, so it’s a moving target.”

For do-it-yourselfers, the potential for changes to the kernel makes things even stickier. As Acampora notes, “If you download and get everything working but then want to upgrade to a different version of the kernel, it’s not like you have one RTOS vendor that’s being very careful to make sure that all of the application programming interfaces (APIs) and everything work the same. Chances are the developer has to make a lot of changes to the code to work with the new kernel.”

Instead of navigating these choppy waters, less-experienced developers can turn to Linux vendors for a validated, known, turnkey build that eliminates many potential headaches and problems. For example, MontaVista (www. mvista.com) Linux 6 enables developers to build from source to more easily customize their software stack and add product-differentiating features. Its Market Specific Distribution (MSD) promises to provide all of the necessary software to get up and running immediately. In addition, the software development kit’s Integration Platform vows to enable developers to easily extend and customize their software stack. Monta- Vista Linux 6 also provides a full set of performance monitoring tools for profiling, memory-leak detection, memory usage analysis, and system- and application-level tracing (see the Figure).

By providing a turnkey solution for existing Intel boards, Arium plans to save its customers from having to find all of the right pieces online and download them. The firm has decided to make its debugger Linux OS-aware by building its own Linux distribution and providing specific debug hooks, which should soon be on the web. According to Acampora, “This Linux is going to be specifically targeted to the Intel Essential reference-board designs. We’re not sure of the pricing yet, but it will be very low—probably under $200. From our web site, you’ll be able to download all of the cross tools, a pre-built OS, and a whole kit with documentation to take this thing, download it, and go.”

pg_8

Figure: This screenshot of the DevRocket 6.0 IDE shows memory analysis—one of the performance-monitoring tools that now extend beyond the edit-compile-debug cycle.

Clearly, many firms are providing solutions that enable greater ease of use. Yet complex development problems continue to arise. The one that has garnered the most attention recently stems from the advent of multicore processors. TeamF1’s Lulla states, “An OS—whether Linux or another RTOS, when running on a multicore processor—usually runs in what is called a ‘symmetric multi-processing’ (SMP) mode of operation. Here, the OS tries to shuff le application requests between the various cores in the processor. It is in control of all cores. Inherently, the efficiency of this ‘shuff ling’ or ‘balancing’ gets reduced as you get beyond two cores and more so when it gets to more than four cores using today’s software techniques. It is not as much a Linux constraint as a limit to what SMP mode can get without having some more information on the applications that may use it, or a way to dedicate resources for certain applications.”

According to Lulla, one way to work around this limitation is “asymmetric processing,” wherein the OS does not run on all cores. Instead, certain cores are dedicated to compute-intensive tasks, running “bare metal” on these “dataplane” cores. “Bare-metal” may not be truly baremetal but running a very simple and fast OS executive or microkernel. Tasks running on these cores using the lightweight OS model can be dedicated to special types of processing and the cores running Linux can be offloaded to them.

Brad Dixon, MontaVista’s director of product management, points out that certain applications can scale linearly with the number of cores with minimal effort. Most applications, however, do require some degree of adaptation to get the most improvement from adding cores. As he points out, “The OS does have some inf luence over SMP scalability and Linux has been reworked extensively to take advantage of multicore processors. One example of this rework is the introduction and widespread adoption of the Read-Copy-Update (RCU) synchronization primitive.” Developers will need some savvy to resolve the problems arising from multicoreprocessor support and other emerging applications, but tricks and tips already abound on the Internet. Thanks to the kernel’s adaptability and the creativity of its developers, Linux is guaranteed to serve many more markets for the right price.

Ellen Konieczny is a freelance writer who has extensive experience creating manuals and other technical documents for companies. She can be reached at ellen.konieczny@gmail.com.

 

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google

Comments

Leave a Reply

Comment

Security Code: