AppNinja 开发手记6: 编译 xnu-2050 内核,并用红雪启动内核
学习心得: A4 Ramdisk wino
http://blog.csdn.net/a2831942318
Written by AppNinja 开发手记
1. compile environment
MacOS xcode4.6 xnu-2050
http://www.opensource.apple.com/tarballs/xnu/xnu-2050.18.24.tar.gz
$ curl -O http://opensource.apple.com/tarballs/dtrace/dtrace-96.tar.gz
$ curl -O http://opensource.apple.com/tarballs/AvailabilityVersions/AvailabilityVersions-4.2.tar.gz
$ curl -O http://www.opensource.apple.com/tarballs/xnu/xnu-2050.18.24.tar.gz
$ tar zxf dtrace-96.tar.gz
$ tar zxf AvailabilityVersions-4.2.tar.gz
$ tar zxf xnu-2050.7.9.tar.gz
$ cd dtrace-96
$ mkdir -p obj sym dst
$ xcodebuild install -target ctfconvert -target ctfdump -target ctfmerge ARCHS="x86_64" SRCROOT=$PWD OBJROOT=$PWD/obj SYMROOT=$PWD/sym DSTROOT=$PWD/dst
$ sudo ditto $PWD/dst/usr/local /usr/local
Password:
$ cd ..
$ cd AvailabilityVersions-4.2
$ mkdir -p dst
$ make install SRCROOT=$PWD DSTROOT=$PWD/dst
$ sudo ditto $PWD/dst/usr/local /usr/local
$ cd ..
$ cd xnu-2050.18.24
$ make ARCH_CONFIGS=X86_64 KERNEL_CONFIGS=RELEASE CWARNFLAGS_STD="-Wall" CXXWARNFLAGS_STD="-Wall"
Building xnu with clang
You can build xnu with clang from Xcode 4.1 by doing:
$ make ARCH_CONFIGS="X86_64 I386" CC=clang CXX=clang++ CWARNFLAGS_STD="-Wall" CXXWARNFLAGS_STD="-Wall"
2、compile xnu arm kernel param
make TARGET_CONFIGS="debug arm S5L8930X"
generate: mach_kernel
3、download http://appldnld.apple.com/iPhone4/061-8490.20100901.hyjtR/iPod4,1_4.1_8B117_Restore.ipsw
4.1 版本的 ipsw。A4 处理器 iPhone4, iPad1, iPod4G。
4、设备进入 DFU 模式,红雪引导启动内核
redsn0wB5.exe -i "iPod4,1_4.1_8B117_Restore.ipsw" -k mach_kernel
5、启动到 "Still waiting for root device"。
学习心得: A4 Ramdisk wino
http://blog.csdn.net/a2831942318
Written by AppNinja 开发手记
1. compile environment
MacOS xcode4.6 xnu-2050
http://www.opensource.apple.com/tarballs/xnu/xnu-2050.18.24.tar.gz
$ curl -O http://opensource.apple.com/tarballs/dtrace/dtrace-96.tar.gz
$ curl -O http://opensource.apple.com/tarballs/AvailabilityVersions/AvailabilityVersions-4.2.tar.gz
$ curl -O http://www.opensource.apple.com/tarballs/xnu/xnu-2050.18.24.tar.gz
$ tar zxf dtrace-96.tar.gz
$ tar zxf AvailabilityVersions-4.2.tar.gz
$ tar zxf xnu-2050.7.9.tar.gz
$ cd dtrace-96
$ mkdir -p obj sym dst
$ xcodebuild install -target ctfconvert -target ctfdump -target ctfmerge ARCHS="x86_64" SRCROOT=$PWD OBJROOT=$PWD/obj SYMROOT=$PWD/sym DSTROOT=$PWD/dst
$ sudo ditto $PWD/dst/usr/local /usr/local
Password:
$ cd ..
$ cd AvailabilityVersions-4.2
$ mkdir -p dst
$ make install SRCROOT=$PWD DSTROOT=$PWD/dst
$ sudo ditto $PWD/dst/usr/local /usr/local
$ cd ..
$ cd xnu-2050.18.24
$ make ARCH_CONFIGS=X86_64 KERNEL_CONFIGS=RELEASE CWARNFLAGS_STD="-Wall" CXXWARNFLAGS_STD="-Wall"
Building xnu with clang
You can build xnu with clang from Xcode 4.1 by doing:
$ make ARCH_CONFIGS="X86_64 I386" CC=clang CXX=clang++ CWARNFLAGS_STD="-Wall" CXXWARNFLAGS_STD="-Wall"
2、compile xnu arm kernel param
make TARGET_CONFIGS="debug arm S5L8930X"
generate: mach_kernel
3、download http://appldnld.apple.com/iPhone4/061-8490.20100901.hyjtR/iPod4,1_4.1_8B117_Restore.ipsw
4.1 版本的 ipsw。A4 处理器 iPhone4, iPad1, iPod4G。
4、设备进入 DFU 模式,红雪引导启动内核
redsn0wB5.exe -i "iPod4,1_4.1_8B117_Restore.ipsw" -k mach_kernel
5、启动到 "Still waiting for root device"。
6、如果载入 rawdisk,出现 login 提示。