QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 4678|回复: 20

为什么在skyeye下运行uclinux会出现Segmentation fault的问题

[复制链接]
发表于 2007-10-19 13:50:35 | 显示全部楼层 |阅读模式
我在SUSE10下安装了arm-elf-tools-20030314.sh和uClinux-dist-20070130.tar.gz,均公共。并且在GDB上模拟运行uclinux,如下:
linux:/usr/src/uclinux-dist/uClinux-dist/linux-2.4.x # arm-elf-gdb linux
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-elf"...
(gdb) target sim
Loaded ROM boot.rom
Loaded ROM boot.rom
Loaded ROM boot.rom
Loaded ROM boot.rom
Connected to the simulator.
(gdb) load
Loading section .init, size 0xa000 vma 0x1000000
Loading section .text, size 0xd4da0 vma 0x100a000
Loading section .data, size 0x9b20 vma 0x10e0000
Start address 0x1000000
Transfer rate: 7620096 bits in <1 sec.
(gdb) run
Starting program: /usr/src/uclinux-dist/uClinux-dist/linux-2.4.x/linux
Linux version 2.4.24-uc0 (root@linux) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)) #20 Fri Oct 19 10:27:55 CST 2007
Processor: Atmel AT91M40xxx revision 0
Architecture: EB01
On node 0 totalpages: 1024
zone(0): 0 pages.
zone(1): 1024 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/rom0
Calibrating delay loop... 15.82 BogoMIPS
Memory: 4MB = 4MB total
Memory: 2968KB available (851K code, 179K data, 40K init)
Dentry cache hash table entries: 512 (order: 0, 4096 bytes)
Inode cache hash table entries: 512 (order: 0, 4096 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 1024 (order: 0, 4096 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Atmel USART driver version 0.99
ttyS0 at 0xfffd0000 (irq = 2) is a builtin Atmel APB USART
ttyS1 at 0xfffcc000 (irq = 3) is a builtin Atmel APB USART
Blkmem copyright 1998,1999 D. Jeff Dionne
Blkmem copyright 1998 Kenneth Albanowski
Blkmem 1 disk images:
0: 1400000-14ABFFF [VIRTUAL 1400000-14ABFFF] (RO)
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 512 bind 512)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
VFS: Mounted root (romfs filesystem) readonly.
Shell invoked to run file: /etc/rc
Command: hostname GDB-ARMulator
Command: /bin/expand /etc/ramfs.img /dev/ram0
Command: mount -t proc proc /proc
Command: mount -t ext2 /dev/ram0 /var
Command: mkdir /var/tmp
Command: mkdir /var/log
Command: mkdir /var/run
Command: mkdir /var/lock
Command: mkdir /var/empty
Command: cat /etc/motd
Welcome to
          ____ _  _
         /  __| ||_|
    _   _| |  | | _ ____  _   _  _  _
   | | | | |  | || |  _ \| | | |\ \/ /
   | |_| | |__| || | | | | |_| |/    \
   |  ___\____|_||_|_| |_|\____|\_/\_/
   | |
   |_|

GDB/ARMulator support by <[email protected]>
For further information check:
http://www.uclinux.org/

Execution Finished, Exiting

Sash command shell (version 1.1.1)


但是我在安装了skyeye(skyeye-1.0.0.tar.bz2)后,却运行不了uclinux。
skyeye.conf为:
cpu: arm7tdmi
mach: at91
mem_bank: map=M, type=RW, addr=0x00000000, size=0x00004000
mem_bank: map=M, type=RW, addr=0x01000000, size=0x00400000
mem_bank: map=M, type=R, addr=0x01400000, size=0x00400000, file=images/romfs.img
mem_bank: map=M, type=RW, addr=0x02000000, size=0x00400000
mem_bank: map=M, type=RW, addr=0x02400000, size=0x00008000
mem_bank: map=M, type=RW, addr=0x04000000, size=0x00400000
mem_bank: map=I, type=RW, addr=0xf0000000, size=0x10000000

当我运行时却不能成功 :
linux:/usr/src/uclinux-dist/uClinux-dist # ./skyeye -e linux-2.4.x/linux
------------------------- SkyEye -V1.0 ---------------------------
Usage: SkyEye [options] program [program args]
Default mode is STANDALONE mode
------------------------------------------------------------------
Options:
-e exec-file        the (ELF executable format)kernel file name.
-d                  in GDB Server mode (can be connected by GDB).
-c config-file      the skyeye configure file name.
-h                  This Help Display
------------------------------------------------------------------
debugmode= 0, filename = (null), server TCP port is 12345
cpu info: armv3, arm7tdmi, 41007700, fff8ff00, 0
mach info: name at91, mach_init addr 0x8086ba0
SKYEYE: use arm7100 mmu ops
Loaded ROM   images/romfs.img
Segmentation fault

请问Segmentation fault是什么原因引起的 ,该怎样解决?

谢谢!
 楼主| 发表于 2007-10-19 15:12:07 | 显示全部楼层

回复 #1 xiuzhou 的帖子

另外,在README里写到需要在skyeye.conf里的mach: at91 一行后加上mem_num:7,但是我加上后运行却出现这样的 提示:Unkonw option: Mem_num,请问是不是skyeye.conf的原因?谢谢!
回复

使用道具 举报

 楼主| 发表于 2007-10-19 16:06:30 | 显示全部楼层

回复 #2 xiuzhou 的帖子

是不是uClinux-dist-20070130.tar.gz版本的问题?
回复

使用道具 举报

发表于 2007-10-23 10:29:03 | 显示全部楼层
换个低点的版本试试
回复

使用道具 举报

 楼主| 发表于 2007-10-23 14:41:55 | 显示全部楼层

回复 #4 siuwash 的帖子

低版本的uClinux-dist-20020097.tar.gz和uClinux-dist-20030522.tar.gz都试过了,而且skyeye也换了几个版本,问题容然是到了Loaded ROM   images/romfs.img
Segmentation fault就停下了。哪位知道这是为什么,该怎么样解决,谢谢!
回复

使用道具 举报

 楼主| 发表于 2007-10-24 14:26:29 | 显示全部楼层

回复 #5 xiuzhou 的帖子

而且我安装了ucosii,在skyeye上运行也是出现了同样的问题,如下:
------------------------- SkyEye -V1.0 ---------------------------
Usage: SkyEye [options] program [program args]
Default mode is STANDALONE mode
------------------------------------------------------------------
Options:
-e exec-file        the (ELF executable format)kernel file name.
-d                  in GDB Server mode (can be connected by GDB).
-c config-file      the skyeye configure file name.
-h                  This Help Display
------------------------------------------------------------------
debugmode= 0, filename = (null), server TCP port is 12345
arch: arm
cpu info: armv3, arm7tdmi, 41007700, fff8ff00, 0
mach info: name at91, mach_init addr 0x8056730
SKYEYE: use arm7100 mmu ops
Segmentation fault

还是到了Segmentation fault就停下了,我在arm-elf-gdb下可以正常运行ucosii。
因此怀疑是不是skyeye的 原因。但是我换了几个版本,哦都不能解决,有哪位高手能够帮帮我,谢谢!
回复

使用道具 举报

发表于 2007-10-27 20:50:30 | 显示全部楼层
You can follow the document on SkyEye.org : http://skyeye.wiki.sourceforge.net/uClinux. Some options and usage you encountered is toooooold.
回复

使用道具 举报

 楼主| 发表于 2007-10-30 09:32:59 | 显示全部楼层

回复 #7 ksh 的帖子

谢谢ksh,问题正在解决中。
回复

使用道具 举报

 楼主| 发表于 2007-10-31 09:51:12 | 显示全部楼层

回复 #7 ksh 的帖子

你好ksh,根据你给的连接我我还是没有找到解决方法。其实是我根本就不知道问题出在哪,到哪去找答案。我也根据里面的一些指导试了几次,没有成功。能否麻烦你详细的指点一下,谢谢。
回复

使用道具 举报

发表于 2007-10-31 16:46:24 | 显示全部楼层
completely try the way provided by  http://skyeye.wiki.sourcef orge.net/uClinux.  if encountered some error , please describe it in detail. post your skyeye.conf here. In my mind,  at91 simulation in SkyEyeshould be stable.
回复

使用道具 举报

 楼主| 发表于 2007-11-1 10:39:44 | 显示全部楼层

回复 #10 ksh 的帖子

hi,ksh,我按照“1) uClinux-dist-20070130 on At91 platform”下的步骤来的,在“make menuconfig”下选择了“GDB/ARMulator”,“linux-2.6.x”,“uClibc”。运行make命令后没有出现错误,在linux-2.6.x文件夹下生成了linux,在images文件夹下生成了boot.rom和linux两个文件。skyeye.conf直接拷贝网站上的,但是file=./romfs.img,找不到romfs.img这个文件(以前用inux-2.4.x时,先“make dep”,然后make,在images这个文件夹下会生成romfs.img。)。
skyeye.conf如下:
#skyeye config file sample
cpu: arm7tdmi

mach: at91

mem_bank: map=M, type=RW, addr=0x00000000, size=0x00004000
mem_bank: map=M, type=RW, addr=0x01000000, size=0x00400000
mem_bank: map=M, type=R, addr=0x01400000, size=0x00400000, file=./romfs.img
mem_bank: map=M, type=RW, addr=0x02000000, size=0x00400000
mem_bank: map=M, type=RW, addr=0x02400000, size=0x00008000
mem_bank: map=M, type=RW, addr=0x04000000, size=0x00400000
mem_bank: map=I, type=RW, addr=0xf0000000, size=0x10000000
net: type=rtl8019, mac=0:4:3:2:1:f, ethmod=tuntap, hostip=10.0.0.1
#net: type=rtl8019_16, ethmod=tuntap, hostip=10.0.0.1
#dbct: state=on

当输入:./skyeye -e linux-2.6.x/linux后的结果是 :
big_endian is false.
arch: arm
cpu info: armv3, arm7tdmi, 41007700, fff8ff00, 0
mach info: name at91, mach_init addr 0x8061c30
ethmod num=1, mac addr=0:4:3:2:1:f, hostip=10.0.0.1
uart_mod:0, desc_in:, desc_out:, converter:
SKYEYE: use arm7100 mmu ops
./romfs.img: No such file or directory
bank 2, Couldn't open boot ROM ./romfs.img - execution will commence with the debuger.

请问为什么没有在images文件夹下生成romfs.img?

谢谢
回复

使用道具 举报

发表于 2007-11-2 10:52:10 | 显示全部楼层
Probably the file under images/ is named boot.rom, that depends on the version of uClinux, you need to copy images/boot.rom to current directory of skyeye.conf , and rename it to romfs.img. Or modify the content of skyeye.conf
回复

使用道具 举报

 楼主| 发表于 2007-11-2 11:29:04 | 显示全部楼层

回复 #12 ksh 的帖子

yes,there is one file named boot.rom,I have modified the skyeye.conf:

#skyeye config file sample
cpu: arm7tdmi

mach: at91

mem_bank: map=M, type=RW, addr=0x00000000, size=0x00004000
mem_bank: map=M, type=RW, addr=0x01000000, size=0x00400000
mem_bank: map=M, type=R, addr=0x01400000, size=0x00400000, file=./images/boot.rom
mem_bank: map=M, type=RW, addr=0x02000000, size=0x00400000
mem_bank: map=M, type=RW, addr=0x02400000, size=0x00008000
mem_bank: map=M, type=RW, addr=0x04000000, size=0x00400000
mem_bank: map=I, type=RW, addr=0xf0000000, size=0x10000000
net: type=rtl8019, mac=0:4:3:2:1:f, ethmod=tuntap, hostip=10.0.0.1
#net: type=rtl8019_16, ethmod=tuntap, hostip=10.0.0.1
#dbct: state=on

Input the command: ./skyeye -e linux-2.6.x/linux  and the rusult is:

big_endian is false.
arch: arm
cpu info: armv3, arm7tdmi, 41007700, fff8ff00, 0
mach info: name at91, mach_init addr 0x8061c30
ethmod num=1, mac addr=0:4:3:2:1:f, hostip=10.0.0.1
uart_mod:0, desc_in:, desc_out:, converter:
SKYEYE: use arm7100 mmu ops
Loaded ROM   ./images/boot.rom
Segmentation fault

I want to know why always occured "Segmentation fault"? Thank you?

Hi,ksh,May I have your email?!
回复

使用道具 举报

 楼主| 发表于 2007-11-6 09:59:56 | 显示全部楼层

回复 #13 xiuzhou 的帖子

Hi,ksh,are you here?Please help me!Thanks!
回复

使用道具 举报

发表于 2007-11-12 12:18:27 | 显示全部楼层
xiuzhou 你好,不知道你的问题解决了没有!
我也是刚刚接触嵌入式linux。
我看了一下,如果按照你给的skyeye.conf,应该是没有什么问题的。
说明你的boot.rom文件有问题。你试试make clean一下,重新编译一下内核呢?
下面是我的skyeye.conf,我能将uClinux跑起来,但是调试它还有些问题,希望交流交流。

#skyeye config file sample
cpu: arm7tdmi

mach: at91

mem_bank: map=M, type=RW, addr=0x00000000, size=0x00004000
mem_bank: map=M, type=RW, addr=0x01000000, size=0x00400000
mem_bank: map=M, type=R, addr=0x01400000, size=0x00400000, file=./boot.rom
mem_bank: map=M, type=RW, addr=0x01800000, size=0x00400000
mem_bank: map=M, type=RW, addr=0x02400000, size=0x00008000
mem_bank: map=M, type=RW, addr=0x04000000, size=0x00400000

mem_bank: map=I, type=RW, addr=0xf0000000, size=0x10000000

mem_bank: map=M, type=RW, addr=0xc0000000, size=0x00100000

lcd: state=on, type=ep7312, mod=gtk
#dbct: state=on
#dbct: state=of
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-23 01:23 , Processed in 0.075286 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表