linux_内核移植方法及错误.doc

上传人:hw****26 文档编号:3551923 上传时间:2019-06-04 格式:DOC 页数:26 大小:139KB
下载 相关 举报
linux_内核移植方法及错误.doc_第1页
第1页 / 共26页
linux_内核移植方法及错误.doc_第2页
第2页 / 共26页
linux_内核移植方法及错误.doc_第3页
第3页 / 共26页
linux_内核移植方法及错误.doc_第4页
第4页 / 共26页
linux_内核移植方法及错误.doc_第5页
第5页 / 共26页
点击查看更多>>
资源描述

1、出现问题:# Starting application at 0x30008000 .Uncompressing Linux.解决方案:setenv bootargs console=ttySAC0,115200 mem=64M ;console 明令在哪暂时还没解决?setenvTCP cubic registeredNET: Registered protocol family 1NET: Registered protocol family 17Root-NFS: No NFS server available, giving up.VFS: Unable to mount root f

2、s via NFS, trying floppy.VFS: Cannot open root device “ or unknown-block(2,0)Please append a correct “root=“ boot optionKernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)解决方法:把 08.05.11、 RAM disk support 09.27.07、 Compressed ROM file system support (cramfs) 1. 问题一下载内核到 fl

3、ash 中,运行到如下即停止没有下文:Uncompressing Linuxdone,booting the kernel卡在这里不动了原因分析:可能是内核的启动参数传递时没有填写正确,也可能是在 linux 内核中没对 flash 分区,还有另一可能原因是在内核编译配置时没将串口驱动勾选。解决办法:如果是命令参数问题,则作如下修改:注释掉 arch/arm/kernel/setup.c 文件中的parse_tag_cmdline()函数中的 strlcpy()函数,这样就可以使用默认的 CONFIG_CMDLINE 了,在.config 文件中它被定义为 “root=/dev/mtdbloc

4、k2 ro init=/linuxrc console=ttySAC0,115200“(视具体情况而定),在内核配置文件的 Boot options 中填入也可。如果是内核 NAND flash 分区的问题,则作如下修改:1. 1 修改文件 arch/arm/mach-s3c2410/devs.c,添加如下信息:#include #include #include static struct mtd_partition partition_info=name:“bootloader“,size:0x00040000,offset:0,name:“kernel“,size:0x001c0000,

5、offset:0x00040000,name:“rootfs“,size: 0x01e00000,offset:0x00200000,name:“ext-fs1“,size: 0x01000000,offset:0x02000000,name:“ext-fs2“,size: 0x01000000,offset:0x03000000,;/以上分区和 NAND flash 物理分区一样,分区不一样没试过,根据自己板子情况而定struct s3c2410_nand_set nandset=nr_partitions:5,partitions:partition_info,;struct s3c241

6、0_platform_nand s3c_nand_info=tacls:0,twrph0:30,twrph1:0,sets:以上分区和 NAND flash 物理分区一样,分区不一样没试过,根据自己板子情况而定struct s3c2410_nand_set nandset=nr_partitions:5,partitions:partition_info,;struct s3c2410_platform_nand s3c_nand_info=tacls:0,twrph0:30,twrph1:0,sets:struct platform_device s3c_device_nand=.name=

7、“s3c2410-nand“,.id = -1, .num_resources = ARRAY_SIZE(s3c_nand_resources),.resource = s3c_nand_resource, /*黑体为新加内容*/.dev = .platform_data=1.2 在 arch/arm/mach-s3c2410/mach-smdk2410.c 文件中添加配置好以上内容后重新编译内核即可。如果是串口驱动没有勾选,则一定记住将勾上如下选项:Character devices- Serial Drivers 下的项勾上.2. 出现如下错误:VFS:Cannot open root d

8、evice “mtdblock/2“ or unknown-block(0,0)Please append a correct “root=“ boot option.Kernel panic not syncing,VFS Unable to mount root fs on unknown-block(0,0)原因分析:出现这种情况一般有两种情况:没有文件系统或 boot options 参数不正确,如我的系统文件系统为 cramfs 格式,存放文件系统的分区为第三个分区,启动参数为:“noinitrd root=/dev/mtdblock2 ro init=/linuxrc consol

9、e=ttySAC0,115200 rootfstype=cramfs mem=64M“其中文件系统使用 busybox-1.10.1 制作重新编译即可。3. 系统启动后出现如下错误:Kernel panic -not syncing:VFS:Unable to mount root fs on unknown-block(31,2)或者类似的错误。原因分析:我在这里耗了大量的时间,这种情况一般是 NAND flash 分区未能分正确,或者所在的分区上没有文件系统,当启动中出现类似如下信息时表明分区正确了Scanning device for bad blocksCreating 5 MTD p

10、artitions on “NAND 64MiB 3,3V 8-bit“:0x00000000-0x00040000 : “boot“mtd: Giving out device 0 to boot0x00040000-0x00200000 : “kernel“mtd: Giving out device 1 to kernel0x00200000-0x02000000 : “rootfs“mtd: Giving out device 2 to rootfs0x02000000-0x03000000 : “ext-fs1“mtd: Giving out device 3 to ext-fs10

11、x03000000-0x04000000 : “ext-fs2“mtd: Giving out device 4 to ext-fs2从上面看出我的文件系统放在第三个分区 rootfs 上,其设备号为 2,启动后文件系统能挂上,如下所示Reading data from NAND FLASH without ECC is not recommendedthe error code is:0,name=/dev/root,fs=cramfs,flags=32769VFS: Mounted root (cramfs filesystem) readonly.Freeing init memory:

12、 104KReading data from NAND FLASH without ECC is not recommendedinit started: BusyBox v1.10.1 (2008-04-23 23:20:41 CST)starting pid 229, tty : /etc/init.d/rcSReading data from NAND FLASH without ECC is not recommendedthe error code is:0,name=/dev/root,fs=cramfs,flags=32769VFS: Mounted root (cramfs f

13、ilesystem) readonly.Freeing init memory: 104KReading data from NAND FLASH without ECC is not recommendedinit started: BusyBox v1.10.1 (2008-04-23 23:20:41 CST)starting pid 229, tty : /etc/init.d/rcSPlease press Enter to activate this console. 4. 系统启动到到如下语句即停止不前,停在那里:VFS:Mounted root (cramfs filesyst

14、em) readonly.Freeing init memory:104卡在这里没有下文原因分析:系统在启用 init 函数时有这么一句,粗体所示static int init(void * unused)if(execute_command)run_init_process(execute_command);在这句里面出错就会没有下文解决办法:在配置内核时少选了几句,将如下选择全选上Floating Point emulation-At least one emulation must be selected:NWFPE math emulationSupport extended prec

15、isionFastFPE math emulation(EXPERIMENTAL)5. 关于文件系统问题:在有些资料上提到在配置内核时选上 devfs,如果不存在时则手动在文件里加上。但我在内核里面和 busybox-1.10.1 中都未加 devfs 支持,文件系统运行正常。在 linux-2.6.14.1 及以后版本中已去掉 devfs。6. linux-2.6.15.4 这个版本也能成功在 s3c2410 上运行.内核编译成功后,启动后出现如下提示后就停住了。 。 。 。 。 。Freeing init memory: 72K Warning: unable to open an ini

16、tial console.!C+Q7f W 0 这个也是控制台 console 的问题,linux-2.6.13 以后的内核都支持 devfs,而之后版本的内核就把 devfs 这块去掉了,虽然还能在内核源码中找到对应的源码,你也可以把它加进内核,但是也不是太好用。2.6.13 后的版本改为支持 udev 了,udev 这块我也没太弄懂,正在研究。- Kernel Features Preemption Mode.config 里面的 CONFIG_PREEMPT_NONE 选项决定了 kernel 在挂在文件系统后可不能进入 shell。- Floating point emulationF

17、PE_NWFPE 选项如果未选上现象:IPv4 over IPv4 tunneling driverTCP bic registeredNET: Registered protocol family 1IP-Config: No network devices available.RAMDISK: ext2 filesystem found at block 0RAMDISK: Loading 4196KiB 1 disk into ram disk. done.EXT2-fs warning: mounting unchecked fs, running e2fsck is recommen

18、dedVFS: Mounted root (ext2 filesystem).Freeing init memory: 96Kkernel 启动到这里就停止了。- Device Drivers Block devicesCONFIG_BLK_DEV_RAM 选项 未选上CONFIG_BLK_DEV_INITRD 选项 未选上现象:loop: loaded (max 8 devices)nbd: registered device at major 43mice: PS/2 mouse device common for all miceIPv4 over IPv4 tunneling driv

19、erTCP bic registeredNET: Registered protocol family 1IP-Config: No network devices available.Root-NFS: No NFS server available, giving up.VFS: Unable to mount root fs via NFS, trying floppy.VFS: Cannot open root device “ram0“ or unknown-block(2,0)Please append a correct “root=“ boot optionKernel pan

20、ic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)1. 加载 kernel 后出现如下错误:NET: Registered protocol family 1Root-NFS: No NFS server available, giving up.VFS: Unable to mount root fs via NFS, trying floppy.VFS: Cannot open root device “mtdblock3“ or unknown-block(2,0)Please append a cor

21、rect “root=“ boot optionKernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)其中,linux command line is: “noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0,115200“解决方法,在 make menuconfig 后,选中 mtd 支持,cramfs 支持,/dev fs 支持。其中,添加/dev fs 支持具体操作如下:修改 fs/Kconfig,支持启动时挂载 devfs$vim fs/ Kconfig找到 menu “Pseudo filesystem”在其中添加:config DEVFS_FSbool “/dev file system support (OBSOLETE)”default yconfig DEVFS_MOUNTbool “Automatically mount at boot”default ydepends on DEVFS_FS 之后,boot 信息如下:

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育教学资料库 > 精品笔记

Copyright © 2018-2021 Wenke99.com All rights reserved

工信部备案号浙ICP备20026746号-2  

公安局备案号:浙公网安备33038302330469号

本站为C2C交文档易平台,即用户上传的文档直接卖给下载用户,本站只是网络服务中间平台,所有原创文档下载所得归上传人所有,若您发现上传作品侵犯了您的权利,请立刻联系网站客服并提供证据,平台将在3个工作日内予以改正。