skyeye 的几个 BUG
VER 1.2.41、对 ELF 格式的文件的 RODATA1 段的处理有问题,RODATA段调入时应该直接保存在ROM区域,然后由应用程序COPY到RAM中完成全局变量初始化,现在是直接重定位到RAM中,而ROM区域却全0,导致程序初始化时COPY的全0;用.bin格式就没有问题。
2、skyeye_flash.c 文件中的 skyeye_flash_dump 函数有错误,应该为 if ((*read_word_func)(addr, &data) != 0) {
[ 本帖最后由 深思 于 2008-7-10 19:16 编辑 ] 1、是否有比较明显的例子证明这个bug?
2、能否给出原因? 原帖由 深思 于 2008-7-10 18:23 发表 http://www.linuxfans.org/bbs/images/common/back.gif
2、skyeye_flash.c 文件中的 skyeye_flash_dump 函数有错误,应该为 if ((*read_word_func)(addr, &data) != 0)
刚回过头看了看,确实是我写错了。
这个 dump() 我没有仔细调试,抱歉!
PS: ksh 麻烦你把这行改过来,device/flash/skyeye_flash.c 第 161 行 base 改为 addr。谢谢。 elf@elf-ubuntu:~/ecos/ecos-cvs/temp/44b0/rbof_install/bin$ ./skyeye -e redboot.elf
big_endian is false.
arch: arm
cpu info: armv3, arm7tdmi, 41007700, fff8ff00, 0
mach info: name s3c44b0, mach_init addr 0x8057f70
uart_mod:0, desc_in:, desc_out:, converter:
SKYEYE: use arm7100 mmu ops
exec file "redboot.elf"'s format is elf32-little.
not load section .debug_aranges: addr = 0x00000000size = 0x00001288 .
not load section .debug_pubnames: addr = 0x00000000size = 0x0000221f .
not load section .debug_info: addr = 0x00000000size = 0x00024ff0 .
not load section .debug_abbrev: addr = 0x00000000size = 0x0000569b .
not load section .debug_line: addr = 0x00000000size = 0x00014702 .
not load section .debug_frame: addr = 0x00000000size = 0x000032a0 .
not load section .debug_str: addr = 0x00000000size = 0x0000529e .
load section .rom_vectors: addr = 0x00000000size = 0x00000040.
load section .text: addr = 0x00000040size = 0x0000fdbc.
not load section .fini: addr = 0x0000fdfcsize = 0x00000000 .
load section .rodata: addr = 0x0000fdfcsize = 0x00002e8f.
not load section .rodata1: addr = 0x00012c8csize = 0x00000000 .
not load section .fixup: addr = 0x00012c8csize = 0x00000000 .
not load section .gcc_except_table: addr = 0x00012c8csize = 0x00000000 .
not load section .fixed_vectors: addr = 0x0c000100size = 0x00000140 .
load section .data: lma = 0x00012c8c (vma = 0x0c000240)size = 0x00000858.
not load section .bss: addr = 0x0c000a98size = 0x000043c8 .
not load section .debug_ranges: addr = 0x00000000size = 0x00000650 .
call ARMul_InitSymTable,kernel filename is redboot.elf.
start addr is set to 0x00000040 by exec file.
在上面 load section .data: lma = 0x00012c8c (vma = 0x0c000240)size = 0x00000858.
这里数据应该定位在ROM区域,而现在是0x00012c8c区域是全0
下面是同一个程序的BIN格式,如果需要程序测试请告诉我一个邮箱。
elf@elf-ubuntu:~/ecos/ecos-cvs/temp/44b0/rbof_install/bin$ ./skyeye
**************************** WARNING **********************************
If you want to run ELF image, you should use -e option to indicate
your elf-format image filename. Or you only want to run binary image,
you need to set the filename of the image and its entry in skyeye.conf.
***********************************************************************
big_endian is false.
arch: arm
cpu info: armv3, arm7tdmi, 41007700, fff8ff00, 0
mach info: name s3c44b0, mach_init addr 0x8057f70
uart_mod:0, desc_in:, desc_out:, converter:
SKYEYE: use arm7100 mmu ops
Loaded RAM ./redboot.bin
+FLASH: driver init failed: Driver does not support device
Sorry, FLASH config exceeds available space in FIS directory
RedBoot(tm) bootstrap and debug environment
Non-certified release, version UNKNOWN - built 18:54:10, Jul 10 2008
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Copyright (C) 2003, 2004, 2005, 2006 eCosCentric Limited
RAM: 0x0c000000-0x0c800000, available
FLASH: 0x00000000 - 0x1, 0 blocks of 0x00000000 bytes each.
RedBoot> (gdb) target remote 127.0.0.1:12345
Remote debugging using 127.0.0.1:12345
0x00000040 in reset_vector ()
(gdb) x /10x 0x00012c8c
0x12c8c: 0x00000000 0x00000000 0x00000000 0x00000000
0x12c9c: 0x00000000 0x00000000 0x00000000 0x00000000
0x12cac: 0x00000000 0x00000000
(gdb) x /10x 0xc000240
0xc000240 <init_flag>:0x00000000 0x00008310 0x00008310 0x00008310
0xc000250 <hal_interrupt_handlers+12>:0x00008310 0x00008310 0x00008310 0x00008310
0xc000260 <hal_interrupt_handlers+28>:0x00008310 0x00008310
(gdb) c
Continuing.
Can't send signals to this remote system.SIGHUP not sent.
Program received signal SIGHUP, Hangup.
...
(gdb) x /10x 0xc000240
0xc000240 <init_flag>:0x00000000 0x00000000 0x00000000 0x00000000
0xc000250 <hal_interrupt_handlers+12>:0x00000000 0x00000000 0x00000000 0x00000000
0xc000260 <hal_interrupt_handlers+28>:0x00000000 0x00000000
(gdb) 总结一下,你的意思是本来数据应该由skyeye放到lma的位置,现在放到了vma的位置。是否和下面这个帖子的问题一样?
http://lists.gro.clinux.org/pipermail/skyeye-developer/2006-January/000825.html 是的,是一个意思。源码里面没有改为 bfd_section_lma (tmp_bfd, s)。
但是,我按PATCH修改了以后又出现了另外一个的问题,
: write_byte: Unsupported !!! 在开始加载不同section的时候,会调用arm_ICE_write_byte去加载数据到内存中。
目前arm_ICE_write_byte调用的是ARMul_ICE_WriteByte , 你可以改成让arm_ICE_write_byte调用real_write_byte去把不同section加载到模拟的存储设备中。这样会绕过这个问题。 :( 我对skyeye还不是太熟悉, 这个问题我恐怕解决不了. 反正现在BIN 格式的没问题, 大家用ELF格式的时候注意就是了.
回复 #9 深思 的帖子
在下面的链接中,我做了一个patch解决LMA加载的问题,能否帮我测试一下?http://lists.gro.clinux.org/pipermail/skyeye-developer/2008-August/001857.html 当设置内存属性为M时(mem_bank: map=M, type=RW, addr=0x00000000, size=0x00200000),测试正确。
但设置为F时,出现 : write_byte: Unsupported!!! 错误,程序不能运行。
附件中是测试程序。
页:
[1]