Chinaunix首页 | 论坛 | 博客
  • 博客访问: 238248
  • 博文数量: 32
  • 博客积分: 557
  • 博客等级: 中士
  • 技术积分: 431
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-20 23:05
文章分类

全部博文(32)

文章存档

2015年(4)

2014年(2)

2012年(4)

2011年(22)

分类: 嵌入式

2011-04-27 21:29:29

U-Boot 通过传递给bootm的参数找到Linux内核镜像;
bootm 40020000
U-Boot 通过给内核传递root参数,使内核找到根文件系统;
bootargs=root=/dev/nfs rw nfsroot=10.0.0.2:/LinuxPPC nfsaddrs=10.0.0.99:10.0.0.2
阅读(4238) | 评论(13) | 转发(1) |
给主人留下些什么吧!~~

wangjianchangdx2011-05-02 18:54:47

接下来:
往前的大方向是编写并调试驱动,同时完善构建起来的真个U-Boot/Linux Kernel/RootFS架构,加深对嵌入式系统运作的理解。

wangjianchangdx2011-05-02 18:40:48

搞定,最后一个问题:执行/linuxrc是报错:
### init/main.c: init_post :852
### execute_command :/linuxrc
Kernel panic - not syncing: Attempted to kill init!
Backtrace:
[<c002d414>] (dump_backtrace+0x0/0x114) from [<c0306ec4>] (dump_stack+0x18/0x1c)
r7:c0c24000 r6:c0c24000 r5:c0c27ee4 r4:c0411a04
[<c0306eac>] (dump_stack+0x0/0x1c) from [<c0306f28>] (panic+0x60/0xf0)
原因是我在调试根文件系统无法读取的问题时,把内核中关于EABI的选项给去掉了,重新加上之后,出现了久违的shell!
下面

wangjianchangdx2011-05-02 17:43:06

接下来的问题是无法挂载mtdblock3,我的原因在于烧写flash时参数给错了。
网上还有其他的一些相同现象,但原因不同的,如内核和文件系统编译时的EABI;编译内核时未选相应的文件系统,ECC未禁止等。
我使用的busybox的版本是1.18.4,里面没有找到关于EABI的选项。
Buffer I/O error on device mtdblock3, logical block 3
uncorrectable error :
uncorrectable error :
end_request: I/O error, dev mtdblock3, sector 0
FAT: unable to read boot sector
VFS: Cannot open root device "mtdblock3" or unknown-block(31,3)
Please append a correct "root="

wangjianchangdx2011-05-02 16:13:03

串口无法打印printk的原因在于kernel cmd line设置错误
实验发现:只有在Linux Boot Options中配置ttySAC0时,才会打印在串口中,ttyS0无作用,tty0可以使信息打印在LCD上,默认情况下打印在LCD上。
U-Boot提供的bootargs无作用。
这些效果可能与console的配置有关。

经过后续学习,发现是u-boot配置的原因,需要在配置里添加CONFIG_CMDLINE_ATAG,才会向Linux Kernel传递参数。
参看另一篇文章《Linux内存容量识别》

wangjianchangdx2011-05-02 13:55:22

经过跟踪发现,setpull之所以会失败,是因为没有配置该函数。
mini2440_init->s3c_gpio_setpull->s3c_gpiolib_getchip,s3c_gpio_do_setpull,跟踪发现s3c_gpio_do_setpull函数调用失败。但该函数中只有一句:
return (chip->config->set_pull)(chip, off, pull);
所以检查第一个函数,该函数定义有两处,根据s3c_gpio_setpull所在C文件的头文件(#include <plat/gpio-core.h>),得知使用的是gpio-core.h中的定义,其定义以条件编译的形式出现:
#ifdef CONFIG_S3C_GPIO_TRACK
extern struct s3c_gpio_chip *s3c_gpios[S3C_GPIO_END];

static inline struct s3c_gpio_chip *s3c