Embedded Linux and Android: Friends or Foes?

Which operating system is the better OS for embedded systems is an ongoing debate among embedded systems developers. Android developers see things one way and hardcore embedded Linux developers see things quite differently. Of course, the OS you select has a great deal to do with the end device you are designing. But still, there are some distinct advantages and disadvantages to each of these immensely popular operating platforms.

There is not much debate over whether to use Android or embedded Linux for a cell phone or a mobile device like a tablet. Android is a clear winner in this space. The real question is, what OS do you use for a traditional embedded software project where the software that you put on the device is static for the life of the device? Should you use Android for your smart refrigerator, toaster, or media player? Is Android a complete replacement for embedded Linux in modern devices?

For the most part, embedded Linux is defined as the software you’d run on a fixed or limited function device, allowing the device to take full advantage of the processing power and related peripherals. In a fixed function device, embedded Linux shines when it comes to operating efficiency in terms of memory footprint, power, performance, and ease in using the device for its intended purpose.

However, when you look at the volume of embedded devices running Linux, a majority of them are smartphones and tablets. These devices are definitely not fixed function devices and they are going to skew the traditional definition of embedded Linux. As a result, as the capabilities of the hardware increases the definition of embedded Linux is bound to change as well, since there will be fewer limitations in storage and processor capacities; to attempt to create a strict definition of embedded Linux would be an exercise in futility.

On the other hand, Android is a desktop-like Linux mobile operating system and platform that allows users to define their own usage patterns and also allows vendors to dynamically update and upgrade the platform. Some folks categorize Android phones and similar devices as consumer “portal” devices, primarily designed to provide a view of data stored elsewhere. But the distinctions between embedded Linux and Android get easily blurred.

One example of blurred definitions might be a set-top box, which used to be a fixed function embedded Linux device. Now, the set-top box TV/DVR can be as dynamic and as functional as the user wants via Android app downloads and software upgrades. Just as the embedded Linux definition is bound to change, the same can be said about Android – it’s no longer just a mobile communication and tablet operating system.

The real differences between Android and embedded Linux
Contrary to what many people think, Android runs the same kind of Linux kernel that embedded Linux runs. The focus of Android lies in the vertical integration of the Linux kernel and the Android user space components. In many respects, Android is just one “flavor” of embedded Linux. Every embedded Linux deployment is different and is tailored to the CPU architecture, SoC support, peripherals, and purpose of the device (Figure 1 ).

Figure 1: Mentor Embedded Linux is a fast and efficient alternative to creating your fixed-function device.

Android is attractive in the embedded Linux space because while each deployment is different, there are common components and standardized APIs all the way up the stack. Essentially, this comes down to a more consistent application development environment. The downside of this consistency/standardization is that the Android core images have very large footprints and large vulnerability profiles.

Most fixed function devices still require the ability for their operating system to be customized and optimized in ways that Android does not allow. At Mentor, we have seen increased requests for Android to be used in fixed function devices, and our response is usually, “Really, you need Android to run your coffee maker?”

As you customize Android for a limited-function embedded device, Android ceases to be Android from a compatibility standpoint. When Android can no longer pass the Compatibility Test Suite (CTS), it loses the ability to take advantage of the application ecosystem. Whether it is a perceived value or not, customers like to know they are developing applications in a consistent environment, and they insist on having that option.

Advantages and disadvantages
Android provides a large amountof functionality quickly, and has fewer issues with licenses whencompared to embedded Linux. Android has a consistent developmentenvironment (until you start linking to native code). Android givescustomers the option (or illusion) that they can tap into the Androidapplication ecosystem.

Android has visibility to their usersthat users of embedded Linux do not enjoy. Nobody knows what operatingsystem is running in their coffee maker. Another late breaking change isthat some of the leading edge development to support new SoCs, graphicsaccelerators, etc. is happening in Android first and then pushedupstream to the Linux kernel and other projects.

Embedded Linuxstill offers vendors complete freedom in defining the stack that theycan tailor to a device. If the vendor needs to make changes to apackage, they only have to deal with one upstream entity, whereas it maybe difficult to make changes that will be accepted into an Androidstack.

With embedded Linux, you aren’t tied to any GoogleAndroid release roadmap and you don’t have the worries about being oneof Google’s preferred vendors (or not). This flexibility and freedomallows developers to customize greatly and to meet the needs of manymanufacturers more closely. Embedded Linux deployments can have a muchsmaller footprint than Android and native applications always run fasterthan interpreted or JIT-compiled Java code.

How embedded Linux can learn from Android’s success
EmbeddedLinux has been providing solutions for embedded devices for years. Itdoesn’t need to learn about bloated stacks, large footprints, poorlyperforming application runtime environments, and complicated stacks.However, embedded Linux needs to learn the value of the applicationecosystem. Embedded Linux could use consistent UI's, consistent logging,and a more consistent application development environment.

Further,Android provides a much more solid platform base for developers tostart with, even if it is less flexible. By extension, embedded Linuxwould benefit from more solidity “out of the box.” The Yocto Project andthe LTSI kernel initiatives are extremely important for embedded Linuxto gain a solid core set of capabilities that will be supported for areasonable product lifecycle. These initiatives help the embedded Linuxdevelopers to define a way to provide a more robust commodity startingpoint for the core operating system, allowing companies to focus oninnovating in their unique product development.

A case for co-existence
Ithas become abundantly clear that Android is no longer just a mobilecommunications and tablet operating system. At Mentor Graphics, we haveused Android in many stand-alone environments to provide a consistentuser interface and application development environment for things likemedia servers, medical devices, and infotainment systems.

Andyes, there are projects that have allowed Android and embedded Linux torun together. Recent embedded architecture developments allow Androidand Linux to peacefully co-exist. One example of this co-existence isthe Android operating system hosted on top of embedded Linux in a LinuxContainer (LXC). The resources, access control, and security of theAndroid client are managed by the host embedded Linux system.

Figure 2: Android and Linux can co-exist in a Linus Container

Ifyou are concerned about Android security, this approach represents agood way to offer Android application access while keeping other systemfunctions protected on a standard embedded Linux platform. Multicore SoCplatforms make this approach even more attractive as multicoreoperating systems and hypervisors can allocate sufficient resources forboth Android and embedded Linux to perform well simultaneously.

WhileAndroid offers developers much functionality very quickly and offers aconsistent software development environment, it is not the best choicefor every device. Android will continue to thrive in the mobile devicemarkets, and this popularity will move into other markets where thereare needs for a consistent user interface, rich media capabilities, andaccess to an application ecosystem. For all the other markets, a fullycustomizable, nimble, efficient operating system like embedded Linuxwill continue to thrive.

The Yocto Project is a multi-vendor initiative that makes it very easy for you to create acustom embedded Linux for your device. The Yocto Project has amembership of silicon vendors, device vendors, operating system vendors,and embedded services providers.

The project has alreadydemonstrated that there is plenty of demand in the market for customembedded Linux solutions. Android, embedded Linux, and a combination ofthe two all have their place in the embedded device markets.

John Cherry is Senior Engineering Manager at Mentor Graphics and runs the LinuxRuntime Services organization. John’s organization provides runtimeservices for a variety of both embedded Linux projects and Androidprojects for companies around the globe. As an advocate for open sourcesoftware and the communities surrounding them, John is on the AdvisoryBoard for the Yocto Project. In the past, John has also chaired a numberof the OSDL and Linux Foundation initiatives, including the MobileLinux Initiative, the Carrier Grade Linux Initiative, and the DataCenter Initiative.

2 thoughts on “Embedded Linux and Android: Friends or Foes?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.