Compatibility layer


In software engineering, a compatibility layer is an interface that allows binaries for a legacy or foreign system to run on a host system. This translates system calls for the foreign system into native system calls for the host system. With some libraries for the foreign system, this will often be sufficient to run foreign binaries on the host system. A hardware compatibility layer consists of tools that allow hardware emulation.

Software

Examples include:
  • Wine, which runs some Microsoft Windows binaries on Unix-like systems using a program loader and the Windows API implemented in DLLs
  • Windows's application compatibility layers to attempt to run poorly written applications or those written for earlier versions of the platform.
  • KernelEX, which runs some Windows 2000/XP programs on Windows 98/Me, and Windows XP programs on Windows 2000.
  • Prism is a Microsoft emulator for ARM-powered Windows devices that translates the underlying code of software built for traditional x86 and x64 binaries from Windows 11 24H2
  • Windows Subsystem for Linux v1, which runs Linux binaries on Windows via a compatibility layer which translates Linux system calls into native windows system calls.
  • Lina, which runs some Linux binaries on Windows, Mac OS X and Unix-like systems with native look and feel.
  • Anbox, an Android compatibility layer for Linux.
  • ACL allows Android apps to natively execute on Tizen, webOS, or MeeGoo phones.
  • Alien Dalvik allows Android apps to run on MeeGo and Meamo. Alien Dalvik 2.0 was also revealed for iOS on an iPad, however unlike MeeGo and Meamo, this version ran from the cloud.
  • Darling, a translation layer that attempts to run Mac OS X and Darwin binaries on Linux.
  • Rosetta 2, Apple's translation layer bundled with macOS Big Sur to allow x86-64 exclusive applications to run on ARM hardware.
  • Executor, which runs 68k-based "classic" Mac OS programs in Windows, Mac OS X and Linux.
  • touchHLE is a compatibility layer for Windows and macOS made by Andrea "hikari_no_yume" in early 2023 to run legacy 32-bit iOS software.
  • ipasim is a compatibility layer for Windows that uses WinObjC to translate code from Objective C to native Windows code.
  • aah is a program for macOS to run iOS apps on macOS 10.15 "Catalina" on x86 processors via translation of the programs via the Catalyst framework.
  • Hybris, library that translates Bionic into glibc calls.
  • 2ine, a project to run OS/2 application on Linux
  • Cygwin, a POSIX-compatible environment that runs natively on Windows.
  • brs-emu is a compatibility layer to run Roku software via BrightScript on other platforms: Web, Windows, macOS, and Linux.
  • FEX-Emu runs x86 Linux applications on ARM64 Linux, and can be paired with Wine to run Windows applications.
  • OneCoreAPI, which attempts to run programs for Windows Vista and newer on Windows XP.
  • VxKex, a set of extensions to let Windows 7 run newer versions of programs meant for Windows 10 and newer.
Compatibility layer in kernel:
A compatibility layer avoids both the complexity and the speed penalty of full hardware emulation. Some programs may even run faster than the original, e.g. some Linux applications running on FreeBSD's Linux compatibility layer may perform better than the same applications on Red Hat Linux. Benchmarks are occasionally run on Wine to compare it to Windows NT-based operating systems.
Even on similar systems, the details of implementing a compatibility layer can be quite intricate and troublesome; a good example is the IRIX binary compatibility layer in the MIPS architecture version of NetBSD.
A compatibility layer requires the host system's CPU to be compatible to that of the foreign system. For example, a Microsoft Windows compatibility layer is not possible on PowerPC hardware because Windows requires an x86 CPU. In this case full emulation is needed.

Hardware

Hardware compatibility layers involve tools that allow hardware emulation. Some hardware compatibility layers involve breakout boxes because breakout boxes can provide compatibility for certain computer buses that are otherwise incompatible with the machine.