Android
模拟器使用的是arm
的CPU
架构,首先需要设置环境变量:
$ cd $WORKING_DIRECTORY/kernel/goldfish
$ export ARCH=arm
$ export CROSS_COMPILE=arm-eabi-
将交叉编译工具添加到PATH
环境变量:
$ export PATH=$WORKING_DIRECTORY/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin:$PATH
编译:
$ make goldfish_defconfig
$ make -j4
......
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
编译好的zImage
文件位于内核源代码目录下:
$WORKING_DIRECTORY/arch/arm/boot/zImage