推荐下载linux-3.0-rc4.tar.bz2 文件进行开发
1.内核的制作
1.1修改vim Makefile,进行配置
修改1:
+ARCH ?= arm
+CROSS_COMPILE ?= /usr/bin/arm-linux-(选择自己的交叉编译路径)
修改2
all: vmlinux
cp arch/arm/boot/zImage . -f mkimage -A arm -O linux -T kernel -C none -a 30008040 -n "Linux Kernel" -d zImage linuxrom-s3c2440.bin
rm -f zImage
1.2修改晶振频率
vim arch/arm/mach-s3c2440/mach-smdk2440.c
static void __init smdk2440_map_io(void)
{
s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc));
s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(smdk2440_uartcfgs, ARRAY_SIZE(smdk2440_uartcfgs));
}
1.3修改驱动的串口
#define S3C24XX_SERIAL_NAME "ttyS"
#define S3C24XX_SERIAL_MAJOR 204
#define S3C24XX_SERIAL_MINOR 64
1.4修改配置文件
参考mini2440的.config文件作为我们的默认.config文件,复制到当前目录。cp arch/arm/configs/mini2440_defconfig .config
1.5修改MACHINE ID
vim arch/arm/tools/mach-types将mini2440(356)和和s3c2440(1999)的machineID对调,即变为mini2440--1999 s3s2440--356
1.6进行nand flash分区
vim arch/arm/plat-s3c24xx/common-smdk.c
static struct mtd_partition smdk_default_nand_part[] = {
[0] = {
.name = "bootloader",
.size = SZ_1M,
.offset = 0,
},
[1] = {
.name = "linux",
.offset = MTDPART_OFS_NXTBLK,
.size = SZ_1M*15,
},
[2] = {
.name = "rootfs",
.offset = MTDPART_OFS_NXTBLK,
.size = SZ_1M*40,
},
[3] = {
.name = "apps",
.offset = MTDPART_OFS_NXTBLK,
.size = SZ_1M*50,
},
[4] = {
.name = "backup",
.offset = SZ_1M * 100,
.size = MTDPART_SIZ_FULL,
}
};
1.7配置内核
make menuconfig
System Type>> S3C2440 and S3C2442 Machines>>
1.8编译内核
make
2.根文件系统的制作
文件系统的配置自己在这偷个懒,有点晚不想写了,基本上参考参考文献就OK了。
不过有一点要注意,如果采用busybox,应该明白库的选择的方式,是动态链接还是静态链接,这回影响到后面的配置!
如果选择动态链接,要拷贝库文件。cp -rf /usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/* ./lib
如果选择静态链接,则要进行静态编译 arm-linux-gcc -static
参考文献:
1.内核配置
http://www.cnblogs.com/Ph-one/p/4578814.html
http://blog.csdn.net/baweiyaoji/article/details/64923767
2.根文件系统
http://blog.chinaunix.net/uid-20528014-id-4080867.html
http://blog.sina.com.cn/s/blog_6648c1140100w16l.html
http://blog.csdn.net/newnewman80/article/details/7971317
http://blog.csdn.net/geekcome/article/details/6542117
http://blog.csdn.net/mcu_tian/article/details/51556398 (采用静态的方式)