<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Boeaja &#187; kernel</title>
	<atom:link href="http://osx86.boeaja.info/tag/kernel/feed/" rel="self" type="application/rss+xml" />
	<link>http://osx86.boeaja.info</link>
	<description>A Simple  OSX86 Blog</description>
	<lastBuildDate>Fri, 12 Nov 2010 06:58:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Building XNU kernel on Snow Leopard</title>
		<link>http://osx86.boeaja.info/2009/10/building-xnu-kernel-on-snow-leopard/</link>
		<comments>http://osx86.boeaja.info/2009/10/building-xnu-kernel-on-snow-leopard/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 09:29:33 +0000</pubDate>
		<dc:creator>boeaja</dc:creator>
				<category><![CDATA[OSX86]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[Legacy Kernel]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[voodoo]]></category>
		<category><![CDATA[XNU]]></category>

		<guid isPermaLink="false">http://www.boeaja.co.cc/?p=43</guid>
		<description><![CDATA[XNU kernel Source for Mac Os X 10.6 Snow Leopard  has ben release on opensource.apple.com Building xnu requires some open source (but not pre-installed) tools. Darwinbuild is the most reliable way for building these dependencies and xnu itself. Until that is ready, you can build the tools manually as follows: make a dir in desktop [...]]]></description>
			<content:encoded><![CDATA[<p>XNU kernel Source for Mac Os X 10.6 Snow Leopard  has ben release on opensource.apple.com</p>
<p>Building xnu requires some open source (but not pre-installed) tools. Darwinbuild is the most reliable way for building these dependencies and xnu itself. Until that is ready, you can build the tools manually as follows:</p>
<p>make a dir in desktop or some where else (eg Kernel)</p>
<p>Open Terminal and type</p>
<blockquote><p>cd ~/desktop/Kernel</p>
<p>(if you created a Kernel dir in desktop)</p></blockquote>
<ol>
<li>Download the build tools source(s)<br />
<tt><br />
$ curl -s -O http://www.opensource.apple.com/tarballs/cxxfilt/cxxfilt-9.tar.gz<br />
$ curl -s -O http://www.opensource.apple.com/tarballs/dtrace/dtrace-78.tar.gz<br />
$ curl -s -O http://www.opensource.apple.com/tarballs/kext_tools/kext_tools-177.tar.gz<br />
$ curl -s -O http://www.opensource.apple.com/tarballs/bootstrap_cmds/bootstrap_cmds-72.tar.gz</tt></li>
<li>Unpack the tools<br />
<tt><br />
$ tar zxf cxxfilt-9.tar.gz<br />
$ tar zxf dtrace-78.tar.gz<br />
$ tar zxf kext_tools-177.tar.gz<br />
$ tar zxf bootstrap_cmds-72.tar.gz<br />
</tt></li>
<li>Build cxxfilt<br />
<tt><br />
$ cd cxxfilt-9<br />
$ mkdir -p obj sym dst<br />
$ make install RC_ARCHS="i386 x86_64" RC_CFLAGS="-arch i386 -arch x86_64 -pipe" RC_OS=macos RC_RELEASE=SnowLeopard SRCROOT=$PWD OBJROOT=$PWD/obj SYMROOT=$PWD/sym DSTROOT=$PWD/dst<br />
...<br />
$ sudo ditto $PWD/dst/usr/local /usr/local<br />
Password:<br />
$ cd ..<br />
</tt></li>
<li>Build dtrace<br />
<tt><br />
$ cd dtrace-78<br />
$ mkdir -p obj sym dst<br />
$ xcodebuild install -target ctfconvert -target ctfdump -target ctfmerge ARCHS="i386 x86_64" SRCROOT=$PWD OBJROOT=$PWD/obj SYMROOT=$PWD/sym DSTROOT=$PWD/dst<br />
...<br />
$ sudo ditto $PWD/dst/usr/local /usr/local<br />
Password:<br />
$ cd ..<br />
</tt></li>
<li>Build kext_tools<br />
<tt><br />
$ cd kext_tools-177<br />
$ mkdir -p obj sym dst<br />
$ xcodebuild install -target kextsymboltool -target setsegname ARCHS="i386 x86_64" SRCROOT=$PWD OBJROOT=$PWD/obj SYMROOT=$PWD/sym DSTROOT=$PWD/dst<br />
...<br />
$ sudo ditto $PWD/dst/usr/local /usr/local<br />
Password:<br />
$ cd ..<br />
</tt></li>
<li>Build bootstrap_cmds<br />
<tt><br />
$ cd bootstrap_cmds-72<br />
$ mkdir -p obj sym dst<br />
$ make install RC_ARCHS="i386" RC_CFLAGS="-arch i386 -pipe" RC_OS=macos RC_RELEASE=SnowLeopard SRCROOT=$PWD OBJROOT=$PWD/obj SYMROOT=$PWD/sym DSTROOT=$PWD/dst<br />
...<br />
$ sudo ditto $PWD/dst/usr/local /usr/local<br />
Password:<br />
$ cd ..<br />
</tt></li>
<li>Download the xnu source<br />
<tt><br />
$ curl -s -O http://www.opensource.apple.com/tarballs/xnu/xnu-1456.1.26.tar.gz<br />
</tt></li>
<li>Unpack xnu<br />
<tt><br />
$ tar zxf xnu-1456.1.26.tar.gz<br />
</tt></li>
<li>Build xnu<br />
<tt><br />
$ cd xnu-1456.1.26<br />
$ make ARCH_CONFIGS="I386 X86_64" KERNEL_CONFIGS="RELEASE"<br />
...<br />
$ file BUILD/obj/RELEASE_*/mach_kernel<br />
BUILD/obj/RELEASE_I386/mach_kernel: Mach-O executable i386<br />
BUILD/obj/RELEASE_X86_64/mach_kernel: Mach-O 64-bit executable x86_64</tt></li>
</ol>
<p>Original Post :  <a href="http://shantonu.blogspot.com/2009/09/mac-os-x-kernel-source-xnu-has-been.html" target="_blank">here</a></p>
<p>To build a modified XNU with a .diff of an XNU kernel you need to:</p>
<p>1. Download and Apply the patch</p>
<p>download the .diff file and place it in your kernel folder (eg. ~/desktop/Kernel/patch.diff )</p>
<p>Patch the source  with :</p>
<blockquote><p>cd ~/desktop/Kernel/</p>
<p>patch -p0 -i patch.diff</p></blockquote>
<p>2. build the kernel (make sure you have remove the BUILD folder in  xnu-1456.1.26 folder i you have try to build before</p>
<p>$ cd xnu-1456.1.26<br />
$ make ARCH_CONFIGS=&#8221;I386 X86_64&#8243; KERNEL_CONFIGS=&#8221;RELEASE&#8221;</p>
<p>(for i386 and x86_64 build)</p>
<p style="text-align: left;">or</p>
<p>$ cd xnu-1456.1.26<br />
$ make ARCH_CONFIGS=&#8221;I386&#8243; KERNEL_CONFIGS=&#8221;RELEASE&#8221;</p>
<p>(for i386 build only (legacy kernel))</p>
]]></content:encoded>
			<wfw:commentRss>http://osx86.boeaja.info/2009/10/building-xnu-kernel-on-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

