Many embedded developers - faced with problems of developing apps for multi-core CPUs and finding ways to maintain the security of their proprietary code in systems where an RTOS shares space with Linux or Windows - are looking jealously at the use of so-called virtual machine monitors on desktop computers and in servers.
By installing and software that enable virtualization, said Casey Weltzin of National Instruments, IT organizations have saved millions of dollars in equipment and energy costs in the past several years. So, it should come as no surprise that embedded developers are looking to do likewise in their more space, cost and memory constrained app.
With Gerardo Garcia, also of National Instruments, Weltzen is teaching a class at the Embedded Systems Conference, titled "Selecting a virtualization architecture for embedded systems[ESC-304]".
Weltzin warns that not all virtualization machine monitors are created equa, and it is necessary to carefully sort through the different embedded VMM offerings now available and determine whether or not they fit the application in which you wish to use it.
VMMs, whether on the desktop or in embedded apps, he said, can be broken up into two broad categories: hosted and so-called "bare-metal" native virtualization.
Hosted Virtualization. In this type of VMM architecture, one or more virtual machines depend on a non-virtualized host operating system for existence and support.
The host operating system, said Weltzin, provides fundamental services such as memory management, CPU scheduling, and I/O drivers. Several software pieces run within the host operating system and at the kernel layer to support the virtual machine which then runs a guest operating system.
This architecture is used to provide end-user virtualization solutions for running multiple operating systems on a PC without requiring specialized hardware. Two of the most widely known consumer-oriented virtualization tools, such as VMware Workstation and Parallels Desktop for the Mac, use this type of virtualization architecture.
Bare-metal native virtualization uses features built into the processor hardware to isolate individual virtual machines. "Bare-metal virtualization differs from hosted virtualization," he said, "in that there is no host operating system that has more access to hardware than guest operating system. "
The hypervisor sits below all operating systems and manages the traffic to shared hardware resources. "This technique also allows real-time operating systems to be used within a virtualized context," said Weltzin. "Most of the virtualization products that focus on embedded and real-time performance use this native type of real-time virtualization.
Bare-metal virtualization differs from hosted virtualization in that there is no host operating system that has more access to hardware than guest operating system.
"The hypervisor sits below all operating systems and manages the traffic to shared hardware resources," he said. "This technique also allows real-time operating systems to be used within a virtualized context. "
Matching your app to the right VMM
According to Weltzin, the hosted virtualization architecture is ideal for a broad set of applications including software testing and consumer use. One of the main applications of hosted virtualization is for testing software on multiple operating setups without requiring a large bank of hardware to support each operating system.
"Embedded systems designers can take advantage of hosted virtualization tools to maintain various development setups that could include a set of installed development environments, simulators, and other debugging tools," he said. "Additionally, technical sales managers can use virtual images to demonstrate the latest software versions of various tools or demonstrate their use in multiple operating systems.
However, said Weltzin, the hosted virtualization architecture is less applicable to deployed embedded systems. Embedded designers of soft real-time systems may find benefit in using hosted virtualization to run Windows and Linux for some applications. However, there are several reasons why hosted virtualization is not ideal for hard real-time applications.
First, most embedded systems have specialized I/O needs and performance requirements. Among other things, he said, hosted virtualization is subject to higher interrupt and I/O latencies that are not deterministic. Second, many off-the-shelf I/O devices and most custom I/O devices are not supported inside virtual machines with the hosted virtualization I/O model.
For these reasons, said Weltzin, for deployed embedded applications the bare-metal native approach may be the best option, especially where there is a need to run an RTOS along side a general purpose OS like Linux or Windows.
"This type of system configuration can be used in any embedded system that requires a rich user interface," he said. "By providing both real-time control and rich user interface and data services in one physical system, system engineers can reduce the physical footprint of their physical system, reduce maintenance costs, and get more from their hardware."
"With bare-metal virtualization, embedded designers can take advantage of running multiple operating systems on the same processor to add more value," said Weltzin, "by adding richer visualizations, creating systems with smaller footprints, reducing the cost of systems, or making software more secure.
"As the number of processor cores grows, it is possible that a large number of embedded systems will use virtualization technology in the near future."
If you want to learn more about embedded virtualization, you might also want to attend "Hardware and Software Assists in Virtualization ) [ESC-426]", taught by Greg Shippen of Wind River.