Show pageOld revisionsBacklinksBack to top You've loaded an old revision of the document! If you save it, you will create a new version with this data. Media Files ===== xnu //darwin ===== the [[OsX]] kernel (see [[Kernel Notes]] for glinux) ==== building ==== ref docs * http://developer.apple.com/documentation/Darwin/Conceptual/KernelProgramming/build/chapter_18_section_3.html * http://opendarwin.org/doc/en/articles/building_xnu/ short notes based on above docs... === get the src === get the src and necessary tools (bootstrap_cmds, Libstreams, and cctools) from http://www.opensource.apple.com (or cvs) <file> cvs -d :pserver:anonymous@anoncvs.opendarwin.org:/Volumes/src/cvs/od login cvs -d :pserver:anonymous@anoncvs.opendarwin.org:/Volumes/src/cvs/od co src/Libstreams cvs -d :pserver:anonymous@anoncvs.opendarwin.org:/Volumes/src/cvs/od co src/bootstrap_cmds cvs -d :pserver:anonymous@anoncvs.opendarwin.org:/Volumes/src/cvs/od co src/cctools cvs -d :pserver:anonymous@anoncvs.opendarwin.org:/Volumes/src/cvs/od co src/xnu <file> Note, that the above steps check out the most current version of the source. If you want to have exactly the same code base, as in the tarballs from Apple, you need to specify the OD_APPLE_10_2_6 tag. <code> cvs -d :pserver:anonymous@anoncvs.opendarwin.org:/Volumes/src/cvs/od co -r OD_APPLE_10_2_6 src/Libstreams </code> === setup the environment, and build tools === <code> (export PATH=/usr/local/bin:$PATH) </code> if its not in .bashprofile <file> cd ~/src/Libstreams make install DSTROOT=/tmp/Libstreams.dst (cd /tmp/Libstreams.dst; pax -rw . /) cd ~/src/bootstrap_cmds make install DSTROOT=/tmp/bootstrap_cmds.dst (cd /tmp/bootstrap_cmds.dst; pax -rw . /) cd ~/src/xnu make installhdrs DSTROOT=/tmp/xnu_hdrs.dst (cd /tmp/xnu_hdrs.dst; pax -rw . /) cd ~/src/cctools make install_tools DSTROOT=/tmp/cctools.dst SUBDIRS="libstuff libmacho misc" RC_OS=macos (cd /tmp/cctools.dst ; pax -rw . /) make lib_ofiles_install DSTROOT=/tmp/cctools.dst SUBDIRS="ld" RC_OS=macos (cd /tmp/cctools.dst ; pax -rw . /) </file> === build the kernel === Finally, issue the following commands: <file> cd ~/src/xnu make </file> The resulting kernel can be found in the BUILD/obj/RELEASE_$ARCH/ directory and is called mach_kernel. $ARCH can be either PPC or I386. By changing the KERNEL_CONFIGS environment variable you can specify which kernel configuration you want to build. For example, to build a debug version of the kernel, do this: <file> make KERNEL_CONFIGS=DEBUG all </file> Please fill all the letters into the box to prove you're human. Please keep this field empty: SavePreviewCancel Edit summary Note: By editing this page you agree to license your content under the following license: CC Attribution-Share Alike 4.0 International osx_kernel.1181727604.txt.gz Last modified: 2007-06-13 09:44(external edit)