MacOS: Difference between revisions

573 bytes added ,  7 days ago
Correct mistaken claims about the architecture of XNU.
[unchecked revision][unchecked revision]
(Significant corrections and expansions)
(Correct mistaken claims about the architecture of XNU.)
 
Line 1:
{{stub}}
 
XNU (acronym for "X is Not Unix") is a [[HybridMonolithic Kernel|hybridmonolithic kernel]] used in macOS. It is based on OSF/MK, a derivative of [[wikipedia:Mach (kernel)|Mach]] 23.50, aand hybrid kernel derived fromon [[wikipedia:Berkeley_Software_Distribution|BSD4.4BSD]]. andIt thewas [[wikipedia:Accentdeveloped kernel|Accent]]for kernel,macOS whichas isa usedwork-alike into macOS.replace Itthe wasthe developedMach for2.5-derived thekernel used in NeXTStep operating system; when Apple purchased NeXT, they opted to use NeXTStep as a technological basis to replace the obsolete classic Mac OS (Mac OS 9 and older), which had poor memory protection and cooperative multitasking.
 
macOS is Apple's partly proprietary operating system for Macintosh computers, which is, in fact, able to becan run on anymany modern x86-64 computercomputers; it also has a mobile version, iOS, and other specialised editions: tvOS and watchOS.
 
Darwin is the term for the core BSD UNIX system which macOS builds atop.
Line 9:
== Features ==
 
XNU as a direct derivative fromof 4.3BSD4BSD inherits most of its features, as well as some features imported from other BSD systems such as FreeBSD. Features of BSD heritage include:
* POSIX system calls and the various BSD extensions;
* the [[Wikipedia:Kqueue|kqueue]] event multiplexing system, a later import from FreeBSD;
* [[wikipedia:Mandatory_access_control|Mandatory Access Control (MAC)]], developed through the TrustedBSD project in collaboration with FreeBSD.
 
And XNU and OS X introduce a lot of specific features, including:
Line 41:
This feature is present in both OS X and iOS, but in iOS it is much harder. In fact, it is a jail, which places applications inside their own environment, from which they can only access their own root. More about app sandbox [https://developer.apple.com/library/mac/documentation/Security/Conceptual/AppSandboxDesignGuide/AboutAppSandbox/AboutAppSandbox.html here].
 
== Hybrid Kernel Design ==
macOS is derived from the Mach 2.5 operating system, a derivative of the 4.3BSD UNIX system which rearchitected the lowest levels of the BSD kernel. The primary inspiration for this redesign was the Accent kernel developed at Carnegie-Mellon University. Mach made several adaptations to the Accent model to better support UNIX compatibility.
 
macOS is derived from the OSF/MK kernel, a variant of Mach, and from 4.4BSD UNIX. Mach originated as a system which rearchitected the lowest levels of the BSD kernel <ref>Accetta et al. (1986). ''[https://cseweb.ucsd.edu/classes/wi11/cse221/papers/accetta86.pdf Mach: A New Kernel Foundation for UNIX Development]''. USENIX Summer Conference 1986. Retrieved June 25, 2024.</ref> and initially retained most of the BSD kernel as a component layered on top of the Mach primitives, thus remaining a monolithic kernel. The primary inspiration for this redesign was the Accent kernel developed at Carnegie-Mellon University. Mach made several adaptations to the Accent model to better support UNIX compatibility. NeXTSTEP forked their variant of Mach from a version in which this was the case. Later versions of Mach from version 3.0 onwards, such as OSF/MK, were [[microkernel]] systems.
The core abstractions of the Mach kernel are four: tasks, threads, ports, port sets, messages, and memory objects. The BSD kernel is adapted to use these underlying Mach abstractions to provide a complete higher-level BSD UNIX system.
 
In order to maintain similar properties to the NeXTSTEP kernel, while avoiding the use of the then-encumbered 4.3BSD UNIX source tree, Apple developed XNU on the basis of the unencumbered OSF/MK and 4.4BSD-Lite2 codebases. The resulting kernel uses the core abstractions of the Mach kernel, which include tasks, threads, ports, port sets, messages, and memory objects, as a basis on which the adapted BSD kernel provides the higher-level BSD interfaces. As the 4.4BSD code runs as an integral part of the kernel, the result is a layered [[monolithic kernel]], although the marketing term [[Hybrid Kernel]] is often used in reference to XNU.
A later version of Mach, version 3.0, was able to detach the new low-level abstraction layer from the BSD kernel, yielding a [[Microkernel]], where the BSD kernel was replaced with userland servers carved out from the BSD kernel code. XNU, however, was forked from Mach 2.5, which had not yet done so. While some improvements were imported from Mach 3.0, Apple opted not to separate the BSD kernel into userland servers. Thus XNU represents the [[Hybrid Kernel]] approach.
 
== See Also ==
 
=== Articles ===
* [[Microkernel]]
* [[Hybrid Kernel]]
 
=== External Links ===
* http://opensource.apple.com - here you can obtain sources of all open source components.
 
== References ==
 
<references/>
4

edits