
XNU target config for Raspberry Pi 3 (2016) - beltex
https://opensource.apple.com/source/xnu/xnu-4903.221.2/pexpert/pexpert/arm64/BCM2837.h.auto.html
======
beltex
Credits for the find:
[https://twitter.com/s1guza/status/1071951039115464704](https://twitter.com/s1guza/status/1071951039115464704)

~~~
beltex
About the 2016 tag that was added to the title. While the header does say
2016, I think it's that the file wasn't made open source by Apple till this
weekend.

Aside - explicit reference to Raspberry Pi here:

[https://opensource.apple.com/source/xnu/xnu-4903.221.2/osfmk...](https://opensource.apple.com/source/xnu/xnu-4903.221.2/osfmk/arm/proc_reg.h.auto.html)

------
bpye
IoT solution based on XNU? - bit outside of Apple's gamut but I could see it.
iotOS

EDIT: Eh, maybe not the copyright is quite old - perhaps more likely some
internal test? Run ARM64 XNU tests on Raspberry Pis maybe? They are pretty
cheap hardware with lots of ports.

~~~
mrsteveman1
There was a time when it looked like they might switch their Airport and Time
Capsule routers, which previously had been running VxWorks and NetBSD, to a
variant of iOS. But then they shelved the entire product lines a few years
later.

It did turn out to be true that Apple was moving to run iOS (and later on,
even APFS) all the way down to watch hardware, and later on the HomePod which
is the functional successor to the audio features of the Airport Express.

Had they continued producing routers, it's all but guaranteed that they would
be running firmware similar to the HomePod at this point.

The reason they would be building XNU for the bcm2837 however is probably much
more "boring", like allowing various teams inside Apple to test some low level
change being planned for the kernel, perhaps in the network stack, without the
added hassle and potential for leaks that would result from using some other
unreleased Apple platform to do it.

------
qalmakka
It's a pity that Apple let Open Darwin die off, it definitely had a potential
as a nice BSD platform.

~~~
tsmarsh
I'm still not sure of the history there. I remember one of the selling points
of the early OS X was that it was a "Certified UNIX" and I remember that no
one I tried to sell one too cared.

Was it just the cost of maintaining the certification? The fact that no other
OS went down that route?

~~~
4ad
MacOS still is certified UNIX:
[https://www.opengroup.org/openbrand/register](https://www.opengroup.org/openbrand/register).

------
saagarjha
This file is from 2016, apparently, so Apple has likely been using this for
quite some time. It's possible that Apple found it convenient to run certain
things (guesses: some IoT thing or prototyping a small embedded processor like
the one inside the Lightning Digital AV Adapter) on a Raspberry Pi rather than
a full-blown A-series core or other chip that is inconvenient due to {price,
availability, etc.}.

------
bigpicture
Not being familiar with the term XNU, I did a little clicking around and
hopefully I understand a bit better:

This file is evidence that Apple has been running iOS/MacOS on the Raspberry
Pi 3?

~~~
Wowfunhappy
It's evidence they have been running the macOS / iOS kernel, yes.

Whether they had the full stack running—and how much of the stack is necessary
for something to be deemed "macOS"—is up for debate.

~~~
lukeh
Or maybe it was an intern project.

~~~
bpye
Heh, this is quite believable too. Anyone found their LinkedIn profile?

------
floatboth
Why would they even remotely touch that _horrendous_ SoC?

~~~
JasonFruit
Honest question — why is it horrendous? It's cheap, reasonably capable, can be
easily coaxed into doing most of what a person might want, and has enough
adoption that advice and code is easy to find. I'm sure you mean horrendous in
some more technical sense, but I've found it nothing if not practical. Please
teach me.

~~~
floatboth
\- I/O is comically limited. Everything talking to the outside world is
infamously bottlenecked on USB 2.0. (In comparison, any modern Rockchip or
Allwinner SoC has Gigabit Ethernet directly connected to the SoC.)

\- The memory subsystem is also a joke. 1 GB of slow LPDDR2 is the limit!?

\- The boot process is absurd. A proprietary blob is loaded onto the GPU (!)
from the SD card before everything else. An independent FOSS replacement boot
stack project was started but not finished.

\- And the firmware's support for network booting is very, very unreliable.

\- There is a custom interrupt controller instead of the standard ARM GIC.
(This was in fact one of the frustrations cited in the post about the open
boot stack project's abandonment.)

\- CPU crypto extensions (AES+PMULL/SHA1/SHA2) are absent. Other similar
(4-core A53) SoCs (A64, RK3328) do have it.

\- The GPU _does not have memory protection_. The VC4 driver does its best to
try to validate shaders, but… LOL.

And here we're talking about _Apple_. They make their own SoCs. If they
decided to get into IoT, they'd probably make a development platform based on
one of their small chips they use in AirPods or whatever

~~~
Siguza
I highly doubt this is for IoT advances, nor for internal debugging - because
they have both already. The watch, AirPods, all the 40+ processors in an
iPhone, the chips in each and every dongle, Apple is way past starting in IoT.
AFAIK the vast majority of cores do not run XNU though, which would further
make this seem weird. And for debugging, they just have actual iPhones that
simply have the JTAG engine turned on.

I'm having trouble understanding what they could possibly want from any non-
Apple SoC at all... unless their intention is really to make XNU on arm64 more
open for developers and hackers. But I somehow doubt that.

