Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3305040
  • 博文数量: 754
  • 博客积分: 10132
  • 博客等级: 上将
  • 技术积分: 7780
  • 用 户 组: 普通用户
  • 注册时间: 2008-01-14 23:36
文章分类

全部博文(754)

文章存档

2012年(3)

2011年(39)

2010年(66)

2009年(167)

2008年(479)

我的朋友

分类: LINUX

2008-12-25 08:44:36

1. 问题一

  下载内核到flash中,运行到如下即停止没有下文:

Uncompressing Linux……………………done,booting the kernel

卡在这里不动了

原因分析:可能是内核的启动参数传递时没有填写正确,也可能是在linux内核中没对flash分区,还有另一可能原因是在内核编译配置时没将串口驱动勾选。

解决办法:

如果是命令参数问题,则作如下修改:注释掉arch/arm/kernel/setup.c文件中的parse_tag_cmdline()函数中的strlcpy()函数,这样就可以使用默认的CONFIG_CMDLINE了,在.config文件中它被定义为"root=/dev/mtdblock2 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,

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 s3c2410_platform_nand s3c_nand_info=

{

tacls:0,

twrph0:30,

twrph1:0,

sets:&nandset,

nr_sets:1,

};

以上分区和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:&nandset,

nr_sets:1,

};

struct platform_device s3c_device_nand={

.name="s3c2410-nand",

.id = -1,

.num_resources = ARRAY_SIZE(s3c_nand_resources),

.resource = s3c_nand_resource, /*黑体为新加内容*/

.dev = {

.platform_data=&s3c_nand_info

}

};

1.2 在arch/arm/mach-s3c2410/mach-smdk2410.c文件中添加&s3c_device_nand,如下所示:

static struct platform_device * smdk2410_device[] _initdata=

{

&s3c_device_usb,

&s3c_device_lcd,

&s3c_device_wdt,

&s3c_device_i2c,

&s3c_device_iis,

&s3c_device_nand,

};

配置好以上内容后重新编译内核即可。

如果是串口驱动没有勾选,则一定记住将勾上如下选项:

Character devices

-> Serial Drivers下的项勾上.

2. 出现如下错误:VFS:Cannot open root device "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 console=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 blocks

Creating 5 MTD partitions on "NAND 64MiB 3,3V 8-bit":

0x00000000-0x00040000 : "boot"

mtd: Giving out device 0 to boot

0x00040000-0x00200000 : "kernel"

mtd: Giving out device 1 to kernel

0x00200000-0x02000000 : "rootfs"

mtd: Giving out device 2 to rootfs

0x02000000-0x03000000 : "ext-fs1"

mtd: Giving out device 3 to ext-fs1

0x03000000-0x04000000 : "ext-fs2"

mtd: Giving out device 4 to ext-fs2

从上面看出我的文件系统放在第三个分区rootfs上,其设备号为2,启动后文件系统能挂上,如下所示

Reading data from NAND FLASH without ECC is not recommended

the error code is:0,name=/dev/root,fs=cramfs,flags=32769

VFS: Mounted root (cramfs filesystem) readonly.

Freeing init memory: 104K

Reading data from NAND FLASH without ECC is not recommended


init started: BusyBox v1.10.1 (2008-04-23 23:20:41 CST)

starting pid 229, tty '': '/etc/init.d/rcS'

Reading data from NAND FLASH without ECC is not recommended

the error code is:0,name=/dev/root,fs=cramfs,flags=32769

VFS: Mounted root (cramfs filesystem) readonly.

Freeing init memory: 104K

Reading data from NAND FLASH without ECC is not recommended


init started: BusyBox v1.10.1 (2008-04-23 23:20:41 CST)

starting pid 229, tty '': '/etc/init.d/rcS'

Please press Enter to activate this console.

4. 系统启动到到如下语句即停止不前,停在那里:

VFS:Mounted root (cramfs filesystem) 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 emulation

Support extended precision

FastFPE math emulation(EXPERIMENTAL)

5. 关于文件系统问题:在有些资料上提到在配置内核时选上devfs,如果不存在时则手动在文件里加上。但我在内核里面和busybox-1.10.1中都未加devfs支持,文件系统运行正常。在linux-2.6.14.1及以后版本中已去掉devfs。

6. linux-2.6.15.4这个版本也能成功在s3c2410上运行.

阅读(473) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~