From version to version, I always love to play around with the kernel. And it has always been a great lack in guides and documentation on how to build Mac OSX’s kernel, XNU. For those of you that already have tried compiling XNU for Mac OSX 10.12 (Sierra), you probably noticed that earlier build guides like ssen’s blog – Building xnu for OS X 10.11 El Capitan don’t work anymore. However, many thanks to ssen to put in time to write a guide.
The problem is that Apple introduced something named Circular dependency with the libdispatch library and the kernel headers. So the order of the build process just got really important.
I know what I’m doing this weekend.
Though, neither this nor ssen’s blog explains why I might want to do this.
I’ve built linux and *bsd kernels many, many times, with specific purposes in mind. What can I accomplish with a custom built XNU kernel, though?
Not a lot IIRC. The software stack for it is quite limited from my experience.
I agree. I only played with this almost a decade ago but except for curiosity to see what was powering a Mac I didn’t find anything interesting/useful about it for me personally.
If you want to run BSD, there are several flavors of it with a much richer community and userlands.
If you want to run macOS, buy a Mac or experiment with a Hackintosh
If you want to know more about different kernels that are used in the real world, have a go with XNU … but I can almost guarantee that you will not start using it for anything except gathering knowledge
I believe he could learn something from PureDarwin team (and vice versa).
Sure, you could learn something. You could also learn something from building Plan 9, or GNU/
HURD. That doesn’t mean it’s useful.
I have been aware of the cascading issues with dependies in the BSD and Linux worlds. There are many, many horror stories – although such stories are rarer today than even five years ago.
From what I understand, circular dependencies forces a specific order in the compilation of the parts to build the executable. Isn’t this risky for the long term reliability/stability of the kernel?