三星官网上下载kernel源码 ,地址https://opensource.samsung.com/
1. 按照readme.txt中所说,先下载arm-2009q3-68-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
付给大家下载地址https://sourcery.mentor.com/sgpp/lite/arm/portal/release1033 选择IA32 GNU/Linux TAR
底下是一些pdf帮助文档,需要的一并下下来看看
也可以用命令下载,并解压
mkdir CodeSourcery
cd CodeSourcery
wget http://www.codesourcery.com/sgpp/lite/arm/portal/package5353/public/arm-none-eabi/arm-2009q3-68-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
tar jxf arm-2009q3-68-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
2. 然后修改CROSS_COMPILE到安装目录CROSS_COMPILE ?=/home/sunshine/CodeSourcery/arm-2009q3/bin/arm-none-eabi-
3. Execute 'make aries_eur_defconfig'.
4. Execute 'make modules'.
5. Execute 'make -j2' 如果不是双核就 make,四核 make -j4
出现了
fs/binfmt_aout.c: In function 'load_aout_binary': fs/binfmt_aout.c:271: error: 'SEGMENT_SIZE' undeclared (first use in this function) fs/binfmt_aout.c:271: error: (Each undeclared identifier is reported only once fs/binfmt_aout.c:271: error: for each function it appears in.) make[1]: *** [fs/binfmt_aout.o] Error 1错误
解决方法:
修改
注释掉原来的,改为下面的
#NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) -Dlinux
但是这样编译出来的结果/arch/arm/boot/zImage只有3.4M
后来把china version的部分拷贝到taiwan version部分,重名的文件用taiwan的。这句英语真是费解。还是只有3.4M。