Desktop and server users of Linux have long had a wide variety of distributions from which to choose, so you haven't needed to be an expert on the use of GNU tools to install Linux on those kinds of computer. But until about a year ago, if you wanted to embed Linux there wasn't much to do except create your own distribution. So the process of tailoring Linux for operation on an embedded system is still somewhat of a black art. The procedure goes something like this . . .
- Get a Linux kernel and C library.
- Add an init system and various other tools.
- Add your application.
- Build it all together into an image to be programmed into the device.
Such a process is hardly an efficient one for an embedded system designer who is not also an expert on Linux and the GNU tools. Of course, several commercial products for configuring an embedded Linux system are available, but there are few 100% free systems consistent with the spirit of Linux. This is why Transmeta's new Midori Linux is an encouraging development.
Who's Transmeta, and what's Midori?
Transmeta produces a line of low-power x86-compatible processors for notebook computers and embedded devices. These processors have an interesting and controversial design which, in combination with Transmeta's smart marketing move of hiring Linus Torvalds (the creator of Linux), has resulted in press attention far out of proportion to the company's small size. Thus, an old embedded system curmudgeon might be forgiven for expecting that the release of Midori Linux would be little more than a public relations move.
And you could easily see it that way, if you wish. Midori contains little that could be considered innovative. It uses the standard Linux kernel, but with some patches, particularly in the areas of power management (ACPI) and compressed file systems (cramfs). Midori adds some status reporting to ACPI. It adds to cramfs mainly additional support in mkcramfs: directory sorting, support for a cramfs boot loader, and support for inserting a kernel image into a cramfs image. It also adds a CRC check and an I/O performance improvement. These enhancements are evolutionary, and Transmeta reports they are working to get them into the standard Linux kernel. Some of the patches are of a temporary nature, so it is not surprising that they are not yet in the standard kernel. There are also some drivers for Internet appliance hardware such as a touchscreen and buttons -- these drivers are for the hardware that forms Transmeta's reference webpad design.
Another interesting Midori Linux feature is its browser-based configuration tool, called mlconfig. Mlconfig can be used for setting network options, changing the time, upgrading software from a network, and other simple system administration tasks. This is a useful tool, similar to others that are available.
The Midori build system is similarly non-revolutionary but useful. A Midori-based system consists of a set of packages called MLZ ("Midori Linux zipped") packages that are built in turn and combined into an image to be burned into the device. An MLZ package is implemented as a simple tar.gz file containing the original unmodified package in tar.gz format, an optional set of patches to that package, and instructions on how to build the entire MLZ package. Thus, for example, the linux-2.4.0_ML1.0.0-beta1-4.mlz package contains an unmodified linux-2.4.0.tar.gz file, some patch files such as acpi.patch and cramfs.patch, and a 'build' file to apply the patches and build the kernel. When the entire system is built into an image, each of the MLZ packages is untarred, built, and combined to be programmed into the target device.
Notably missing is a means for dependencies among packages to be automatically resolved, something desktop users now take for granted. Adding such a capability would be a fairly straightforward exercise, so perhaps we can expect to see this in the future.
Midori's greatest potential
Perhaps Midori's greatest potential is as the basis for an open Embedded Linux distribution standard. Most of what is necessary for such a distribution standard is present in Midori. The MLZ package system allows for applying patches appropriate for embedded systems to desktop-oriented packages. And the packages included in the current Midori distribution form a useful basis for a wide variety of embedded systems.
Midori is (sensibly, I think) not targeted toward the lowest end of the embedded system market. It uses mostly standard Linux packages, not going to extremes to minimize space requirements. Thus it uses lightly patched versions of the kernel, glibc, and XFree86. The most notable exception is the use of busybox, a package started by Bruce Perens (and currently supported by Lineo) which saves space by combining many standard Linux utilities (ls, cat, etc.) into a single executable and eliminating their more obscure options; this simple expediency saves substantial overhead -- busybox is itself becoming a standard package for small-footprint Linux systems.
Space savings are achieved by careful selection of only those packages that are appropriate for embedded systems, rather than by creating custom minimized versions of those packages. This a good policy for an Embedded Linux distribution, because it allows for updating the system with new versions of its component packages without having to maintain extensive nonstandard patches.
Although Midori does involve some patches, Transmeta seems to rightly have the attitude that the patches are only there as a temporary measure until they can be integrated into the mainstream kernel and other software. One of the main advantages of using Linux in an embedded system is the freedom to use the many software packages available. A good Embedded Linux distribution is, therefore, one that is, like Midori, simply a judiciously chosen group of such packages.
Transmeta has indicated that Midori is intended primarily for Internet appliances. However, this may be more a statement about the perceived market for their Crusoe processors than about the usefulness of Midori itself. They cite space requirements of 8MB flash, uncompressing to 16MB when loaded into memory (x86 sizes, of course). However, such numbers are reasonable for a wide variety of embedded systems, including high-end PDAs. And the numbers could certainly be improved by eliminating some of the webpad-specific functionality.
With the right follow-up and commitment by Transmeta, Midori has the potential to become the standard for Embedded Linux distributions. Its structure and design are simple enough to be understood by anyone with reasonable Linux and embedded system experience, so it should be easy for developers to customize; and, incidentally, for Transmeta to support. Yet it provides enough functionality to allow developers to avoid the iterative ad hoc approach to embedded Linux configuration.
Midori also has, far and away, the coolest artwork of any embedded Linux distribution. In general, Midori's documentation is quite good, though it shows some signs of having been rushed out in time for the recent launch. (In any case, the system's very simplicity means most developers would be able to grasp its structure easily, even if it had poor documentation.) A facility to assist designers with package dependency resolution would be a welcome addition, but I can think of nothing else of significance that it is lacking.
Embedded Linux providers have taken the approach of adding proprietary tools or emphasizing their services -- both approaches have the effect of tying customers to a particular vendor. But as we have often seen with other areas of Linux, it is the hardware vendors who are most in a position to add to the pool of open source functionality. Transmeta wants to ensure there is a good Linux platform for their chips, so they are motivated to provide the most open and accessible system possible. Transmeta is therefore in an excellent position to make a major impact, by setting the standard for Embedded Linux.
It will be interesting to see what happens as others begin to port Midori to non-x86 architectures -- ARM and MIPS ports for the newer PDAs would certainly be interesting. Dan Quinlan, the Midori Linux Project leader has said that Transmeta is willing to host them as part of the project. Although such ports would obviously not directly benefit Transmeta, which is a manufacturer of x86 CPUs, they would certainly help ensure the success of Midori as an Embedded Linux standard.
Author's bio: Jerry Epplin has written embedded software for the past fifteen years, primarily for medical devices. He can be reached at email@example.com
- An interview with Midori Linux project leader Dan Quinlan
- Embedded Linux companies assess Midori
- Transmeta launches "Midori Linux Project"
- Transmeta releases "Midori" -- Linux for gadgets
- The Midori Linux Project
- Details emerge on Transmeta's "Mobile Linux"
- Device profile: Gateway Connected Touch Pad
- The Embedded Linux Distributions Quick Reference Guide