ITEEDU

ubuntu系统下的skyeye的安装

站长原创,版权所有ITEEDU,2012-03-25

以前在开发板上学习了嵌入式qt开发和移植过程。板子还给学校实验室之后,就需要自己搭建模拟环境。在QMemu和skyeye中,我选择了skyeye,其配置较为简单,而且可以模拟多个arm系统,比如uCLinux、Linux、uC/OS-II等嵌入式操作系统。

1.下载并安装skyeye依赖包

执行命令:

sudo apt-get install libgtk2.0-dev pkg-config libatk1.0-dev libpango1.0-dev libfreetype6-dev libglib2.0-dev libx11-dev binutils-dev libncurses5-dev libxpm-dev

2.安装skyeye

有以下两种方式。

(1)利用命令

sudo apt-get install skyey

安装完成后运行skeye,显示如下:

**************************** 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

出现此界面说明安装成功。

(2)下载最新安装包并进行编译及安装

第一步:在skyeye官方网站http://sourceforge.net/projects/skyeye/files/上下载较新版本的skyeye,我下载的是当时最新的,skyeye-1.3.4_rc1.tar.gz。

第一步:解压缩原文件,tar -xvf  skyeye-1.3.4_rc1.tar.gz。

第二步:进入解压后的文件件。

第三步:安装。 

    sudo ./configure
  sudo make lib
  sudo make
  sudo make install
  sudo make install_lib

第四步:安装出现的问题及解决方案。

错误一、在安装过程中出现的各种错误主要是由于一些软件包未安装,我把额外需要的软件包列举出来:
termcap库文件:在终端里执行sudo apt-get install libncurses5-dev安装。
“XCreatePixmapFromData”错误:sudo aptitude install libxpm-dev 。
“makeinfo”错误:sudo apt-get install texinfo。
在安装skyeye之前,可以提前把上述三个库安装,以减少莫名其妙的错误。

错误二、

utils/uart_console/uart_console.c:58: 错误:expected identifier or ‘(’ before numeric constant
utils/uart_console/uart_console.c:59: 错误:expected identifier or ‘(’ before numeric constant
utils/uart_console/uart_console.c:62: 错误:expected identifier or ‘(’ before numeric constant
utils/uart_console/uart_console.c:63: 错误:expected identifier or ‘(’ before numeric constant 

错 误:expected identifier or ‘(’ before numeric constant
是因为在其它头文件中已将 POLLRDNORM那些定义,此处是已被define
解决方法,将58到63行注释
//const uint32_t POLLRDNORM = 0x040;
//const uint32_t POLLRDBAND = 0x080;
//const uint32_t POLLPRI = 0x002;
//const uint32_t POLLOUT = 0x004;
//const uint32_t POLLWRNORM = 0x100;
//const uint32_t POLLWRBAND = 0x200; 

3.安装成功测试

  在终端输入skyeye,出现“无此命令”错误,终端输入:

  sudo cd /usr/bin 
  sudo ln -s /opt/skyeye/bin/skyeye skyeye (skyeye指向/opt/skyeye/bin/skyeye)  

  安装完后也可能出现没有lcd和触摸屏的现象,这是要修改skyeye.conf即可

   lcd: state=on 
   uart:mod=term 

  测试testsuit

  解压testsuit,进入skyeye-testsuite-1.3.0_rc1/uClinux/at91 /uclinux_cs8900a

   输入sudo skyeye -e linux 

  测试完成

4.运行 SkyEye的命令行应用程序

  在/opt/skyeye/testsuite/目录下有一个测试程序”arm_hello“。

  1).进入/opt/skyeye/testsuite/;

  2).输入sudo skyeye -e arm_hello命令,进入skyeye命令行界面;

  3).然后运行"start"命令加载配置和初始化目标机,同时在主机上会显示一个xterm的窗口,窗口标题 为"uart_instance";

  4).然后我们可以输入"run” 命令来启动helloworld的测试用例;

  5).我们输入"stop" 命令来停止目标板;

  6).输入 "info regitsters" 查看当前的寄存器的数值;

  7).输入 "disassemble" 命令进行反汇编0x100004c,例如:"disassemble 0x100004c";

  7.skyeye的终端是用term(Ubuntu是xterm),显示特别难看,我们修改一下xterm的显示特性就可以了。

  修改~/.Xresources就可以了(没有就自己创建一个)

  范例代码:

  xterm*locale: true

  xterm.utf8: true

  xterm*utf8Title: true

  xterm*faceName: Monaco:pixelsize=14

  xterm*faceNameDoublesize: WenQuanYi Zen Hei:pixelsize=15

  然后用命令

  xrdb -load ~/.Xresources

  重启或导入设置就可以了。

5.启动skyeye

在终端输入命令:

 sudo skyeye -e linux  

出现:

[sudo] password for rock: 

输入用户密码。

则开始启动:

Your elf file is little endian.

arch: arm

cpu info: armv3, arm7tdmi, 41007700, fff8ff00, 0 

mach info: name at91, mach_init addr 0x8060680

ethmod num=1, mac addr=0:0:0:0:0:0, hostip=10.0.0.1

uart_mod:0, desc_in:, desc_out:, converter:

SKYEYE: use arm7100 mmu ops

Loaded ROM   ./romfs.img

exec file "linux"'s format is elf32-little.

load section .init: addr = 0x01000000  size = 0x0000a000.

load section .text: addr = 0x0100a000  size = 0x000e1cd0.

load section .data: addr = 0x010ec000  size = 0x0000a434.

not load section .bss: addr = 0x010f6440  size = 0x000222c0 .

call ARMul_InitSymTable,kernel filename is linux. 

start addr is set to 0x01000000 by exec file.

Linux version 2.4.27-uc1 (skyeyeuser@debian) (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/)) #3 Tue Aug 9 18:57:29 CST 2005

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: 2916KB available (903K code, 178K 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-1512BFF [VIRTUAL 1400000-1512BFF] (RO)

RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize

Cirrus Logic CS8900A driver for Linux (V0.02)

eth0: CS8900A rev D detected

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

mount: /etc/mtab: Read-only file system

Command: mount -t ext2 /dev/ram0 /var

mount: /etc/mtab: Read-only file system

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 <davidm@snapgear.com>

For further information check:

http://www.uclinux.org/
Command: /bin/ifconfig eth0 up 10.0.0.2
Execution Finished, Exiting
Sash command shell (version 1.1.1)
/>

ubuntu下交叉编译环境的搭建

在安装好了硬件模拟环境之后,还需要进一步来安装交叉编译工具。我是在http://opensrc.sec.samsung.com/download.html上下载的。网速很快的。

下载完毕之后,先要修改一下子文件的内容,否则编译无法通过:

vim arm-uclinux-tools-base-gcc3.4.0-20040713.sh,

tail +${SKIP} ${SCRIPT} | bunzip2 | tar xvf -
修改为:
tail -n +${SKIP} ${SCRIPT} | bunzip2 | tar xvf -

之后执行:

sudo sh ./ arm-uclinux-tools-base-gcc3.4.0-20040713.sh

注意:

其默认的安装路径是/root/bin/arm-uclinux-tool,系统是无法直接找到路径的,而且即使是在/etc/environment中添加了环境变量,也只是转换成root身份时,才可以搜索到该命令。

所以,在安装完毕之后,需要以root的身份将其从/root/bin目录下拷贝到目标目录下,我是将其拷贝到/opt下,即:/opt/arm-uclinux-tool,然后在vim /etc/environment,在PATH环境变量后边添加“:/opt/arm-uclinux-tool/bin”,重新启动电脑,打开电脑之后,输入arm-elf(敲tab键),会通过bash自动补全为:arm-elf-g++等。