Source:http://shantonu.blogspot.jp/2014/10/building-xnu-for-os-x-1010-yosemite.html
The OS X kernel source (XNU) has been released for OS x 10.10 Yosemite:?Here
Building XNU requires Xcode and some additional open-source (but not pre-installed) dependencies. You can build xnu manually by doing:
- Install OS X Yosemite and Xcode 6.1 from the Mac App Store, make sure the Xcode license have been agreed-to with "sudo xcod Ebuild-license "
- Download the source for the DTrace and availabilityversions projects, which is required dependencies, as well as Xnu Itse Lf
$ Curl-o http://opensource.apple.com/tarballs/dtrace/dtrace-147.tar.gz$ Curl-o http://opensource.apple.com/ tarballs/availabilityversions/availabilityversions-9.tar.gz$ Curl-o http://opensource.apple.com/tarballs/xnu/ Xnu-2782.1.97.tar.gz
- Build and install CTF tools from DTrace
$ tar zxf dtrace-147.tar.gz$ cd dtrace-147$ mkdir-p obj sym dst$ xcodebuild install-target ctfconvert-target ctfdump-t Arget ctfmerge archs= "x86_64" srcroot= $PWD objroot= $PWD/obj symroot= $PWD/sym dstroot= $PWD/dst...$ sudo ditto $PWD/dst/ usr/local/usr/localpassword:$ CD.
- Install availabilityversions
$ tar zxf availabilityversions-9.tar.gz$ cd availabilityversions-9$ mkdir-p dst$ make install srcroot= $PWD DSTROOT= $PWD/d st$ sudo ditto $PWD/dst/usr/local ' xcrun-sdk macosx-show-sdk-path '/usr/local$ CD.
- Build XNU
$ tar zxf xnu-2782.1.97.tar.gz$ cd xnu-2782.1.97$ make Sdkroot=macosx arch_configs=x86_64 kernel_configs=release
See Xnu's top-level README for additional build variables so can is passed on the command-line, such as build_lto=0? .
Update:if You is attempting to add system calls, your may also need to build Libsyscall.
- Download the Libsystem source
$ Curl-o http://opensource.apple.com/tarballs/Libsystem/Libsystem-1213.tar.gz
- Install Libsystem Headers
$ tar zxf libsystem-1213.tar.gz $ cd libsystem-1213$ xcodebuild installhdrs-sdk macosx archs= ' x86_64 i386 ' SRCROOT= $PWD O bjroot= $PWD/obj symroot= $PWD/sym dstroot= $PWD/dst$ sudo ditto $PWD/dst ' XCRUN-SDK macosx-show-sdk-path ' $ CD.
- Install Xnu and Libsyscall headers
$ cd xnu-2782.1.97$ mkdir-p build.hdrs/obj build.hdrs/sym build.hdrs/dst$ make Installhdrs SDKROOT=macosx ARCH_CONFIGS=X 86_64 srcroot= $PWD objroot= $PWD/build.hdrs/obj symroot= $PWD/build.hdrs/sym dstroot= $PWD/build.hdrs/dst$ xcodebuild Installhdrs-project libsyscall/libsyscall.xcodeproj-sdk macosx archs= ' x86_64 i386 ' srcroot= $PWD/libsyscall OBJROOT=$ Pwd/build.hdrs/obj symroot= $PWD/build.hdrs/sym dstroot= $PWD/build.hdrs/dst$ sudo ditto build.hdrs/dst ' xcrun-sdk Macosx-show-sdk-path '
- Build Libsyscall
$ mkdir-p build.libsyscall/obj build.libsyscall/sym build.libsyscall/dst$ xcodebuild install-project libsyscall/ LIBSYSCALL.XCODEPROJ-SDK macosx archs= ' x86_64 i386 ' srcroot= $PWD/libsyscall objroot= $PWD/build.libsyscall/obj symroot= $PWD/build.libsyscall/sym dstroot= $PWD/build.libsyscall/dst
[Go] Building xnu for OS X 10.10 Yosemite