4、yaffs文件系统源码包
二、用vivi构建bootloader(不包含解压过程)
1、修改vivi/Makefile文件
25 行:CROSS_COMPILE = /usr/local/arm/2.95.3/arm/bin/arm-linux-
2、按照自己的需求自定义mtd分区,修改arch/s3c2410/smdk.c文件
修改 NAND flash 分区如下:
mtd_partition_t default_mtd_partitions[] = {
{
name: "bootloader", //0x0—0x000E0000
offset: 0,
size: 0x000E0000, //bootloder占896个字节
flag: 0
},
{
name: "param", //0x000E0000—0x00100000
offset: 0x000E0000,
size: 0x00020000, //param占128个字节
flag: 0
},
{
name: "kernel", //0x00100000—0x00400000
offset: 0x, 0x00100000,
size: 0x00300000, //kernel占3M
flag: 0
},
{
name: "root", //0x00400000—0x01800000
offset: 0x00400000,
size: 0x01400000, //占20M
flag: MF_BONFS
},
{
name: "user", //0x01800000—0x04000000
offset: 0x01800000,
size: 0x02800000, //40M
flag: MF_BONFS
}
};
4、在vivi目录下执行make menuconfig,选择Load an Alternate Configuration File,输入arch/def-configs/smdk2410保存
4、执行make 在vivi目录下将生成vivi的二进制可执行文件
5、将vivi下载到开发版
三、修改编译内核
1、解压linux-2.6.30.tar.gz2源码包
2、修改内核mtd分区和bootloader(vivi)使其一致
编辑文件arch/arm/plat-s3c24xx/common-smdk.c
static struct mtd_partition smdk_default_nand_part[] = {
[0] = {
.name = "bootloader",
.size = 0x000E0000,
.offset = 0,
},
[1] = {
.name = "param",
.offset = 0x000E0000,
.size = 0x00020000,
},
[2] = {
.name = "kernel",
.offset = 0x00100000,
.size = 0x00300000,
},
[3] = {
.name = "root",
.offset = 0x00400000,
.size = 0x01400000,
},
[4] = {
.name = "user",
.offset = 0x01800000,
.size = 0x02800000,
}
};
3、修改文件drivers/mtd/nand/s3c2410.c
将s3c2410_nand_init_chip函数里的NAND_ECC_SOFT改为NAND_ECC_NONE(因为在内核中默认配置不支持ECC校验,当然也可以在内核配置时选中ECC选项)
4、解压yaffs.tar.gz2源码包,进入yaffs2文件夹,给内核打上补丁使内核支持yaffs2
# ./ patch-ker.sh c /home/linux-2.6.30
5、到llinux-2.6.30目录下执行命令
#cp arch/arm/configs/s3c2410_defconfig .config
6、执行make menuconfig,并对选项进行配置
选项Userspace binary formats
[ ]Kernel support for a.out and ECOFF binaries (BINFMT_AOUT) (去除该选项)
选项Boot options(根据自己的root目录在那个mtd分区来改)
Default kernel command string
命令 param set linux_cmd_line
改成: noinitrd root=/dev/mtdblock3 console=ttySAC0,115200 init=/linuxrc
选中YAFFS2 file ststem support以支持yaffs
其余按默认配置
7、执行make zImage,在arch/arm/boot目录下将生成一个zImage的文件