开发板为 FriendlyARM Tin210
linux 内核使用 linux-2.6.38.5
路径 ~/kernel/linux-2.6.38.5
先解压 linux-2.6.38.5.tar.bz2
cd ~/kernel
tar xvf linux-2.6.38.5.tar.bz2
获取最新yaffs源码
mkdir ~/yaffs
cd ~/yaffs
git clone git://www.aleph1.co.uk/yaffs2
给内核打补丁
cd yaffs2
./patch-ker.sh c m ~/kernel/linux-2.6.38.5
会有提示
Updating ~/kernel/linux-2.6.38.5/fs/Kconfig
Updating ~/kernel/linux-2.6.38.5/fs/Makefile
修改 内核Makefile 为 arm 编译链
(编译时必需确定是arm交叉编译链,否则make menuconfig会是错误的配置)
cd ~/kernel/linux-2.6.38.5
vim Makefile
修改
ARCH ?= $(SUBARCH)
CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
为(根据个人情况而定)
ARCH ?= arm
CROSS_COMPILE ?= arm-none-linux-gnueabi-
配置内核选项
cp arch/arm/configs/s5pv210_defconfig .config
make menuconfig
然后到
File systems --->
Miscellaneous filesystems --->
看是否有 yaffs2 file system support (NEW) 选项,如果没有,需要先配置好 MTD_BLOCK,如下:
进入menuconfig首页
Device Drivers --->
用空格将 Memory Technology Device (MTD) support ---> 状态变为<*>
进入选项 Memory Technology Device (MTD) support --->
将 Caching block device access to MTD devices 状态变为<*>
如果 没有看到 Caching block device access to MTD devices ,先保存现在的配置,退出,重新make menuconfig进入
选中选项 <*> Caching block device access to MTD devices 后,
在 File systems --->
Miscellaneous filesystems --->
会出现 yaffs2 file system support (NEW) 选项,将其状态变为<*>
修改debug输出串口号,和开发板不一致的话,启动内核会在打印完Starting kernel...之后就没有任何输出了
修改位置1
Boot options --->
如果使用了启动参数,将
root=/dev/ram0 rw ramdisk=8192 initrd=0x20800000,8M console=ttySAC1,115200 init=/linuxrc
中 ttySACX 改为 自己对应的串口号 如 ttySAC0
修改位置2
System Type --->
修改 S3C UART to use for low-level messages 的值为 (0)
修改位置3
Kernel hacking --->
修改 S3C UART to use for low-level debug 的值为 (0)
保存配置,
make uImage
错误现象:
dm9000 dm9000: read wrong id 0x2b2a2928
dm9000 dm9000: wrong id: 0x2b2a2928
dm9000 dm9000: not found (-19).
TCP cubic registered
NET: Registered protocol family 17
Registering the dns_resolver key type
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 2
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "nfs" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
配置内核支持NFS + DM9000 ,部分引用网络文章:
(1) 配置网络支持
[*] Networking support --->
Networking options --->
<*> Packet socket
<*> Unix domain sockets
[*] TCP/IP networking
[*] IP: multicasting
[*] IP: kernel level autoconfiguration
[*] IP: DHCP support
[*] IP: BOOTP support
[*] IP: RARP support
[*] IP: multicast routing
(2) 配置网卡设备支持
Device Drivers --->
[*] Network device support --->
[*] Ethernet driver support --->
<*> DM9000 support
(3) 配置网络文件系统支持
File systems --->
[*] Network File Systems ---&