• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
simple script to build a mach_kernel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

simple script to build a mach_kernel


  • Subject: simple script to build a mach_kernel
  • From: Tom Garcia <email@hidden>
  • Date: Fri, 2 Nov 2007 00:10:19 +0000

Since the source is out and last time I tried it was difficult to start from scratch, I've scribbled a script that ends up with a mach_kernel, based on the method in http://slagheap.net/etherspoof/ . Maybe it'll entice other dilettantes.

1. Install Xcode.

2. Download:
   * bootstrap_cmds-60.tar.gz
   * Libstreams-25.tar.gz
   * kext_tools-117.tar.gz
   * xnu-1228.tar.gz
   * cctools-667.3.tar.gz
   * IOKitUser-376.tar.gz
from the 10.5 sources page and place into a directory dist/.

3. Execute in dist's parent:
----- snip -----
#!/bin/sh

sudo mkdirhier /usr/local/bin
mkdir build
cd build

tar zxf ../dist/bootstrap_cmds-*.tar.gz
cd bootstrap_cmds-*/relpath.tproj/
make all
sudo make install

cd ../..
tar zxf ../dist/Libstreams-*.tar.gz
cd Libstreams-*
make all
sudo make install

cd ..
tar zxf ../dist/cctools-*.tar.gz
cd cctools-*/libstuff
mv Makefile Makefile.orig
sed 's,\-DKERNEL,\-I/usr/include \-DKERNEL,g' Makefile.orig >Makefile
make all
cd ../misc
make macos_all
sudo cp seg_hack.NEW /usr/local/bin/seg_hack
cd ../libmacho
make macos
cd ../ld
mv Makefile Makefile.orig
sed 's,\-DKERNEL,\-I/usr/include \-DKERNEL,g' Makefile.orig >Makefile
make kld_build
sudo cp static_kld/libkld.a /usr/local/lib
cd ..
sudo mkdirhier /usr/local/include/mach-o
sudo cp include/mach-o/kld.h /usr/local/include/mach-o

cd ..
tar zxf ../dist/IOKitUser-*.tar.gz
cd IOKitUser-*
sudo mkdirhier /usr/local/include/IOKit/kext
sudo cp kext.subproj/KXKext.h kext.subproj/KXKextManager.h kext.subproj/KXKextRepository.h /usr/local/include/IOKit/kext


cd ..
tar zxf ../dist/kext_tools-*.tar.gz
cd kext_tools-*
gcc -I/usr/local/include kextsymboltool.c -o kextsymboltool
sudo cp kextsymboltool /usr/local/bin

cd ..
tar zxf ../dist/xnu*.tar.gz
cd xnu*
make
----- snip -----

Kernel at build/xnu-1228/BUILD/obj/RELEASE_I386/mach_kernel .

(Where is ctfconvert ?)

Regards,

--
Tom Garcia | email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: simple script to build a mach_kernel
      • From: Andreas Fink <email@hidden>
    • Re: simple script to build a mach_kernel
      • From: Tom Duffy <email@hidden>
  • Prev by Date: Re: Cannot compile xnu-1288
  • Next by Date: Re: simple script to build a mach_kernel
  • Previous by thread: Re: Cannot compile xnu-1288
  • Next by thread: Re: simple script to build a mach_kernel
  • Index(es):
    • Date
    • Thread