The Importance of Translation: Facilitating a Smooth Transfer from CISC to RISC
ADLINK supports a wide range of Computer-on-Module-based embedded hardware that finds its way into a multitude of industries such as medical, gaming, industrial automation, test and measurement, data- and telecommunication, and energy and transportation.
Embedded computers are specialized computing systems designed to perform specific functions or tasks within a larger system. Unlike general-purpose computers, such as personal computers or servers, embedded computers are built to handle a single set of tasks or functions efficiently and reliably. Key requirements of these computers are prolonged availability, of up to 10 years or more, and being able to operate in rugged or harsh environments.
Traditionally, the embedded market has been heavily centered on x86-based designs and so has its code base. Looking instead at the commercial market, arm-based designs have been exhibiting an ever growing market share. One of the major reasons for arm’s success, relative to x86, in the mobile phone market is its extremely low power consumption that is critical to battery-powered applications.
Although it may look like stationary system are therefore exempt, nothing less is true because low power consumption leads to lower CO2 emission, which is a prominent trend for the future. In due to this, arm-based computers are also rapidly encroaching on the traditional x86 embedded domain both in the low- and high-end markets.
To facilitate this transition, ADLINK has several Computer-on-Module form factors in its portfolio that are cross platform (x86 and arm capable) to simplify such a move.
For example, SMARC modules, with a power envelope of max. 15 watts, are available with x86 based Intel silicon as well as with NXP, MediaTek, Qualcomm, Rockchip arm based silicon.
COM HPC Server modules, with a power envelope of max. 350 watts, are available with x86 -based Intel silicon as well as up to 128-core Ampere Altra arm-based silicon.
Though moving to arm-based hardware seems easy enough, it is not that simple on the software side. Most embedded computers are used for applications that are not new but having a long history with additional x86 legacy code tie-ins in on the software side. Just transitioning from x86-64 code on Linux to arm64 code can be a huge task that cannot simply be done in a single iteration of a product family. There will also be issues when a customer’s code has dependencies on legacy, closed sources where a transition to arm code might be impossible!
How to solve this problem of running either x86 code on arm or at least do this temporarily to give a software team more time to rewrite (and fully test !) the code into arm code?
Solutions for the above can actually be found in the commercial market. Apple and Microsoft are two leading companies dealing with these issues right now.
Apple computers made the choice to move away from Intel processors in favor of their own arm-based M1 designs. Apple pulled it off by offering a translation layer called Rosetta 2 that allows you to use Apple x86-based applications on Apple Macs with M1 arm. They achieved this without significant loss in performance.
The importance of x86 emulation on ARM-based computers is therefore quite significant and has several implications for both end-users and developers.
- Software Compatibility: Many software applications and tools were developed for the x86 architecture, which has been the standard in the embedded industry for a long time. Transitioning to ARM architecture could potentially leave users with applications that are not immediately compatible with the new ARM-based machines. Emulation allows these existing x86 applications to run on the new ARM hardware without requiring developers to recompile or users to find alternative software.
- Smooth Transition: Emulation provides a smoother transition path for users and developers when moving from one architecture to another. This is especially important for professional users who rely on specific software for their work and may not have ARM-native alternatives immediately available.
- Developer Flexibility: Developers who haven't yet updated their software for ARM architecture can still run their x86 versions on ARM systems during the transition period. This provides more time for them to update and optimize their software for the new architecture.
- Cross-Platform Development: Emulation allows developers to test and debug their software on both x86 and ARM platforms without needing separate hardware for each architecture. This can streamline development processes and help ensure compatibility.
- Hardware Availability: Emulation enables users to use ARM-based systems without being limited by the availability of ARM-native software. This is particularly valuable during the early stages of the transition when the ARM software ecosystem might still be growing.
- System Utilities and Tools: System utilities and tools that have not yet been updated for ARM architecture can still run on ARM-based systems through emulation, ensuring that essential functions are not compromised.
- Performance and Battery Life: While emulation does introduce some performance overhead, it's worth noting that Apple's ARM processors are designed for high performance and energy efficiency. Many users find that emulated x86 software performs well on ARM-based Macs consuming less power.
Microsoft is following a similar path with their Windows WOW64 emulator, which enables x86-coded applications to run unmodified on arm64 computers. For example, their key Office applications like Word and Excel have already been ported to arm native code. Other parts of their Office suite that are being ported right now, still run x86-64 code through WOW64.
In summary, coming from x86 based platforms, x86 emulation on arm-based computers is crucial for maintaining software compatibility, ensuring a smooth transition, and providing users and developers with a flexible and versatile pathway during that shift.
What about the state of x86 translation on Linux
Although there are several x86 translations to choose from, two initiatives stand out — QEMU and Box86.
QEMU is an open-source emulator that supports a wide range of host and guest architectures, including x86, ARM, MIPS, PowerPC, and more. It is not limited to a specific platform and is available on multiple operating systems. QEMU provides system emulation and user mode emulation. The user mode emulation allows you to run individual applications of different architectures on your host system.
Box86 & Box64 are dynamic binary translators, and therefore primarily application-level emulators, focusing on running individual x86 applications rather than entire operating systems. Box86/64 is known for its emphasis on performance, and is optimized for running specific x86 applications efficiently on ARM platforms. Its design aims to deliver a smooth experience when running these applications. Box86 provides dynamic recompilation as well as functionality to intercept dynamic library calls and forward them to equivalent native libraries, allowing applications to run much faster than if they were fully emulated.
Box86 / Box64 performance
Here are some interesting performance results comparing the different emulators: QEMU, Apple Rosetta 2, FEX and Box86 /Box 64
https://box86.org/2022/03/box86-box64-vs-qemu-vs-fex-vs-rosetta2/
On the same page you will find an interresting comparision between Rosetta2 and Box64, running both on a MacBookPro with a M1. Rosseta2 obviously inside the macOS and Box64 inside Asahi (Linux on Apple Silicon). Test item is an x86_64 version of 7z. Rosseta2 achieves 71% versus native execution (arm64 version of 7z) and Box64 achieves 57% without any optimizations. Meaning Box64 achieves 80% of Rosetta2’s translation speed running 7z.
Box86 / Box64 compatibility
A detailed instruction to prove Box86’s maturity in running complex tasks, even under a desktop environment, can be found here:
https://docs.ipi.wiki/com-hpc/aadp/Running_Steam_on_Ampere_Altra.html
The above article explains how to run Linux-based Steam x86 version on the Ampere Altra Development System. A detailed list with x86-based application compatibility can be found here:
Running Box86 & Box64 inside a Docker container
A further interesting pointer is to an experiment where an x86-64-based application together with box64 running inside a docker container on an arm64-based system.
https://github.com/tristanmorgan/bedrock-box
bedrock-box is a repackaging of LomotHo/minecraft-bedrock but with Box64 emulation to run on ARM.
Need help?
ADLINK is actively supporting its embedded customers with above solutions to make their transition from legacy x86 based applications to arm64 as simple and transparent as possible.