主题 : uboot 启动 kernel 问题 复制链接 | 浏览器收藏 | 打印
级别: 侠客
UID: 28121
精华: 0
发帖: 58
金钱: 290 两
威望: 58 点
综合积分: 116 分
注册时间: 2010-09-06
最后登录: 2017-09-13
楼主  发表于: 2010-09-14 11:42

 uboot 启动 kernel 问题

      又遇到问题了,自己编译的tekkaman的源码u-boot-2010.03 for mini2440
     http://blog.chinaunix.net/u1/34474/showart.php?id=2217066
      从nand flash启动uboot一切正常, 但是加载zImage出现了错误,具体如下:
   试用了几个不同的kernel,都出现了下面的状况,有自己编译的,也有盘里的,证明不是kernel的问题
  
[u-boot@C-JOK]# tftp 30008000 zImage_T35
dm9000 i/o: 0x20000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 08:08:11:18:12:27
operating at 100M full duplex mode
Using dm9000 device
TFTP from server 172.30.22.164; our IP address is 172.30.22.165
Filename 'zImage_T35'.
Load address: 0x30008000
Loading: T #################################################################
         #################################################################
         ##########################################
done
Bytes transferred = 2516916 (2667b4 hex)
[u-boot@C-JOK]# go 30008000
## Starting application at 0x30008000 ...
Uncompressing Linux.............................................................
................................................................................
...................... done, booting the kernel.


先谢谢了
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2010-09-14 18:59
1. uboot不支持直接启动zImage格式的内核镜像。你需要做成uImage.
2. 从sdram中启动uImage, 用bootm
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 侠客
UID: 25655
精华: 0
发帖: 86
金钱: 440 两
威望: 88 点
综合积分: 172 分
注册时间: 2010-07-27
最后登录: 2018-12-08
2楼  发表于: 2010-09-14 20:24
如楼上所说 有没有用mkimage
级别: 侠客
UID: 28121
精华: 0
发帖: 58
金钱: 290 两
威望: 58 点
综合积分: 116 分
注册时间: 2010-09-06
最后登录: 2017-09-13
3楼  发表于: 2010-09-14 22:38
恩,用过uImage的,但是也不行,具体的状况下:
[u-boot@C-JOK]# tftp 30008000 uImage2.6.29
dm9000 i/o: 0x20000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 08:08:11:18:12:27
operating at 100M full duplex mode
Using dm9000 device
TFTP from server 172.30.22.164; our IP address is 172.30.22.165
Filename 'uImage2.6.29'.
Load address: 0x30008000
Loading: T #################################################################
         #################################################################
         ########
done
Bytes transferred = 2022456 (1edc38 hex)
[u-boot@C-JOK]# bootm 30008000
## Booting kernel from Legacy Image at 30008000 ...
   Image Name:   Linux-2.6.29.4-FriendlyARM
   Created:      2010-09-11  21:02:50 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2022392 Bytes =  1.9 MB
   Load Address: 30008000
   Entry Point:  30008000
   Verifying Checksum ... OK
   XIP Kernel Image ... OK
OK

Starting kernel ...

data abort
pc : [<30008008>]          lr : [<33fa6578>]
sp : 33f3de04  ip : 00000000     fp : 30008000
r10: 33fc3208  r9 : 000007cf     r8 : 33f3ffe0
r7 : 33f3ffc4  r6 : 33f412ad     r5 : 30000100  r4 : 00000000
r3 : 00000000  r2 : 30000100     r1 : 000007cf  r0 : 00000000
Flags: nzCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

resetting ...


*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
4楼  发表于: 2010-09-15 07:35

 回 3楼(376240497) 的帖子

不要把uImag加载到0x30008000,那会和它里面的zImage加载地址冲突
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 侠客
UID: 25655
精华: 0
发帖: 86
金钱: 440 两
威望: 88 点
综合积分: 172 分
注册时间: 2010-07-27
最后登录: 2018-12-08
5楼  发表于: 2010-09-15 10:31
其实直接bootm貌似也可以吧 我经常这样做实验。。。

这个问题应该是 传递参数有问题造成的吧?多半出现在制作header上




我建议你改成go启动 用bootm麻烦不是一般的多。
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
6楼  发表于: 2010-09-15 15:26
我建议你改成go启动 用bootm麻烦不是一般的多。


正常的内核从来都不是用go命令来启动的。内核镜像的启动需要bootm来设置ATAGS以及传递正确的machine ID。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 侠客
UID: 25655
精华: 0
发帖: 86
金钱: 440 两
威望: 88 点
综合积分: 172 分
注册时间: 2010-07-27
最后登录: 2018-12-08
7楼  发表于: 2010-09-15 18:57

 回 6楼(kasim) 的帖子

是啊
所以我直接在go命令下加了一个tag 结构体的代码
级别: 侠客
UID: 28121
精华: 0
发帖: 58
金钱: 290 两
威望: 58 点
综合积分: 116 分
注册时间: 2010-09-06
最后登录: 2017-09-13
8楼  发表于: 2010-09-16 12:34
问题是解决了,但是原因还没找到
   1>bootm 0x30008000   这么启动,会重新复位
   2>bootm 0x31000000 就启动正常

   这是header的信息:
   Image Name: linux-2.6.32.2-CJOK
      Created: tue sep
      Image Type:ARM Linux Kernel Image(uncompressed)
      Data Size  :  2.4M
   Load Address: 30008000
      Entry Point:       30008000
想问下这是什么原因,下面是具体的信息:

[u-boot@C-JOK]# tftp 0x30008000 uImage2.6.32.2new.img
dm9000 i/o: 0x20000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 08:08:11:18:12:27
operating at 100M full duplex mode
Using dm9000 device
TFTP from server 172.30.22.164; our IP address is 172.30.22.165
Filename 'uImage2.6.32.2new.img'.
Load address: 0x30008000
Loading: T #################################################################
         #################################################################
         ##########################################
done
Bytes transferred = 2516960 (2667e0 hex)
[u-boot@C-JOK]# bootm 0x30008000
## Booting kernel from Legacy Image at 30008000 ...
   Image Name:   linux-2.6.32.2-CJOK
   Created:      2010-09-14   7:45:57 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2516896 Bytes =  2.4 MB
   Load Address: 30008000
   Entry Point:  30008000
   Verifying Checksum ... OK
   XIP Kernel Image ... OK
OK

Starting kernel ...

data abort
pc : [<30008008>]          lr : [<33fa6578>]
sp : 33f3de04  ip : 00000000     fp : 30008000
r10: 33fc3208  r9 : 000007cf     r8 : 33f3ffe0
r7 : 33f3ffc4  r6 : 33f412ad     r5 : 30000100  r4 : 00000000
r3 : 00000000  r2 : 30000100     r1 : 000007cf  r0 : 00000000
Flags: nzCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

resetting ...


U-Boot 2010.03 (Sep 09 2010 - 14:10:37)

modified by tekkamanninja (tekkamanninja@163.com)
Love Linux forever!!

I2C:   ready
DRAM:  64 MB
Flash:  2 MB
NAND:  256 MiB
Video: 240x320x16 20kHz 62Hz
In:    serial
Out:   serial
Err:   serial
USB slave is enable!
Net:   dm9000
U-Boot 2010.03 (Sep 09 2010 - 14:10:37)
modified by tekkamanninja
(tekkamanninja@163.com)
Love Linux forever!!
Hit any key to stop autoboot:  0
[u-boot@C-JOK]#
[u-boot@C-JOK]# bootm 31000000
## Booting kernel from Legacy Image at 31000000 ...
   Image Name:   linux-2.6.29-C-JOK
   Created:      2010-09-14   7:34:30 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1931904 Bytes =  1.8 MB
   Load Address: 30008000
   Entry Point:  30008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux.............................................................
................................................................. done, booting
the kernel.
Linux version 2.6.29.4-FriendlyARM (root@localhost.localdomain) (gcc version 4.3
.2 (Sourcery G++ Lite 2008q3-72) ) #1 Tue Sep 14 14:59:49 HKT 2010
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
                        ........................................
                        .......................................
                                 省略
                        .......................................
                        .......................................
级别: 侠客
UID: 25655
精华: 0
发帖: 86
金钱: 440 两
威望: 88 点
综合积分: 172 分
注册时间: 2010-07-27
最后登录: 2018-12-08
9楼  发表于: 2010-09-16 13:10
这问题抽象了。。。

怎么会跳到31000000。。。