Ever since the first version of OS X, Apple has regularly released the kernel source code for Macs. In theory, you could learn from it or even build your own projects from it. For iOS, though? Not so simple. Even if you had source code, it wouldn’t matter much unless it was optimized for the ARM-based chips that you see in most phones and mobile tablets. However, Apple is shaking things up a bit. The company has quietly posted ARM-friendly source code for the XNU kernels used in iOS and macOS. That’s particularly relevant if you’re interested in iOS, since you now have code that would theoretically run on an iPhone or iPad. However, it’s not quite the breakthrough move it seems at first blush.
To start: this is just the kernel, the low-level code that governs the most critical functions. It doesn’t cover the interface, developer frameworks or apps… that is, the parts that truly define iOS or macOS. Those elements are still closed off, so you would have to build most of the platform from scratch. You won’t see iOS on a Galaxy S8 any time soon. Apple also offers a relatively limited source code license that isn’t as flexible as, say, the GPL license used for Linux.
Moreover, while the presence of ARM-based Mac code is bound to raise eyebrows, this doesn’t mean that you’re about to see a MacBook with an A11 Bionic chip inside. Apple has a long history of writing code for other architectures “just in case” (the PowerPC-to-Intel transition happened quickly because Apple already had code waiting in the wings), so it might never make the switch. You certainly aren’t about to install macOS on your ARM-based Chromebook. And besides, there are rumors of Apple developing ARM-based companion chips for Macs. It may need ARM code even if it has no intention of ditching Intel for CPUs.
All the same, it’s a welcome move. This gives app and OS developers a better sense of how Apple tackles basic system tasks, particularly on iOS. And yes, anyone ambitious enough to write a full operating system could use XNU as a starting point. It’s just not going to change the status quo for Apple.
Source: GitHub, Apple Open Source