Darling (software)

Last updated
Darling
Original author(s) Luboš Doležel
Preview release
0.1.20220213 / 13 February 2022;2 years ago (2022-02-13)
Repository github.com/darlinghq/darling
Operating system Linux
Type Compatibility layer
License Various, primarily GPLv3
Website darlinghq.org

Darling is a free and open-source macOS compatibility layer for Linux. [1] It duplicates functions of macOS by providing alternative implementations of the libraries and frameworks that macOS programs call. [2] This method of duplication differs from other methods that might also be considered emulation, [3] where macOS programs run in a virtual machine. [4] Darling has been called the counterpart to WINE for running macOS apps. [5]

Contents

The project started in the summer of 2012 and builds on a previous project, named maloader, which was discontinued due to a lack of time. The layer has been shown to work with many console apps, such as Midnight Commander, The Unarchiver, Python, etc. on the layer, but it also has basic support for graphical applications based on the Cocoa framework. [6] [1] Darling has the ability to extract Apple Disk Images. [7]

The project aims to support iOS applications in the future. [8]

Architecture

At the entry of the Darling system is a loader for Mach-O binaries, the executable format for Apple's operating systems. Darling's predecessor, maloader, presented a maximalist approach to the problem by trying to replicate everything that Apple's dynamic library loader dyld does. This proved to be hard, and since a 2017 "Mach-O transition" Darling has been using a lightweight loader just enough to launch the open-source Apple dyld instead. [9]

To provide the macOS binaries with a kernel, Darling uses a modified XNU kernel (with an APSL license) wrapped into a Linux kernel module with a GPL license.[ needs update ] It is not the same as including GPL code in APSL software, and the APSL license allows for linking from code with a different license (in this case GPL). The module handles the typical job of a Mach kernel, mainly Ports IPC handling. [10] Some licensing issues exist [ citation needed ] in the darling-mach module, as the team are adding GNU GPL modifications to the APSL kernel. [11] [ failed verification ]

Higher than the kernel is the root environment. Darling, like WINE, supports chroot prefixes, implemented using the Linux overlayfs (as opposed to path translation in WINE). PID, IPC, and UTS namespaces are used to create a container for the Darwin system inside.

The frameworks and system libraries in Darling are, to the best possible extent, based on source code released by Apple. The Mach-O transition allows these frameworks to be built more easily, because they are now built as the Mach-O format they were intended for. [9] To fill in the gaps for many higher-level frameworks like Cocoa, Darling uses code from Cocotron, ApportableFoundation, and GNUstep. [1]

License

The larger Darling system is based on many external components which use various licenses, all of which are open-source. The primary license is GPLv3. [12]

Related Research Articles

<span class="mw-page-title-main">GNU Hurd</span> Operating system kernel designed as a replacement for Unix

GNU Hurd is a collection of microkernel servers written as part of GNU, for the GNU Mach microkernel. It has been under development since 1990 by the GNU Project of the Free Software Foundation, designed as a replacement for the Unix kernel, and released as free software under the GNU General Public License. When the Linux kernel proved to be a viable solution, development of GNU Hurd slowed, at times alternating between stasis and renewed activity and interest.

Mach is a kernel developed at Carnegie Mellon University by Richard Rashid and Avie Tevanian to support operating system research, primarily distributed and parallel computing. Mach is often considered one of the earliest examples of a microkernel. However, not all versions of Mach are microkernels. Mach's derivatives are the basis of the operating system kernel in GNU Hurd and of Apple's XNU kernel used in macOS, iOS, iPadOS, tvOS, and watchOS.

<span class="mw-page-title-main">Wine (software)</span> Windows compatibility software

Wine is a free and open-source compatibility layer to allow application software and computer games developed for Microsoft Windows to run on Unix-like operating systems. Developers can compile Windows applications against WineLib to help port them to Unix-like systems. Wine is predominantly written using black-box testing reverse-engineering, to avoid copyright issues. No code emulation or virtualization occurs. Wine is primarily developed for Linux and macOS.

Darwin is the core Unix-like operating system of macOS, iOS, watchOS, tvOS, iPadOS, visionOS, and bridgeOS. It previously existed as an independent open-source operating system, first released by Apple Inc. in 2000. It is composed of code derived from NeXTSTEP, FreeBSD, other BSD operating systems, Mach, and other free software projects' code, as well as code developed by Apple.

In computing, a loadable kernel module (LKM) is an object file that contains code to extend the running kernel, or so-called base kernel, of an operating system. LKMs are typically used to add support for new hardware and/or filesystems, or for adding system calls. When the functionality provided by an LKM is no longer required, it can be unloaded in order to free memory and other resources.

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.

<span class="mw-page-title-main">XNU</span> Computer operating system kernel

XNU is the computer operating system (OS) kernel developed at Apple Inc. since December 1996 for use in the Mac OS X operating system and released as free and open-source software as part of the Darwin OS, which, in addition to being the basis for macOS, is also the basis for Apple TV Software, iOS, iPadOS, watchOS, visionOS, and tvOS.

These tables provide a comparison of operating systems, of computer devices, as listing general and technical information for a number of widely used and currently available PC or handheld operating systems. The article "Usage share of operating systems" provides a broader, and more general, comparison of operating systems that includes servers, mainframes and supercomputers.

<span class="mw-page-title-main">DTrace</span> Dynamic tracing framework for kernel and applications

DTrace is a comprehensive dynamic tracing framework originally created by Sun Microsystems for troubleshooting kernel and application problems on production systems in real time. Originally developed for Solaris, it has since been released under the free Common Development and Distribution License (CDDL) in OpenSolaris and its descendant illumos, and has been ported to several other Unix-like systems.

launchd is an init and operating system service management daemon created by Apple Inc. as part of macOS to replace its BSD-style init and SystemStarter. There have been efforts to port launchd to FreeBSD and derived systems.

<span class="mw-page-title-main">Rosetta (software)</span> Operating system component

Rosetta is a dynamic binary translator developed by Apple Inc. for macOS, an application compatibility layer between different instruction set architectures. It enables a transition to newer hardware, by automatically translating software. The name is a reference to the Rosetta Stone, the artifact which enabled translation of Egyptian hieroglyphs.

<span class="mw-page-title-main">Architecture of macOS</span> Layers of the operating system

The architecture of macOS describes the layers of the operating system that is the culmination of Apple Inc.'s decade-long research and development process to replace the classic Mac OS.

<span class="mw-page-title-main">Apple–Intel architecture</span> Unofficial name used for Macintosh models that use Intel x86 processors

The Apple–Intel architecture, or Mactel, is an unofficial name used for Macintosh personal computers developed and manufactured by Apple Inc. that use Intel x86 processors, rather than the PowerPC and Motorola 68000 ("68k") series processors used in their predecessors or the ARM-based Apple silicon SoCs used in their successors. As Apple changed the architecture of its products, they changed the firmware from the Open Firmware used on PowerPC-based Macs to the Intel-designed Extensible Firmware Interface (EFI). With the change in processor architecture to x86, Macs gained the ability to boot into x86-native operating systems, while Intel VT-x brought near-native virtualization with macOS as the host OS.

<span class="mw-page-title-main">Linux</span> Family of Unix-like operating systems

Linux is both an open-source Unix-like kernel and a generic name for a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution (distro), which includes the kernel and supporting system software and libraries, many of which are provided by the GNU Project.

License compatibility is a legal framework that allows for pieces of software with different software licenses to be distributed together. The need for such a framework arises because the different licenses can contain contradictory requirements, rendering it impossible to legally combine source code from separately-licensed software in order to create and publish a new program. Proprietary licenses are generally program-specific and incompatible; authors must negotiate to combine code. Copyleft licenses are commonly deliberately incompatible with proprietary licenses, in order to prevent copyleft software from being re-licensed under a proprietary license, turning it into proprietary software. Many copyleft licenses explicitly allow relicensing under some other copyleft licenses. Permissive licenses are compatible with everything, including proprietary licenses; there is thus no guarantee that all derived works will remain under a permissive license.

Binary-code compatibility is a property of a computer system, meaning that it can run the same executable code, typically machine code for a general-purpose computer central processing unit (CPU), that another computer system can run. Source-code compatibility, on the other hand, means that recompilation or interpretation is necessary before the program can be run on the compatible system.

<span class="mw-page-title-main">Kernel (operating system)</span> Core of a computer operating system

The kernel is a computer program at the core of a computer's operating system and generally has complete control over everything in the system. The kernel is also responsible for preventing and mitigating conflicts between different processes. It is the portion of the operating system code that is always resident in memory and facilitates interactions between hardware and software components. A full kernel controls all hardware resources via device drivers, arbitrates conflicts between processes concerning such resources, and optimizes the utilization of common resources e.g. CPU & cache usage, file systems, and network sockets. On most systems, the kernel is one of the first programs loaded on startup. It handles the rest of startup as well as memory, peripherals, and input/output (I/O) requests from software, translating them into data-processing instructions for the central processing unit.

<span class="mw-page-title-main">OpenZFS</span> Open-source implementation of the ZFS file system

OpenZFS is an open-source implementation of the ZFS file system and volume manager initially developed by Sun Microsystems for the Solaris operating system and now maintained by the OpenZFS Project. It supports features like data compression, data deduplication, copy-on-write clones, snapshots, and RAID-Z. It also supports the creation of virtual devices, which allows for the creation of file systems that span multiple disks.

<span class="mw-page-title-main">Longene</span> Linux distribution

Longene is a Linux-based operating system kernel intended to be binary compatible with application software and device drivers made for Microsoft Windows and Linux. As of 1.0-rc2, it consists of a Linux kernel module implementing aspects of the Windows kernel and a modified Wine distribution designed to take advantage of the more native interface. Longene is written in the C programming language and is free and open source software. It is licensed under the terms of the GNU General Public License version 2 (GPLv2).

References

  1. 1 2 3 "Darling |". www.darlinghq.org. Archived from the original on 2022-06-16. Retrieved 2022-06-17.
  2. "You Can Now Use 'Darling' to Run macOS Software on Linux | iPhone in Canada Blog". 2020-10-05. Archived from the original on 2022-06-17. Retrieved 2022-06-17.
  3. González, Diego Germán (2021-10-31). "MacOS programs on Linux? With Darling it is possible". Linux Adictos. Retrieved 2022-06-17.
  4. Brodkin, Jon (6 August 2013). "OS X apps run on Linux with Wine-like emulator for Mac software". Ars Technica . Retrieved 23 January 2014.
  5. Lynch, Jim. "Will we ever be able to run OS X apps in Linux with Darling?". InfoWorld. Retrieved 2018-07-23.
  6. "Darling Picks Up New Contributors For Its macOS Compatibility Layer On Linux". www.phoronix.com. Archived from the original on 2022-06-17. Retrieved 2022-06-17.
  7. "Installing software - Darling Docs". docs.darlinghq.org. Retrieved 2022-01-27.
  8. Heath, Nick (15 July 2013). "OS X apps on their way to Linux courtesy of Darling project". ZDNet. Retrieved 23 January 2014.
  9. 1 2 Bugaev, Sergey (24 July 2018). "Mach-O linking and loading tricks" . Retrieved 12 January 2020.
  10. "Build Instructions". Darling. Archived from the original on 2020-01-21. Retrieved 2020-01-12. Darling uses a kernel module to provide certain OS X specific features, mainly Mach Ports IPC. No OS X application can be run without this module, since Libc requires Mach Ports for its initialization and even for very basic things such as sleep().
  11. "Issue: Code from Apple under the APSL is incompatible with the GPL". GitHub. Retrieved 12 January 2020.
  12. "Darling". GitHub . 16 October 2021.