Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2098085
  • 博文数量: 333
  • 博客积分: 10161
  • 博客等级: 上将
  • 技术积分: 5238
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-19 08:59
文章分类

全部博文(333)

文章存档

2017年(10)

2014年(2)

2013年(57)

2012年(64)

2011年(76)

2010年(84)

2009年(3)

2008年(37)

分类: 嵌入式

2010-10-21 16:48:31

RHEL5.2中架设skyeye+uClinux环境

刚开始学习linux嵌入式开发,经过2天的尝试,今天终于把skyeye+uClinux配置成功了,特记下我配置的过程,希望对你有用!!

说下我的系统平台:我用的是在linux下的VMare+RHEL5.2(2.6.18-92.el5)

首先下载如下版本的文件:

skyeye: skyeye-1.2.5_REL.tar.gz

下载地址:

arm-elf-tools: arm-elf-tools-20040427.sh

下载地址:

arm-linux-tools: arm-linux-tools-20070808.tar.gz
下载地址:


uClinux: uClinux-dist-20080808.tar.bz2

下载地址:



安装步骤:

1
、安装arm-elf-tools交叉编译环境:

chmod a+x arm-elf-tools-20030314.sh

./arm-elf-tools-20030314.sh

[root@work ~]# which arm-elf-gcc
/usr/local/bin/arm-elf-gcc

说明 arm-elf-gcc 已经安装
如果提示错误:
tail:
。。。。“+43”。。。。。

gunzip: stdin: not in gzip format

解决方法如下:

这是由于脚本中的tail没写对,必须加一个 -n 参数

vi打开 arm-elf-tools-20030314.sh

将第39行的代码:


tail +${SKIP} ${SCRIPT} | gunzip | tar xvf -

改成如下:


tail -n +${SKIP} ${SCRIPT} | gunzip | tar xvf -

2
、安装arm-linux-tools交叉编译环境:


tar zxvf arm-linux-tools-20070808.tar.gz
就好在本目录下产生一个usr目录,比如我的就是/root/usr/这时要把它链接到/usr/local/
ln -n /root/usr/local /usr/local/arm
编辑.bash_profile添加一行export PATH=$PATH:/usr/local/arm/bin
保存重启系统


3
、安装skyeye
tar zxvf skyeye-1.2.5_REL.tar.gz 进入解压后的skyeye目录,接下来执行:

不过在之前可以执行一下它里的configure一下,查看它的的一些配置的允许是怎么样的,我就觉得无聊,顺便熟悉一下configure就运行一下,不过要等待一会儿,(懒得就不用了,呵呵)

接着

make

make install

或用./configure && make &&make install命令来安装。

注意,可能在编译的时候,会出现安装的文件出错,这时就要求手动复制skyeye/usr/local/bin,就可以运用了skyeye
skyeye
会出现一下信息:
[root@work ~]# 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.
***********************************************************************

Your elf file is little endian.
Failed to open skyeye config file skyeye.conf in the same directory
error: No such file or directory
SkyEye 1.2.5
Bug report:
skyeye-developer@lists.gro.clinux.org
Usage: skyeye [options] -e program [program args]
Default mode is STANDALONE mode
------------------------------------------------------------------
Options:
-e exec-file the (ELF executable format)kernel file name.
-l load_address,load_address_mask
Load ELF file to another address, not its entry.
-b specify the data type is big endian when non "-e" option.
-d in GDB Server mode (can be connected by GDB).
-c config-file the skyeye configure file name.
-h The SkyEye command options, and ARCHs and CPUs simulated.
------------------------------------------------------------------
----------- Architectures and CPUs simulated by SkyEye-------------
-------- ARM architectures ---------
at91
lpc
s3c4510b
s3c44b0x
s3c44b0
s3c3410x
ep7312
lh79520
ep9312
cs89712
sa1100
pxa_lubbock
pxa_mainstone
at91rm92
s3c2410x
s3c2440
sharp_lh7a400
ns9750
-------- BlackFin architectures ----
bf533
bf537


3
、编译uClinux
#tar jxvf uClinux-dist-20080808.tar.bz2
#cd uClinux-dist
#make menuconfig
选择
Vendor/Product: GDB/Skyeye
Kernel Version: linux-2.6.x
Libc Version: uClibc
保存退出

uclinux-dist 目录下建立仿真AT91skyeye配置文件 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=./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
lcd: state=on

 

生成boot.rom

# make romfs; make image

如果在/usr/src/uClinux-dist/images/下存在文件 boot.rom,表示文件系统生

成成功。

然后是建立文件系统的联接,需要在目录/usr/src/uClinux-dist目录下执行如下命令:
        #ln -s images/romfs.img boot.rom

然后执行:
make dep

make


错误提示和解决:

提示:scripts/lxdialog/dialog.h:32:20: curses.h: No such file or directory

解决:安装ncurses-devel


4
、在skyeye下运行uClinux

这个时候就可以用skyeye来调试运行kernel了,在uclinux-dist执行如下命令:


skyeye -e linux-2.6.x/linux
需要注意的是我已经在/usr/bin目录中建立了一个skyeye的符号连接,所以上面才不需要输入skyeye的完整路径。另外,由于skyeye.conf就在当前目录下,所以也就不用在skyeye命令中使用-c参数指定了
下面是uClinux跑起来的界面显示:

[root@work uClinux-dist]# skyeye -e linux-2.6.x/linux
Your elf file is little endian.
arch: arm
cpu info: armv3, arm7tdmi, 41007700, fff8ff00, 0
mach info: name at91, mach_init addr 0x805eb60
uart_mod:0, desc_in:, desc_out:, converter:
SKYEYE: use arm7100 mmu ops
Loaded ROM images/boot.rom
start addr is set to 0x01008000 by exec file.
Linux version 2.6.25-uc0 (root@work) (gcc version 4.2.1) #1 Wed Oct 15 14:30:09 CST 2008
CPU: Atmel-AT91M40xxx [14000040] revision 0 (ARMvundefined/unknown), cr=00000000
Machine: Atmel AT91 EB01
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 4064
Kernel command line:
PID hash table entries: 64 (order: 6, 256 bytes)
console [ttyS0] enabled
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 16MB = 16MB total
Memory: 15284KB available (820K code, 74K data, 60K init)
Mount-cache hash table entries: 512
io scheduler noop registered (default)
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
brd: module loaded
uclinux[mtd]: RAM probe address=0x1400000 size=0xff000
Creating 1 MTD partitions on "ROM":
0x00000000-0x000ff000 : "ROMfs"
uclinux[mtd]: set ROMfs to be root filesystem
VFS: Mounted root (romfs filesystem) readonly.
Freeing init memory: 60K
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 <
>
For further information check:


Execution Finished, Exiting

Sash command shell (version 1.1.1)
/>

注意:要在 skyeye.conf 所在目录下执行skyeye
这时典型的浮点问题,你可能要降低你的编译工具版本,
或者修改arm-linux-gcc配置文件,或者在内核目录下找相应架构的配置文件,去除软浮点运算
或者选择本文提到的arm-linux-tools版本的工具,并选择linux 2.6.x内核,可顺利完成

 

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