Apple has introduced a new framework called KernelKit in macOS 27 and iOS 27, representing the first steps toward writing kernel components in Swift. Through reverse engineering of the macOS 27 kernelcache, the author discovered an Embedded Swift runtime statically linked into the pthread kext under a new /System/KernelKit directory. Six new Mach-O platform IDs (25–30) were found in the Xcode 27 beta linker for per-OS KernelKit variants. The Embedded Swift runtime (~2.4 KB) includes real implementations of swift_retain, swift_release, swift_once, and swift_dynamicCast, verified via IDA disassembly. However, no other kernel component currently calls these Swift symbols — the runtime is loaded but idle. XNU's core (Mach, BSD, IOKit) remains entirely C/C++. The apparent rollout strategy is to ship the SDK and runtime first, verify stability across beta cycles, then begin landing actual Swift kernel components.

8m read timeFrom blog.calif.io
Post cover image
Table of contents
A new directory in /SystemNew Mach-O platform IDsThe Xcode beta toolchain already knowsThe Swift bitBut what about Libm ?Nobody calls any of it (yet)TLDR
218 Impressions