2010年9月12日 星期日

booting error

Re: kernel 总是不跑,各位高手看看

很多原因可以造成这样的问题,最常见的问题是你是否设置正确了mach_type,比如在ARM上它应该被保存在r1内。还有就是你是否将压缩的内核放置到了正确的位置然后去启动的。

上述两个是比较常见的问题,供你参考


   
Re: kernel 总是不跑,各位高手看看

你用的是什么cpu?
我用串口做终端是这样的
在head.S加debug宏可以找出启动解压的地址对不对
内核配置加debug_ll可以找出是arch error 还是 cpu error
在终端还没通之前
有个print_ch最低级的串口函数,其他问题可以用这个函数代替printk
找原因
当然如果你编译设置不对就帮不上忙了


   
Re: kernel 总是不跑,各位高手看看

我的也是这样,正在查找原因呢??

我是直接通过终端下载压缩的内核,然后,直接执行go 指令,不知道这样做是不是会出现问题??

我现在怀疑是上面两位老兄提出的,不过,我看了一下代码,觉得没有什么不对的。管理上太乱了。



   
Re: kernel 总是不跑,各位高手看看

如何在head.S中加入debug宏呢?

还有我看他们一般都是用 puts那个指令,您的print_ch是一个什么函数?
在什么地方定义的?


   
Re: kernel 总是不跑,各位高手看看

在head.s里面直接加或在makefile里面加
#define DEBUG
执行后解压就会出来启动地址和arch type
你可以看代码
#ifdef DEBUG
kputc #'\n'
kphex r6, 8 /* processor id */
kputc #':'
kphex r7, 8 /* architecture id */
kputc #':'
mrc p15, 0, r0, c1, c0
kphex r0, 8 /* control reg */
kputc #'\n'
kphex r5, 8 /* decompressed kernel start */
kputc #'-'
kphex r8, 8 /* decompressed kernel end */
kputc #'>'
kphex r4, 8 /* kernel execution address */
kputc #'\n'
#endif
.endm
内核配置里面打开config_debug_ll
最低级串口函数应该里面有把,可能puts,可能记不清了
各个cpu都不同
等这些都确定对了后面还有大把要调
用puts看看执行到哪一部分挂掉,注意先把串口终端调通
没有仿真器只能这样调了

   
Re: kernel 总是不跑,各位高手看看

多写着为仁兄,我已经看了代码,直到如何去改了,不过我的想法一直都没有好用过。
我现在出现了如下消息

Uncompressing Linux.......................................... done, booting the
kernel.

41129200:000000FB:00001078
200AA1CC-201DDB4C>20008000
201DDB4C
20008000: E1A0C000 E3A000D3 E121F000 EB00005A E33A0000 03A00070 0A00004D EB0000
6A
20008020: E3370000 03A00061 0A000049 EB00001F E28FE01C E28AF00C C0008080 C013B9
80
20008040: C0163498 C013C6D8 C013C6D4 C0132D84 C0132000 E51FE024 EE010F10 EE110F
10
20008060: E1A00000 E1A00000 E1A0F00E 00000000 00000000 00000000 00000000 000000
00
20008080: E24F304C E89321F0 E3A0B000 E1540005 3484B004 3AFFFFFC E5869000 E58710
00
200080A0: E3800002 E3C02002 E8880005 EA00013D E24F40B8 E2444901 E1A00004 E3A030
00
200080C0: E2802901 E4803004 E4803004 E4803004 E4803004 E1300002 1AFFFFF9 E3C42A
FF
200080E0: E0883002 E7843922 E2840A03 E3C3260F E5802000 E2800000 E4803004 E28336
01

我是从u_boot跑起来直接将compressed kernel的文件zImage直接下载到20008000的内存中。
然后,通过go指令直接执行这个东西,就可以出现这个消息了,

给我的感觉,第一行都是对的,就是我是采用的arm920的cpu,然后,arch id的确为251
可是,我现在有一个怀疑的地方就是解压缩的过程将内核搞到了200AA1CC-201DDB4C
这个地方,而我的执行地址确是20008000

不知道解释的是否有误??
还请大侠指教。



   
Re: kernel 总是不跑,各位高手看看

你是多少版本的内核的?
检查一下你内核上载地址zimage里面有
Offset Value Meaning
------ ----- -------
0x24 0x016f2818 magic number identifying an ARM zImage binary
0x28 0xa0200000 link (or load) address for this zImage
0x2c 0xa02b4ccc end address for zImage
(values above come from my DBPXA250 zImage)
比如我的装载地址是0xa0200000
现在手头没linux,无法核对你解压地址是否正确,
用debug-armv.s里面的
printascii
printch这类的函数调试
在printk还没生效之前
我自己也是没防真器,都是这样调的






   
Re: kernel 总是不跑,各位高手看看

我的内核是arm linux 2.4.21版本的/

你的意思就是说在zImage里面有这些信息。

对了,您在什么地方?
可否一叙??

多谢您的帮忙



   
Re: kernel 总是不跑,各位高手看看

解压后内核执行地址转到head-armv.s 的stext里面
在stext里面写测试语句就知道解压地址对不对
ENTRY(stext)
mov r0,#'*'
bl printch
mov r12, r0
我原来也用过2.4.21
不过用cpu是xscale,上载地址是0xa0200000




   
Re: kernel 总是不跑,各位高手看看

1. Basic Checks
2. Loader Checks
3. Debug Checks Please apply the head-armv.S patch. This patch is against 2.4.7 kernels.
Check Description Value Result
BOOT_MEM
(pram,pio,vio)
parameters.
pram: physical start address of RAM. It is expected to be 128MB aligned.
pio: physical start address of 8MB debug region of IO.
vio: virtual start address of 8MB debug region of IO.
TEXTADDR This defines where the kernel will expect to be running in virtual memory once the MMU is
turned on.
ZRELADDR ZRELADDR must be equal to __virt_to_phys(TEXTADDR) (if using compressed kernels)
Check Description Value Result
Load address The kernel must be loaded at the correct physical address (noncompressed kernels:
__virt_to_phys(TEXTADDR), compressed kernels: ZTEXTADDR)
Execution address The kernel must be called at the same address that it was loaded. (see Load address above).
Kernel called with
cache off
Since the kernel is changing page tables and other stuff around, it must be called with the
caches turned off, and any dirty data flushed back to system memory.
Kernel called with
MMU off
Since the kernel is changing page tables and other stuff around, it must be called with the MMU
turned off.
Correct values in
registers r1 must contain the correct machine number.
Check Description Value Result
Mem: line
First value: physical address of the start of memory
Second value: page table start address - should be TEXTADDR - 0x4000 (we'll call this value
PGSTART)
Identity: line
First value: Current PC value & 0xfff00fff (ie physical address of this code rounded down to the MB
boundary)
Second value: Same as first value, but with level one page table flags added
Section1:
line
First value: offset into page tables. Virtual address of mapping = (this_value - PGSTART) << 18 ==
(TEXTADDR & 0xff000000).
Second value: current address of PC & 0xff000000
Third value: offset into page tables. Virtual address of this mapping = (this_value - PGSTART) << 18 ==
(TEXTADDR & 0xfff00000).
Section2:
line
First value: offset into page tables. Virtual address of mapping = (this_value - PGSTART) << 18 ==
PAGE_OFFSET.
Second value: Physical address of start of RAM, with page table flags.

   
Re: kernel 总是不跑,各位高手看看

谢谢,arm linux这篇文章讲的很清楚了


   
Re: kernel 总是不跑,各位高手看看

非常感谢大家的指教,我怀疑标记列表的设置不对,我把它起始地址设置在0xC000200

   
Re: kernel 总是不跑,各位高手看看

检查你用的是哪个串口!
是不是内核的调试信息没有输出到你所连接的串口中?

   
我用的是串口1 115200波特率

难道Kernal在解压完毕,引导之后就换到COM2了?

   
Re: 我用的是串口1 115200波特率

检查你的内核启动参数 是否是 console=ttyS0 !

   
Re: 内核启动参数,在那里查?

我的BootLoader跑起来后,我参照Blob设置了标记列表,有没有这个标志列表现象一样。下载完毕后,直接从内核的启动地址0xC300000处开始运行,出现Uncompressing Linux................ done, booting the kernel.我不清楚解压的uCLinux核心到那个地址,它又怎么知道要传入参数的标记列表的位置,Blob将它放在0xC000100的位置,假若它解压时将标记列表覆盖则么办?


   
内核参数这样设定对吗

我现在使用一块ti公司的双核cpu(arm+dsp),但是该的地址是这样子的
0-4 是reset vector rom
4- 0x8000 是Inernal Ram
0x100000-0x800000 是flash的范围 基址固定的
0xA00000-0x1200000 是sdram的范围
系统复位是就跳到flash的地址.设置了
FASHBASE=0X100000
DRAM_BASE=0x00A00000
DRAM_SIZE ==X800000
TEXTADDR=0XA00000

BOOT_MEM(0XA00000,IO_BASE,IOBASE)

现在情况是执行到free_all_bootmem_node()后就执行不下去了.各位dx请指点

   
Re: 内核参数这样设定对吗

看样子你是用OMAPxxx型的CPU,我对这个东东不熟啊!
我用44b0 。

   
Re: 内核参数这样设定对吗

但我觉得同时arm7tdmi系列,实现的方式应该是差不多的。调试了好长一段时间,还是没结果

   
uclinux运行出错

我在运行kernel+fs出现一下错误,原因是不能成功mount root filesystem。我不知道kernel是怎么找filesystem的,那位dx能说明一下么。

ttyS00 at 0x30300 (irq = 12)
ttyS01 at 0x30380 (irq = 13)
Blkmem copyright 1998,1999 D. Jeff Dionne
Blkmem copyright 1998 Kenneth Albanowski
Blkmem 1 disk images:
0: 100000-B1003FF [VIRTUAL 100000-B1003FF] (RO)
RAMDISK driver initialized: 16 RAM disks of 16K size 1024 blocksize
do_basic_setup leave!
fs_name is romfs
Kernel panic: VFS: Unable to mount root fs on 1f:00

沒有留言:

張貼留言