S(含AX88796驱动及mdev支持)(4)

七、配置内核
1、载入s3c2410的默认配置文件,以简化配置过程
lingd@Ubuntu:~/arm2410s/linux-2.6.24.7$ cp arch/arm/configs/s3c2410_defconfig .config
lingd@ubuntu:~/arm2410s/linux-2.6.24.7$ make menuconfig
2、手动配置内核,在s3c2410_defconfig基础上,增加以下配置选项:
General setup  --->    
[*] Configure standard kernel features (for small systems) --->  选上这项,否则文件系统中的一些选项不会出现 [*] Enable full-sized data structures for core    
[*] Enable futex support      
[*] Enable eventpoll support    
[*] Enable signalfd() system call         
[*] Enable eventfd() system call    
[*] Use full shmem filesystem [*] Enable loadable module support ---> [*] Automatic kernel module loading System Type ---> [*] S3C2410 DMA support Boot options ---> Default kernel command string:noinitrd root=31:03 init=/linuxrc console=ttySAC0,115200 mem=64M
注意:udev需要内核提供sysfs和tmpfs支持,sysfs为udev提供设备入口和uevent通道,tmpfs为udev设备文件提供存放空间,也就是说,在上电之前系统上是没有足够的设备文件可用的,我们需要一些技巧让kernel先引导起来。由于在kernel启动未完成以前我们的设备文件不可用,如果使用mtd设备作为rootfs的挂载点,这个时候/dev/mtdblock 是不存在的,我们无法让kernel找到rootfs,kernel只好停在那里惊慌(panic)。
这个问题我们可以通过给kernel传递设备号的方式来解决,在linux系统中,mtdblock的主设备号是31,part号 从0开始,那么以前的/dev/mtdblock/3就等同于31:03,以次类推,所以我们只需要修改bootloader传给kernel的cmd line参数,使root=31:03,就可以让kernel在udevd未起来之前成功的找到rootfs。  Networking ---> Networking options ---> <*> Packet socket [*] Packet socket: mmapped IO Floating point emulation ---> [*] NWFPE math emulation Device Drivers ---> <*> Memory Technology Devices (MTD ---> [*] MTD partitioning support [*] Command line partition table parsing RAM/ROM/Flash chip drivers ---> <*> Detect flash chips by Common Flash Interface (CFI) probe <*> Detect nonCFI AMD/JEDECcompatible flash chips <*> Support for Intel/Sharp flash chips <*> Support for AMD/Fujitsu flash chips <*> Support for ROM chips in bus mapping <*> NAND Device Support ---> <*> NAND Flash support for S3C2410/S3C2440 SoC Network device support ---> [*] Ethernet (10 or 100Mbit) ---> “N”掉< > DM9000 support和< > Generic Media Independent Interface device support -------以下一定要选上,是AX88796的驱动------ [*] Other ISA cards <*> NE2000/NE1000 support Character devices ---> [*] Nonstandard serial port support File systems ---> <> Second extended fs support #去除对ext2的支持
Pseudo filesystems --->   udev依赖sysfs,同时他还要求/dev目录可写,因此我们可以把/dev 挂载成tmpfs。所以在配置内核时,我们需要同时支持sysfs和tmpfs:     
[*] /proc file system support         
[*]   Sysctl support (/proc/sys)                 
[*] sysfs file system support         
[*] Virtual memory file system support (former shm fs)         
[*]   Tmpfs POSIX Access Control Lists         
[*] Userspace-driven configuration filesystem Miscellaneous filesystems ---> <*> YAFFS2 file system support #支持yaffs2 [*] Lets Yaffs do its own ECC <*> Compressed ROM file system support (cramfs) [*]Network File Systems ---> <*> NFS file system support --以下最好选上,因为在挂载NFS时可能出现protocol不支持的情况-- [*]Provide NFSv3 client support [*]Provide client support for the NFSv3 ACL protocol extension [*] Provide NFSv4 client support (EXPERIMENTAL) [*] Allow direct I/O on NFS files ------------------------------------------------------------------------- [ ] NFS server support [*] Root file system on NFS 保存退出,产生.config文件。 八、编译内核 内核的编译操作 lingd@ubuntu:~/arm2410s/linux-2.6.24.7$ make menuconfig 配置编译选项 lingd@ubuntu:~/arm2410s/linux-2.6.24.7$ make dep 提供变量依赖关系信息 lingd@ubuntu:~/arm2410s/linux-2.6.24.7$ make clean 删除生成的模块和目标文件 lingd@ubuntu:~/arm2410s/linux-2.6.24.7$ make zImage 编译内核生成压缩的映像 lingd@ubuntu:~/arm2410s/linux-2.6.24.7$ make modules 编译模块 lingd@ubuntu:~/arm2410s/linux-2.6.24.7$ make modules_install 安装编译完成的模块 至此,内核的编译工作完成,在arch/arm/boot目录下生成了zImage文件,即为压缩的内核映像。 最后,将内核镜像烧写到博创arm2410s开发板上,启动正常,网卡也正常

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wwsgdy.html