Electronicdesign 1904 Xl schniderman

Operating Environments Emerge As Mobile Devices Multiply

Dec. 13, 2009
Mobile devices are hot this year and there is an array of software platforms from Android to Windows that developers are targeting.

Mobile devices are hot. This is especially true in the smartphone market with products like Apple’s iPhone and the Verizon Wireless Droid. The hardware on these platforms is impressive, but the software and the service infrastructure around the systems really make the difference.

The large number of iPhone applications highlights how easy a good development platform can make application delivery. The iPhone may be popular, but its software platform is designed for a limited number of hardware platforms, all from Apple.

The Symbian OS (operating system) and framework address the same realm as the iPhone, but Symbian targets a wider range of platforms, including ARM-based smart phones. Symbian OS is now an open-source project hosted by the Symbian Foundation.

Android is similar to these OS frameworks, and its initial target is smart phones. That isn’t surprising given its sponsor, the Open Handset Alliance. The thing that makes a difference with Android is the level of interest for using it on platforms other than smart phones. If developers are going to take advantage of Android, they need to know how it works. For a contrast to Android, consider two other platforms that address hardware in this space.

One of the most popular is Microsoft’s Windows CE, known as Windows Mobile in the smart-phone market. But its underlying framework architecture is the same as that found on Microsoft’s desktop and server platforms, including the latest desktop version, Windows 7.

The next platform in the mix, Moblin, is based on Linux, just like Android. It suits netbooks and mobile Internet devices (MIDs) that utilize the Intel Atom. In this aspect, Moblin is similar to the Apple and Symbian solution, where a certain class of hardware is the base.

All three platforms are distinct, but they share many types of common components. For example, Android and Microsoft’s .NET framework are both built around virtual-machine (VM) technology.

ANDROID’S ANSWER
“Android takes the complexity out of Linux and provides developers an easy-to-use and widely known environment from Google for GUI (graphical user interface) creation, keeping their focus on making solutions compelling for embedded systems far beyond just handsets,” says Jason Kridner, open platform technologist with Texas Instruments.

“This makes it a great operating system for OMAP 3 processorbased designs, such as TI’s OMAP35x evaluation module or the immensely popular community-supported BeagleBoard, allowing open-source innovators to build on a small, low-cost ARM Cortex-A8-based system with high performance and low power,” Kridner adds.

Based on Linux, Android uses native device drivers to provide a set of services to the underlying Android framework. Native applications can run on the system, and it’s possible for them to access these services, but most applications will be written in Java and target the Dalvik VM (Fig. 1). These applications can also take advantage of the application framework that provides the user interface familiar to users of the Verizon Wireless Droid, which is one of the latest Android smart phones (Fig. 2).

The Dalvik VM (DVM) runs Dalvik Executable (.dex) files. These compiled Java applications resemble class files used with a Sun Java virtual machine ( JVM). Conceptually, there is little difference from an application level between a DVM and a JVM. Architecturally, there is a major difference between the registerbased DVM and the stack-based JVM.

Both use a VM code model. However, the DVM uses registerbased opcodes that are comparable to the register-based bytecode instructions that most of the target platforms already execute. This includes architectures such as those available from ARM and MIPS and the x86-compatible architectures from Intel, AMD, and VIA Technologies.

Google developed Android and chose DVM for several reasons. First, there were licensing issues with most JVMs. Next, the DVM should be more efficient in terms of memory usage and performance on a register-based machine. DVM is also supposed to be more efficient when running multiple instances of the DVM. Applications are given their own instance. Hence, multiple active applications require multiple DVM instances. Like most Java implementations, the DVM has an automatic garbage collector.

It’s going to be interesting to see if these advantages pan out in the long run or especially as memory capacity and processor performance on the targets increases. At this point, the DVM does not support just-in-time (JIT) compilation. On the other hand, the dex files can be optimized for the hardware when the files are loaded into the system.

As noted, Android has its own Java classes for the services it provides. These are comparable but not identical to the kinds of class services provided with Java SE or Java ME from Sun. Android does not support the graphical AWT and Swing libraries common for Sun-style platforms.

Instead, Android has its own user-interface classes, including support for OpenGL. The base set of classes will be found on smart-phone platforms including interfaces like Bluetooth and the telephony interface. They may not be required on other embedded Android platforms.

The Android software development kit (SDK) is a free download from the Android Web site. It can be used with a range of development tools. The Android Development Tool (ADT) Eclipse plug-in allows Android applications to be developed using the open-source Eclipse platform. This includes the large number of third-party toolsets based on Eclipse like Mentor Graphics’ ESD.

Mentor Graphics also provides Android support services. This brings up another issue that many Android developers overlook, Android platform support. Application developers will need the Android SDK. Putting Android on a new platform is another matter. Android does run on Linux, but this brings up the same support issues. That’s why OS vendors like MontaVista, Lynuxworks, and Mentor Graphics do most Linux porting.

Managing and supporting changes is a major effort. This is also true for Android, which runs on top of Linux. Currently, Android changes and enhancements are coming from Google. This may change in the future, but it still means that customizations, bug fixes, and other modifications will need to be incorporated and tested with any new release.

MOBLIN A MATCH FOR ATOM
Moblin and Intel’s Atom are intertwined. Moblin is built on an x86 Linux stack that adds a user interface and applications designed to simplify interaction with the system (Fig. 3). Its display is conducive to touchscreens and targets midsize screens such as those found in target platforms such as netbooks, MIDs, and automotive head units (Fig. 4).

Compared to desktops and full-size laptops, the midrange target for Moblin tends to have smaller screens and lower-power processors with more limited processing power, so power management is critical. Applications need to be responsive but able to deal with more limited resources.

Applications and application services are native Linux applications, which allows the use of existing Linux development. The QT and GTK GUI libraries are already used to build the main Linux GUIs, Gnome and KDE. This means most existing applications could be ported to Moblin without major changes. Still, moving from a general windowing environment like Gnome or KDE to a more restrictive framework like Moblin can be a challenge depending upon the application and its architecture. Moblin supports a range of graphical interfaces found on Linux, including X Windows and OpenGL.

Moblin does bring more than a user interface and rendering libraries. Its communication subsystem provides telephony, cellular, and IP-based (Internet Protocol) services such as Voice over IP (VoIP). Location-based services, device synchronization, and content management are just a few of the many libraries available to Moblin hosted applications.

For example, mojito provides social Web service support. Multimedia support includes bickley for managing multimedia metadata and bognor-regis for managing multimedia playlists.

At this point, C is the programming language of choice given the library services approach. C++ will be equally at home, but Linux supports every major programming language. So does Moblin. Bindings for core Moblin application programming interfaces (APIs) exist for languages like Ruby and Python.

Intel’s recent purchase of Wind River should not be much of a surprise given Moblin. Wind River Linux and associated development tools are an excellent match with Moblin. Wind River was already working with Intel and Moblin before this occurred.

Moblin is not exclusively an Atom or Wind River offering. It’s showing up on other Linux platforms such as Ubuntu and Xandros. The Ubuntu Moblin Remix joins Canonical’s Ubuntu Netbook Remix. Dell will be delivering the Ubuntu Moblin Remix for the Atom processor-based Dell Inspiron Mini 10v netbook.

Moblin is incorporating the latest in Linux enhancements. Its fast boot time is a major feature. Features such as touchscreen and gesture support are inline for inclusion as well. Handsets may become a target as new x86 processors continue to lower power requirements. Moblin has garnered support from some major players in addition to Intel, making it a significant factor for platforms in this space.

ARMING LINUX
The x86 rules the netbook market, but MIDs and smartbooks will have significantly more platforms to target including platforms based on architectures from ARM and MIPS. Windows CE is a possible platform for these other architectures, though Debian Linux and variations such Ubuntu are likely to dominate this segment.

Many of the developers of the Debian-based Linux distributions such Ubuntu, Xandros, and ThunderSoft are cooperating. As a result, it’s likely that similar platforms will be available on various products using the same Linux kernel and a similar complement of runtime libraries.

What is currently lacking in this arena is a consistent development and presentation framework among the various system providers. Most are already working with Google on Android, but it remains to be seen whether Android on non-phone platforms will be out in time. A more likely scenario is conventional Debian implementation with a complement of applications provided by the hardware vendor.

LIGHTWEIGHT LONGINGS
Google has announced the Google Chrome Operating System. It will be centered around the Chrome browser, which currently runs on all major platforms. This is another Linux-based platform, but it is a minimal system where the browser will provide the application framework.

The approach still has plenty of wiggle room before it is ever deployed. The key aspects of the system design include speed, simplicity, and security. Startup to Web browsing should be on the order of a couple seconds.

Some big questions still need to be addressed along this path, especially with respect to untethered operation. Web-based applications are fine when a 3G or Wi-Fi connection is available, but standalone applications that are most common on all the other platforms discussed here may have issues. Some initial approaches take a dual boot approach with a full set of applications on the more conventional Linux or Windows implementation.

MICROSOFT'S MOBILE SOLUTION
Windows Embedded CE is at the heart of Microsoft’s mobile solution. As with Microsoft’s other Windows solutions, Windows CE incorporates the .NET Framework (Fig. 5). It’s possible to write programs that run on any one of the various Windows platforms, but the .NET Framework allows an application to run on almost any Windows operating system. This includes platforms such as Windows Mobile, a Windows CE variant that runs on a wide range of smart phones like the HTC Touch 2 (Fig. 6).

The .NET Framework is based on a VM architecture like Dalvik and JVM. Microsoft’s Common Language Runtime (CLR) is designed to execute Common Intermediate Language (CIL) bytecodes in a virtual stack machine similar to a JVM.

The Common Language Infrastructure (CLI) is an open ECMA-335 and ISO/IEC 23271 specification that describes CIL, the CLR runtime environment, as well as the Common Type System (CTS) and runtime assemblies. Mono and DotGNU Portable.NET are two opensource implementations of the CLI that run on a range of non-Windows platforms such as Linux.

JVMs currently support programming languages other than Java, but Java was their primary target. However, .NET was always intended as a multilanguage host. The .NET Framework supports dozens of programming languages from a variety of sources. Everything from Cobol to F#, a functional programming language, will run on the .NET Framework.

The CLI can be implemented as an interpreter that runs CIL code. Like Java, though, a CIL JIT compiler brings higher performance by converting the application to native code. This approach offers the advantage of moving optimization to the JIT. Ahead-of-time (AOT) compilation to native code is also possible. This locks down the executable to the current platform but eliminates the startup delay that a JIT requires.

Compilers still need to generate efficient CIL code, but they don’t have to be concerned about optimizing the target hardware for execution. Garbage collection is part of the puzzle. C# has pointer types, but these variables can only refer to value types and arrays. Reference variables are the way to track data with languages like C#.

CIL code is also considered “managed code” that runs within the CLR, which provides services such as thread and memory management. Applications must run within the CLR’s security confines. It’s possible to have native code that’s managed. Visual C++ .NET is one language environment that can generate CIL managed and native unmanaged code.

The advantage of managed code is programmer convenience courtesy of a higher level of abstraction. The approach significantly enhances security. Interaction between applications written in different programming languages is significantly easier. The CTS makes this possible.

The VM and low-end-run time is critical to performance and efficiency, but the .NET Framework’s class libraries make the difference. Most of the base class libraries are found in every .NET Framework platform.

The .NET Micro Framework is the exception (see “A Small .NET Makes A Big Catch”). It runs on bare metal, with no Windows operating system. It’s also modular, allowing a minimal footprint. The .NET Micro Framework targets the low end of the spectrum below platforms like Android and Moblin. It can be found on microcontrollers in applications such as process control.

The latest version of the .NET Micro Framework is available as open source using the Apache license. The CLI is implemented only as an interpreter, but the .NET framework native code interface is supported.

The .NET Micro Framework will likely find its way into devices that will wind up being controlled by higher-end .NET Framework devices such as cell phones. Having a common programming platform can come in handy.

The typical .NET Framework environment includes significantly more class libraries than .NET Micro Framework. Graphics, forms, and advanced database libraries are common. Classes for telephony and communication will be found in Windows Mobile platforms.

Many of the .NET Framework class libraries, including the base classes, are available with Mono. This allows applications that will run on Mono or .NET Framework to be written. The problem for developers is that taking real advantage of .NET Framework means using classes above the base set like the Windows Communication Foundation (WCF) and the Windows Workflow Foundation (WF). The application class libraries and services such as those needed by smart phones will be found running Windows Mobile.

The .NET Framework and Windows are so intertwined at this point, they’re inseparable. Native code applications that use Windows interfaces such as COM can coexist with .NET Frameworkbased applications, but the latter is where the bulk of development is. It’s also where development applications for Windows-based mobile devices is occurring.

Microsoft’s Visual Studio has been the main development platform for applications that take advantage of the .NET Framework. Most .NET programming languages utilize the Visual Studio integrated development environment (IDE). Several debuggers are available, such as the CLR debugger. Visual Studio supports other debugging tools, including support for unmanaged applications even in a mixed-application environment.

Overall, .NET Framework is an expansive and impressive platform that matches or exceeds most of its competition. It handles advanced user-interface support multitouch interfaces. Windows 7 also incorporates .NET Framework, so platforms such as Intel’s Atom are a natural fit. Windows 7 netbooks are likely to be the norm very soon. The leaner Windows 7 and the power of the .NET Framework are a killer combination.

The iPhone App Store, the Android Market, and the Windows Marketplace for Mobile will be major factors in the success of the matching mobile devices. The underlying frameworks on these devices need to be a good development target to be a success. The success of the App Store highlights the iPhone platform.

Windows with .NET and Linux in its various incarnations including Android and Moblin will continue to crop up in new hardware platforms. They will still have major competition in the smart-phone arena with the iPhone and Symbian, but that’s only a part of the embedded space.

Sponsored Recommendations

Near- and Far-Field Measurements

April 16, 2024
In this comprehensive application note, we delve into the methods of measuring the transmission (or reception) pattern, a key determinant of antenna gain, using a vector network...

DigiKey Factory Tomorrow Season 3: Sustainable Manufacturing

April 16, 2024
Industry 4.0 is helping manufacturers develop and integrate technologies such as AI, edge computing and connectivity for the factories of tomorrow. Learn more at DigiKey today...

Connectivity – The Backbone of Sustainable Automation

April 16, 2024
Advanced interfaces for signals, data, and electrical power are essential. They help save resources and costs when networking production equipment.

Empowered by Cutting-Edge Automation Technology: The Sustainable Journey

April 16, 2024
Advanced automation is key to efficient production and is a powerful tool for optimizing infrastructure and processes in terms of sustainability.

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!