|
在Skyeye上运行RTMES
作者 Ray
RTEMS版权所有,转载请注明来源www.rtems.net,作者Ray
Skyeye(http://www.skyeye.org/)是由
陈渝先生发起的一个开源ARM硬件仿真平台,可以仿真多种ARM开发板。下面介绍在Skyeye上如何运行RTEMS。
首先在http://gro.clinux.org/projects/skyeye/上面下载skyeys的开发包,如果是Redhat等,可以直接下载RPM包。我只介绍FreeBSD下面的skyeye源代码安装。
(1) 使用的平台是FreeBSD 5.3,安装的时候除了安装工具链还需要选择安装
-
gmake
-
gtk
-
pkgconfig
-
automake和autoconf
(2)解开skyeye-v0.x.x.tar.bz2 :
tar jxf skyeye-v0.8.7.tar.bz
(3)从http://l123.org/~ivan/skyeye.freebsd.diff下载BSD的补丁(因为Skyeye最早是为Linux开发的,其网络驱动在BSD不能直接使用),并且安装补丁包。
wget http://l123.org/~ivan/skyeye.freebsd.diff
patch < skyeye.freebsd.diff
cd skyeye
目前http://gro.clinux.org/projects/skyeye/上面也由补丁包下载。
(4)设置CFLAGS
如果是tcsh(BSD缺省root shell)
setenv CFLAGS -O -pipe
对于BASH:(编译可以通过,但是网络转发模块加载有些问题)
CFLAGS="-O -pipe"
进入解压后的skyeye目录,按照SkyEye.README介绍的步骤做configure,make,make
install(注意红色部分)
$cd skyeye
$./configure --target=arm-rtems --prefix=/usr/local
--without-gtk-prefix --without-gtk-exec-prefix --disable-gtktest
如果需要GTK的支持(对于只安装了KDE的用户来说,譬如我,有时候会出问题)
$./configure --target=arm-rtems --prefix=/usr/local
$make
$make install
现在一切应该都OK了。
修改EP7312的BSP,操作如下:
(1)linkcmds
首先是 rtems- 4.6.2 /c/src/lib/libbsp/arm/edb7312 目录下面的 linkcmds
,修改如下
1.change linkcmds from 0x00000000 to 0xC0000000
MEMORY
{
sdram : ORIGIN = 0xC0000000 , LENGTH = 16M
regs : ORIGIN = 0x80000000,
LENGTH = 1M
}
/* * Declare some sizes. */
_sdram_base = DEFINED(_sdram_base) ? _sdram_base
: 0xC0000000 ;
(2) 修改 bsp_irq_init.c
修改 rtems- 4.6.2 /c/src/lib/libbsp/arm/edb7312/irq 目录下面的 bsp_irq_init.c
因为 skyeye 仿真 EP7312 平台还不支持 EP7312_INTMR2 , EP7312_INTMR3
注释掉下面两行
/* *EP7312_INTMR2 = 0x0; */
/* *EP7312_INTMR3 = 0x0;
*/
这里使用了老式 /**/ 的注释方式,因为考虑到旧版本的交叉 C 编译器不支持 “//”
(3) 编译 ep7312 的 BSP
$../../rtems- 4.6.2 /configure --target=arm-rtems
\
--disable-posix --disable-networking --disable-cxx
\
--prefix=/home/ray/embedded/rtems-build/edb7312
$make RTEMS_BSP="edb
7312”
然后在 samples 和 test 目录下面就有编译好的二进制文件。
(哇,怎么有 2M ,这不是和 linux 有的拼 ?
嘿嘿。这个二进制文件是带调试信息的,如果用 -O2 编译,就只有几十 KB 了)
(8) 建一个 skyeye 的配置文件
#skyeye.conf
#skyeye config file sample
cpu: arm720t
mach: ep7312
mem_bank: map=I,type=RW, addr=0x80000000, size=0x00010000
mem_bank: map=M,
type=RW, addr=0xc0000000, size=0x1000000
log: logon=1, logfile=/tmp/sk1.log,
start=2000000, end=3000000
将配置文件 skyeye.conf 存放在
测试的代码同一路径下
(9)GO GO GO!!!
下面是命令运行情况:
-bash-2.05b$ skyeye hello.exe
***********************************************************************
****
SkyEye Simulator Ver 0.8.6 with GDB 5.3 Interface ****
***********************************************************************
GNU gdb 5.3
Copyright 2002 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 SkyEye was configured as "--host=i386-unknown-freebsd5.3
--target=arm-rtems"...
(SkyEye) target sim
cpu info: armv4, arm720t, 41807200,
ffffff00, 1
mach info: name ep7312, mach_init addr 0x8143cf0
log_info: log is on.
log_info:log file is /tmp/sk1.log, fd is 0x 28a
2a 8c 8
log_info: log start clock 2000000
log_info: log end clock 3000000
SKYEYE: use arm7100 mmu ops
Connected to the simulator.
(SkyEye) load
Loading section .init, size 0x4 vma 0xc0000120
Loading section
.text, size 0x12ad4 vma 0xc0000124
Loading section .fini, size 0x4 vma
0xc0012bf8
Loading section .data, size 0x8ec vma 0xc0012bfc
Loading section .rodata,
size 0xe17 vma 0xc00134e8
Start address 0xc0000124
Transfer rate: 659192 bits in <1 sec.
(SkyEye) run
Starting program: /usr/home/ray/embed/rtems/edb7312/arm-rtems/edb7312/tests/hello.exe
*** HELLO WORLD TEST ***
Hello World
*** END OF HELLO WORLD TEST ***
EXECUTIVE SHUTDOWN! Any key to reboot...
|