首先要注意的地方是vivi要用cross-2.95.3来编译,之前我用arm-linux-gcc-4.3.2来编译老是出错。
一、当然是修改Makefile文件了,主要是指定编译器的路径。
这是我改的:
LINUX_INCLUDE_DIR = /usr/local/arm/2.95.3/include/
...
CROSS_COMPILE = /usr/local/arm/2.95.3/bin/arm-linux-2.95.3-
...
ARM_GCC_LIBS = /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3
二、修改arch/s3c2410/下的smdk.c,这主要是修改成适合大小的MTD分区,下面是我修改后的
#ifdef CONFIG_S3C2410_NAND_BOOT
mtd_partition_t default_mtd_partitions[] = {
{
name: "vivi",
offset: 0,
size: 0x00020000,
flag: 0
}, {
name: "param",
offset: 0x00020000,
size: 0x000F2000,
flag: 0
}, {
name: "kernel",
offset: 0x00030000,
size: 0x002E0000,
flag: 0
}, {
name: "root",
offset: 0x00100000,
size: 0x003E0000,
flag: MF_BONFS
}
};
#endif
#ifdef CONFIG_S3C2410_AMD_BOOT
mtd_partition_t default_mtd_partitions[] = {
{
name: "vivi",
offset: 0,
size: 0x00020000,
flag: 0
}, {
name: "param",
offset: 0x00020000,
size: 0x000F2000,
flag: 0
}, {
name: "kernel",
offset: 0x00030000,
size: 0x002E0000,
flag: 0
}, {
name: "root",
offset: 0x00100000,
size: 0x003E0000,
flag: MF_BONFS
}
};
#endif
三、接下来就可以编译了
make clean //编译之前执行这个命令是个好习惯
make menuconfig
选择“load an alternate configuration file”输入“arch/def-configs/smdk2410”
make
到止编译就完成了,它会生成vivi文件,这就是要的结果了...