Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

XNU

From Wikipedia, the free encyclopedia
Computer operating system kernel

Not to be confused withGNU orXinu.
Operating system
XNU
The XNU kernel
DeveloperApple Inc.
Written inC,C++,assembly language
OS familyUnix-like,Unix[1]
Working stateCurrent
Source modelOpen-source
Initial releaseDecember 1996; 28 years ago (1996-12)
Repository
Supported platformsCurrent:x86-64,64-bit ARM,32-bit ARM (32-bit ARM support is closed-source)
Historical:PowerPC (32-bit and 64-bit),IA-32
Kernel typeHybrid
LicenseApple Public Source License 2.0
Preceded byMach,Nukernel
Official websitegithub.com/apple-oss-distributions/xnu

XNU ("X is Not Unix") is the computeroperating system (OS)kernel developed atApple Inc. since December 1996 for use in the Mac OS X (nowmacOS) operating system and released asfree and open-source software as part of theDarwin OS, which, in addition to being the basis for macOS, is also the basis foriOS,iPadOS,watchOS,visionOS, andtvOS.[2]

XNU was originally developed byNeXT for theNeXTSTEP operating system. It was ahybrid kernel derived from version 2.5 of theMach kernel developed atCarnegie Mellon University, which incorporated the bulk of the4.3BSD kernel modified to run atop Mach primitives, along with anapplication programming interface (API) inObjective-C for writing drivers named DriverKit.[3]

After Apple acquired NeXT, the kernel was updated with code derived fromOSF MK 7.3 fromOSF,[4] and theFreeBSD project, and the DriverKit was replaced with new API on a restricted subset ofC++[5] (based onEmbedded C++)[6] named IOKit.

By keeping the BSD kernel into the third part of XNU,[7] XNU became UNIX-based when macOS achieved UNIX certification under the Single UNIX Specification (SUS) by The Open Group.[8] Despite this, Apple retained the original 'XNU' name, which stands for 'X is Not Unix,' a relic from its NeXTSTEP origins before macOS was UNIX-certified. This has led to confusion, as the name suggests that XNU is separate from UNIX, even though macOS, as a whole, is officially recognized as a UNIX operating system.[1]

Kernel design

[edit]

XNU is ahybrid kernel, containing features of bothmonolithic kernels andmicrokernels, attempting to make the best use of both technologies, such as themessage passing ability of microkernels enabling greater modularity and larger portions of the OS to benefit frommemory protection, and retaining the speed of monolithic kernels for some critical tasks.

As of 2021[update], XNU runs onARM64 andx86-64 processors, both one processor andsymmetric multiprocessing (SMP) models.PowerPC support was removed as of the version inMac OS X Snow Leopard. Support forIA-32 was removed as of the version inMac OS X Lion; support for 32-bit ARM was removed as of the version iniOS 11.

Mach

[edit]
Main article:Mach (kernel)

The basis of the XNU kernel is a heavily modified (hybrid)Open Software Foundation Mach kernel (OSF MK) 7.3.[4] OSF MK 7.3 is a microkernel[9] that includes applicable code from theUniversity of Utah Mach 4 kernel and from the many Mach 3.0 variantsforked from the originalCarnegie Mellon University Mach 3.0 microkernel.

OSF MK 7.3 is able to run the core of an operating system as separated processes, which allows a great flexibility (it could run several operating systems in parallel above the Mach core), but this often reduces performance[citation needed] because of time-consuming kernel/user mode context switches and overhead stemming from mapping or copying messages between the address spaces of the kernel and that of the service daemons.

Apple licensed OSF MK 7.3 from the OSF, and attempted to streamline some tasks by buildingBSD functions into the kernel along with the Mach code. The result is a heavily modified (hybrid) OSF MK 7.3 kernel.

BSD

[edit]

TheBerkeley Software Distribution (BSD) part of the kernel provides the Portable Operating System Interface (POSIX)application programming interface (API, BSD system calls), theUnix process model atop Mach tasks, basic security policies, user and group ids, permissions, the networkprotocol stack (protocols), thevirtual file system code (including afile system independentjournaling layer), several local file systems such asHierarchical File System (HFS,HFS Plus (HFS+)) andApple File System (APFS), theNetwork File System (NFS) client and server, cryptographic framework,UNIX System Vinter-process communication (IPC), audit subsystem,mandatory access control, and some of the locking primitives.[10] The BSD code present in XNU has been most recently synchronised with that from theFreeBSD kernel. Although much of it has been significantly modified, code sharing still occurs between Apple and the FreeBSD Project as of 2009[update].[11]

K32/K64

[edit]

XNU inMac OS X Snow Leopard, v10.6, (Darwin version 10) comes in two varieties, a32-bit version calledK32 and a64-bit version calledK64.[12] K32 can run 64-bit applications inuserland.[13] What was new in Mac OS X 10.6 was the ability to run XNU in 64-bitkernel space. K32 was the default kernel for 10.6Server when used on all machines exceptMac Pro andXserve models from 2008 onwards[14] and can run 64-bit applications. K64 has several benefits compared to K32:[15]

  • Can manage more than 32 GB RAM, as thememory map would consume a disproportionately large area of the 32-bit kernel space.
  • Cache buffer sizes can be larger than what the 32-bit kernel space allows, potentially increasing I/O performance.
  • Performance is increased when using high-performance networking devices or multiplegraphics processing units (GPUs), as the kernel can map all of the devices in 64-bit space even if several have very largedirect memory access (DMA) buffers.

Booting while holding down6 and4 forces the machine to boot K64 on machines supporting 64-bit kernels.[16] K64 will run 32-bit applications but it will not run 32-bitkernel extensions (KEXTs), so these must be ported to K64 to be able to load.

XNU inOS X Mountain Lion (10.8) and later only provides a 64-bit kernel.

IOKit

[edit]

IOKit is thedevice driver framework, written in a subset ofC++ based onEmbedded C++.[17] Using itsobject-oriented design, features common to any class of driver are provided within the framework, helping device drivers be written in less time and code. IOKit is multi-threaded,symmetric multiprocessing (SMP)-safe, and allows for hot-pluggable devices and automatic, dynamic device configuration.

Many drivers can be written to run inuser mode, which further enhances the stability of the system. If a driver running in user mode crashes, it will not crash the kernel. However, if a driver running in kernel mode crashes it will crash the kernel. Examples of drivers running in kernel mode include disk adapter and network adapter drivers, graphics drivers, drivers for Universal Serial Bus (USB) andFireWirehost controllers, and drivers forvirtual machine software such asVirtualBox,Parallels Desktop for Mac, andVMware Fusion. InmacOS Catalina and later releases, DriverKit allows some of those types of drivers to run in user mode.[18]

See also

[edit]

References

[edit]
  1. ^ab"Open Brand".
  2. ^"Porting UNIX/Linux Applications to Mac OS X: Glossary". Apple Computer. 2005. RetrievedJune 7, 2017.
  3. ^"XNU GitHub source code README".GitHub. December 16, 2021.
  4. ^abMagee, Jim.WWDC 2000 Session 106 – Mac OS X: Kernel. 14 minutes in.Archived from the original on December 21, 2021.
  5. ^"The libkern C++ Runtime".IOKit Device Driver Design Guidelines.
  6. ^Amit Singh."What is Mac OS X?". Archived fromthe original on April 19, 2019. RetrievedMarch 4, 2015.
  7. ^"How Mac OS X Works".HowStuffWorks. August 8, 2011. RetrievedMarch 12, 2025.
  8. ^McKay, Dave (October 21, 2019)."Is macOS UNIX? (and What Does That Mean?)".How-To Geek. RetrievedMarch 12, 2025.
  9. ^Wells, Douglas M. (1994).A Trusted, Scalable, Real-Time Operating System Environment(PDF). 1994 IEEE Dual-Use Technologies and Applications Conference.S2CID 5205380. Archived fromthe original(PDF) on August 22, 2017.
  10. ^Watson, Robert (August 2, 2008)."Re: freebsd-advocacy Digest, Vol 248, Issue 1".freebsd-advocacy (Mailing list). RetrievedOctober 24, 2013.
  11. ^"FreeBSD Quarterly Status Report (Grand Central Dispatch – FreeBSD port)". April 2009. RetrievedOctober 24, 2013.
  12. ^Mac OS X 10.6 Snow Leopard: the Ars Technica review, page 5
  13. ^Siracusa, John (August 31, 2009)."Mac OS X 10.6 Snow Leopard: the Ars Technica review".Ars Technica.Finally, this is worth repeating: please keep in mind that you do not need to run the 64-bit kernel in order to run 64-bit applications or install more than 4 GB of RAM in your Mac. Applications run just fine in 64-bit mode on top of the 32-bit kernel, and even in earlier versions of Mac OS X it's been possible to install and take advantage of much more than 4GB of RAM.
  14. ^Mac OS X Server v10.6: Macs that use the 64-bit kernel
  15. ^"What's New in Mac OS X: Mac OS X v10.6".Apple Developer. Apple, Inc.
  16. ^Mac OS X Server v10.6: Starting up with the 32-bit or 64-bit kernel
  17. ^Amit Singh."XNU: The Kernel".What is Mac OS X?. I/O Kit. Archived fromthe original on April 19, 2019. RetrievedSeptember 9, 2011.I/O Kit uses a restricted subset of C++
  18. ^"DriverKit".Apple Developer.

External links

[edit]
Operating systems byApple
Apple II,III,Lisa
Mac
Classic Mac OS
macOS
Other projects
iOS derivatives
iOS
iPadOS
Others
Others
History
macOS
Mac OS X
Server
TV Software
  • 1
  • 2
  • 3
  • Forks from iOS with 4
iOS
tvOS
audioOS
watchOS
bridgeOS
audioOS
  • 11
  • 12
  • 13
  • Forks from tvOS with 13.4
iPadOS
visionOS
Non-Apple
distributions
Linux
Kernel
GNU/
Linux
XNU
QNX
Microsoft
Windows
Zircon
FreeBSD,NetBSD
OpenHarmony,
HarmonyOS NEXT
FreeRTOS
  • Amazfit OS
    • Zepp OS
  • MIUI Band OS
Nintendo
system software
Minix 3
Symbian
Others
Versions
Mac OS X
OS X
macOS
Predecessors
Applications
Core
applications
Developer
Tools
Xcode
Former
Former
Utilities
Discontinued
Technologies,
user interface
Deprecated
Discontinued
  • Italics denote upcoming products.
  •  Category
Retrieved from "https://en.wikipedia.org/w/index.php?title=XNU&oldid=1317723159"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp