Username/Email:  Password: 
TwitterFacebookFlickrRSS

Software Considerations: an Excerpt from Embedded Linux

Lombardo reveals the difference between developing a meaningful application and a doorstop.

You know you want to build an embedded application, and you know you want to use Linux as the operating system. Where do you start? With the hardware. The hardware choices you make--processor, memory, Flash and so on--drive what you will do with the software. Because no software license cost is associated with Linux, most of your cost will be in the hardware itself. The more units you sell, the more true that is. Therefore, in any high-volume application, it's more important to get the hardware right before you ever worry about the software. Linux has been adapted to many different microprocessors and microcontrollers, and more are supported all the time. Chances are that the processor you'll choose is already supported by Linux in some way. If it's not, and you have the time and expertise, you can support it yourself. After you select the hardware you want to use, it's time to see how well Linux supports that hardware. So fire up your browser and search the Internet for web sites devoted to Linux and your hardware device. Here are some good places to start: google.com, LinuxDevices.com, LinuxHardware.net and LinHardware.com.

After you have finally decided on your hardware platform, it's time to nail down exactly what you want the software to do. This article presents several software-related issues you'll need to consider.

Embedded Linux Toolkits

Porting Linux to a new hardware platform can be a daunting task. Fortunately, several embedded Linux toolkits are available, designed to simplify the job of building the binary that runs your device. Some toolkits, such as Lineo's Embedix and MontaVista's Hard Hat Linux, are disparate and are able to work on many processors for lots of different applications. Others are from smaller companies and focus on narrower processor sets and more limited application ranges. Still others, such as PeeWeeLinux, are not products distributed by companies but rather projects built by a set of like-minded hackers in the traditional open-source model. Here are a few things to consider when you're looking for an embedded Linux toolkit:

  • Hardware support: Does the Linux toolkit include support for the processor you want to use? If the toolkit doesn't already support that processor, does the toolkit vendor have the wherewithal to develop that support quickly enough for your purposes? If so, how much will it cost? Does it fit in your budget?

  • Documentation: Is the toolkit well documented? Are all of the programs involved documented? Does the documentation cover both high-level concepts such as architecture whitepapers and low-level documentation such as how to build binaries, how to add your software to the code base, and reference manuals to the build and runtime software?

  • Adaptability: How adaptable is the embedded Linux toolkit to the particular application you're going to use? If it's a very narrow toolkit and you'll use it for several projects, how much work will be involved in changing the toolkit to the projects for which it's not as well suited?

  • Developer support: What kind of developer support does the toolkit company offer, and how expensive is it? If you need a bug fixed, a question answered, or a device driver written, how quickly can you get a response from the company? Is a list server available for the users of the product? If one is available, how active is it? Is anyone from the company answering questions on the list?

  • Field upgradeability: Are facilities available in the toolkit for upgrading the software in the field? Does the toolkit company offer any means for delivering those upgrades, or is that left up to you?

  • User interface: If your application requires some sort of user interface, what are your options? Does the embedded Linux toolkit offer some sort of embedded video interface? If so, how much room does it take? If not, is some sort of web-based interface available for configuration? The toolkit itself may not have any support for a graphical interface. However, there are several open-source projects, and several commercial products aimed at building small-footprint, graphical user interfaces. See http://www.linuxdevices.com/articles/AT9202043619.html/ for more information.

  • Track record: Does the toolkit vendor have any examples of customers who have created a similar product out in the field? How successful was that vendor with the toolkit?

Kernel Features

The Linux kernel runs on a vast array of hardware architectures--everything from handhelds to mainframes. To support this sort of scalability, the kernel is highly configurable. There are several ways of configuring the kernel (note that I'm using the word configure quite loosely here):

  • Typing make config, make menuconfig, or make xconfig in the root of the kernel source runs the standard kernel configure routines. You can turn options on or off or sometimes compile them as modules so they can be loaded at runtime.

  • There are hundreds--perhaps thousands--of kernel patches floating around the Internet. Some are very small--enough to fix a small bug in one file. Medium-sized patches may affect a half-dozen files and add support for a particular hardware device. Some large patches add or affect many dozens of files and add support for new architectures. Often, applying a patch adds new questions or entire screens to the kernel configuration screens described above.

  • The ``One True Method'' of really configuring the kernel to do exactly what you want is to hack it yourself. Until recently, this was an exercise only for those who have lots of time and patience; the Linux kernel source code is well structured but somewhat obtuse. Linus doesn't believe in cluttering up the source with comments for the uninitiated (see Chapter 5 of Documentation/CodingStyle in the Linux source tree).

Fortunately, times have changed, and there are now several good overviews of the Linux kernel. Perhaps the most lucid is Understanding the Linux Kernel, by Daniel P. Bovet and Marco Cesati (O'Reilly, 2000).

______________________