免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: voidjackjiang

[g-bios] 完善boot kernel机制 [复制链接]

论坛徽章:
0
发表于 2011-10-12 21:55 |显示全部楼层
回复 10# CQMW114


      boot -f 7 启动后生成的默认 command line 参数为: ubi.mtd=7 root=ubi0_0 rootfstype=ubifs

      因此,对 boot -l 选项的测试没有对照性啊!

论坛徽章:
0
发表于 2011-10-13 10:55
Introduction about UBI and UBIFS structrure


Description block
UBI For Internal-vol,Wearleveling,Scrubbing 4
For Bad Block 20



SuperBlock/Master Block 3
LOG/LPT 14
UBIFS Empty Block 24
Main Area Index Block 19
Data Block 1964

论坛徽章:
0
发表于 2011-10-13 18:20 |显示全部楼层
  1. [    2.983032] Creating 8 MTD partitions on "omap2-nand.0":
  2. [    2.988708] 0x000000000000-0x000000080000 : "g-bios"
  3. [    3.049896] 0x000000080000-0x000000280000 : "g-bios"
  4. [    3.075469] 0x000000280000-0x0000002a0000 : "g-bios"
  5. [    3.100097] 0x0000002a0000-0x0000005a0000 : "linux"
  6. [    3.129669] 0x0000005a0000-0x0000008a0000 : "ramdisk"
  7. [    3.156799] 0x0000008a0000-0x0000048a0000 : "rootfs"
  8. [    3.233215] 0x0000048a0000-0x0000088a0000 : "data_1"
  9. [    3.310333] 0x0000088a0000-0x000010000000 : "data_2"
  10. [    3.438690] OneNAND driver initializing
  11. [    3.456329] UBI: attaching mtd7 to ubi0
  12. [    3.457092] UBI: physical eraseblock size:   131072 bytes (128 KiB)
  13. [    3.457611] UBI: logical eraseblock size:    126976 bytes
  14. [    3.458068] UBI: smallest flash I/O unit:    2048
  15. [    3.458496] UBI: VID header offset:          2048 (aligned 2048)
  16. [    3.458984] UBI: data offset:                4096
  17. [    3.469573] UBI error: validate_ec_hdr: bad VID header offset 512, expected 2048
  18. [    3.470214] UBI error: validate_ec_hdr: bad EC header
  19. ...........

  20. [    3.508148] Kernel panic - not syncing: Attempted to kill init!

复制代码

目前的问题是:bad VID header offset 512, expected 2048。 应该是参数设置错误,尝试修改ubinize -o ubi.img -m 2048 -p 128KiB -s 512 ubinize.cfg中的-s选项。
继续中。。。

论坛徽章:
0
发表于 2011-10-13 18:47 |显示全部楼层
本帖最后由 kopqiu 于 2011-10-13 18:57 编辑

boot kernel时出现ECC ERROR,修改linux-3.0/driver/mtd/nand/omap2.c
fix-omap-ecc.patch.tar.bz2 (40 KB, 下载次数: 40)

论坛徽章:
0
发表于 2011-10-13 18:58
经过分析讨论,在“ubinize -o ubi.img -m 2048 -p 128KiB -s 512 ubinize.cfg”中,将“-s”选项删去可以正常显示create volume table


  1. [    3.147918] 8 cmdlinepart partitions found on MTD device omap2-nand.0
  2. [    3.148529] Creating 8 MTD partitions on "omap2-nand.0":
  3. [    3.150146] 0x000000000000-0x000000080000 : "g-bios"
  4. [    3.197021] 0x000000080000-0x000000280000 : "g-bios"
  5. [    3.224334] 0x000000280000-0x0000002a0000 : "g-bios"
  6. [    3.261962] 0x0000002a0000-0x0000005a0000 : "linux"
  7. [    3.293640] 0x0000005a0000-0x0000008a0000 : "ramdisk"
  8. [    3.325256] 0x0000008a0000-0x0000048a0000 : "rootfs"
  9. [    3.404083] 0x0000048a0000-0x0000088a0000 : "data_1"
  10. [    3.481445] 0x0000088a0000-0x000010000000 : "data_2"
  11. [    3.601898] OneNAND driver initializing
  12. [    3.619140] UBI: attaching mtd7 to ubi0
  13. [    3.619903] UBI: physical eraseblock size:   131072 bytes (128 KiB)
  14. [    3.620574] UBI: logical eraseblock size:    126976 bytes
  15. [    3.621032] UBI: smallest flash I/O unit:    2048
  16. [    3.621429] UBI: VID header offset:          2048 (aligned 2048)
  17. [    3.622009] UBI: data offset:                4096
  18. [    7.465148] UBI: empty MTD device detected
  19. [    7.466430] UBI: max. sequence number:       0
  20. [    7.467559] UBI: create volume table (copy #1)
复制代码


下一步需要认出EC header

论坛徽章:
0
发表于 2011-10-14 19:11
制作UBIFS的步骤不变,没出现错误,卡死循环
  1. [    3.945495] UBI: physical eraseblock size:   131072 bytes (128 KiB)
  2. [    3.945983] UBI: logical eraseblock size:    126976 bytes
  3. [    3.946380] UBI: smallest flash I/O unit:    2048
  4. [    3.948364] UBI: VID header offset:          2048 (aligned 2048)
  5. [    3.949401] UBI: data offset:                4096
  6. [    7.917114] UBI: max. sequence number:       0
复制代码
决定查看linux3.0 源码的UBI部分,查找错误。。

论坛徽章:
0
发表于 2011-10-15 09:14 |显示全部楼层
尝试跟linux3.0中UBI的部分源码,加入调试语句,提前打印volume table的信息,进行比对分析,未发现参数有误:

  1.     UBI: attaching mtd4 to ubi0
  2.     UBI: physical eraseblock size: 131072 bytes (128 KiB)
  3.     UBI: logical eraseblock size: 129024 bytes
  4.     UBI: smallest flash I/O unit: 2048
  5.     UBI: sub-page size: 512
  6.     UBI: VID header offset: 512 (aligned 512)
  7.     UBI: data offset: 2048
  8.     UBI: attached mtd4 to ubi0
  9.     UBI: MTD device name: "File System"
  10.     UBI: MTD device size: 121 MiB
  11.     UBI: number of good PEBs: 970
  12.     UBI: number of bad PEBs: 2
  13.     UBI: max. allowed volumes: 128
  14.     UBI: wear-leveling threshold: 4096
  15.     UBI: number of internal volumes: 1
  16.     UBI: number of user volumes: 1
  17.     UBI: available PEBs: 0
  18.     UBI: total number of reserved PEBs: 970
  19. [color=Red]   UBI: number of PEBs reserved for bad PEB handling: 9[/color]
  20.     UBI: max/mean erase counter: 2/0
复制代码

论坛徽章:
0
发表于 2011-10-15 19:15 |显示全部楼层
设置跟踪调试语句,在ubi_io_write函数中停止,由于程序运行需要2个多小时,所以尝试找出运行时间长的原因:
  1. [    7.833740] vmt5 :LINE=569, FUN=ubi_resize_volume
  2. [    7.834136] vtbl: LINE=92,FUN=ubi_change_vtbl_record

  3. [    7.848419] eba: LINE=656,FUN=ubi_eba_write_leb
  4. [    7.848815] wl.c :LINE=419,FUN=ubi_wl_get_peb

  5. [    7.861267] wl.c :LINE=297,FUN=produce_free_peb
  6. [    7.861663] wl.c :LINE=223,FUN=do_work

  7. [    7.874237] ic.c :LINE=899,FUN=ubi_io_write_ec_hdr
  8. [    7.874664] ic.c :LINE=248,FUN=ubi_io_write

  9. [  169.957702] ic.c :LINE=903,FUN=ubi_io_write_ec_hdr
  10. [  169.959167] wl.c :LINE=266,FUN=do_work

  11. [  169.964813] wl.c :LINE=309,FUN=produce_free_peb
  12. [  169.965667] wl.c :LINE=444,FUN=ubi_wl_get_peb

  13. [  169.974212] eba: LINE=658,FUN=ubi_eba_write_leb

  14. [  169.979156] LINE=1160,FUN=ubi_io_write_vid_hdr
  15. [  169.979980] ic.c :LINE=248,FUN=ubi_io_write

  16. [  327.953582] eba: LINE=673,FUN=ubi_eba_write_leb

  17. [  327.955474] LINE=653,FUN=ubi_io_write_data
  18. [  327.956909] ic.c :LINE=248,FUN=ubi_io_write
复制代码

论坛徽章:
0
发表于 2011-10-15 20:04
运行两个多小时之后, 显示 “Unable to mount root fs  ”:

  1. [size=4][ 8575.461853] List of all partitions:
  2. [ 8575.463226] 1f00             512 mtdblock0  (driver?)
  3. [ 8575.464385] 1f01            2048 mtdblock1  (driver?)
  4. [ 8575.464874] 1f02             128 mtdblock2  (driver?)
  5. [ 8575.465362] 1f03            3072 mtdblock3  (driver?)
  6. [ 8575.465820] 1f04            3072 mtdblock4  (driver?)
  7. [ 8575.466278] 1f05           65536 mtdblock5  (driver?)
  8. [ 8575.466766] 1f06           65536 mtdblock6  (driver?)
  9. [ 8575.467315] 1f07          122240 mtdblock7  (driver?)
  10. [ 8575.467773] 1f08          116808 mtdblock8  (driver?)
  11. [ 8575.468261] No filesystem could mount root, tried:  ubifs
  12. [ 8575.468963] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)[/size]
复制代码

论坛徽章:
0
发表于 2011-10-18 15:56 |显示全部楼层
由于在虚拟机上启动kernel时间较长,中午改用s3c6400板子。安装minicom 2.5之后,启动g-bios发现无法输入命令行,所以尝试解决问题:
解决方法如下:
sudo minicon -s ->Serial port setup-> F - Hardware Flow Control,
将 F - Hardware Flow Control项中的“yes”改为"no"即可。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP