Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1223005
  • 博文数量: 322
  • 博客积分: 10010
  • 博客等级: 上将
  • 技术积分: 3276
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-17 09:21
文章分类

全部博文(322)

文章存档

2010年(155)

2009年(167)

我的朋友

分类: 嵌入式

2010-04-30 08:45:22

一//-----------------------------------------------------------------------------
1 系统安装
         ubuntu 7.10

root@ubuntu:/# uname -a
Linux ubuntu 2.6.22-14-generic #1 SMP Sun Oct 14 23:05:12 GMT 2007 i686 GNU/Linux


2 安装binutils-dev
root@ubuntu:/# apt-get install binutils-dev
Reading package lists... Done
Building dependency tree      
Reading state information... Done
binutils-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
#
 
 
3 下载文件
1> skyeye 最新版
wget ... ye-1.2.4_Rel.tar.gz
2> arm开发环境
      有了这个就可以在ubuntu下编译arm上可以用的软件了,就一个包安装了就ok了,当然如果你不怕麻烦或者想自己做一个环境出来也是可以的,那就自己学一下怎么搭建交叉编译环境吧
wget ... s-20040427.sh%C2%A0
3> 如果要测试你的环境是不是ok了,是不是可以正常的使用skyeye来模拟arm开发板,那么下面的软件是必须的
... stsuite-2.3.tar.bz2
4> 我们要安装uClinux 那么这个包就必须下下来
... est-20070823.tar.gz
二//--------------------------------------------------------------------------
安装arm tool
# mv arm-elf-tools-20040427.sh_ arm-elf-tools-20040427.sh
# chmod 755 arm-elf-tools-20040427.sh
# ./arm-elf-tools-20040427.sh
tail: Warning: "+number" syntax is deprecated, please use "-n +number"
./usr/local/arm-elf/
./usr/local/arm-elf/bin/
./usr/local/arm-elf/bin/nm
./usr/local/arm-elf/bin/strip
./usr/local/arm-elf/bin/ar
./usr/local/arm-elf/bin/ranlib
./usr/local/arm-elf/bin/as
./usr/local/arm-elf/bin/ld
./usr/local/arm-elf/bin/flthdr
./usr/local/arm-elf/bin/gcc
./usr/local/arm-elf/bin/elf2flt
./usr/local/arm-elf/bin/ld.real
./usr/local/arm-elf/lib/
.......
............
................
.......................
./usr/local/bin/arm-elf-protoize
./usr/local/bin/arm-elf-ranlib
./usr/local/bin/arm-elf-readelf
./usr/local/bin/arm-elf-size
./usr/local/bin/arm-elf-strings
./usr/local/bin/arm-elf-strip
./usr/local/bin/arm-elf-unprotoize
./usr/local/bin/genromfs
./usr/local/bin/elf2flt
./usr/local/bin/flthdr
# ls /usr/local/skyeye/
COPYING    LICENSE      Makefile  REPORTING-BUGS  arch    dbct    misc
ChangeLog  MAINTAINERS  README    TODO            binary  device  utils
查看了以后,安装一ok了,我们现在测试一下是不是真的ok了,nano建立一个文件
# nano test.c
然后输入
#include
int main()
{
        printf("ARM tools is OK\n");
        return 0;
}
然后ctrl+o保存退出
我们编译出来这个测试文件
# arm-elf-gcc -Wl,-elf2flt -o test test.c
看清楚了,W后面的是个小写的L,不是数字1哦
然后我们查看一下是不是编译ok了
# ls -lh test*
-rwxr--r-- 1 root root 29K Dec 14 12:45 test
-rw-r--r-- 1 root root 136 Dec 14 10:38 test.c
-rwxr-xr-x 1 root root 76K Dec 14 12:45 test.gdb
# file test
test: BFLT executable - version 4 ram
# file test.gdb
test.gdb: ELF 32-bit LSB executable, ARM, version 1, statically linked, not stripped
我们运行一test看看,呵呵,肯定出错,出错也看看
# ./test
bash: ./test: cannot execute binary file
在arm下跑的肯定不能x86下跑了
我们继续

安装skyeye
1> 解压缩
# cd /usr/local/;tar zxvf /root/cache/skyeye-1.2.4_Rel.tar.gz
skyeye-1.2.4/
skyeye-1.2.4/utils/
skyeye-1.2.4/utils/share/
skyeye-1.2.4/utils/share/ansidecl.h
skyeye-1.2.4/utils/tools/
skyeye-1.2.4/utils/main/
skyeye-1.2.4/utils/main/symbol.c
skyeye-1.2.4/utils/main/skyeye.c
skyeye-1.2.4/utils/main/elf32.h
skyeye-1.2.4/utils/main/symbol.h
skyeye-1.2.4/utils/main/skyeye.h
skyeye-1.2.4/utils/main/ide.py
skyeye-1.2.4/utils/main/setup.py
skyeye-1.2.4/utils/config/
skyeye-1.2.4/utils/config/skyeye_conf
.........
.............
.................
.....................
skyeye-1.2.4/arch/mips/mach/
skyeye-1.2.4/arch/mips/mach/skyeye_mach_nedved.c
skyeye-1.2.4/arch/mips/mach/au1000.h
skyeye-1.2.4/arch/mips/mach/skyeye_mach_au1100.c
skyeye-1.2.4/binary/
skyeye-1.2.4/binary/README
修改个名字,skyeye
# mv skyeye-1.2.4/ skyeye
# cd skyeye/
# ls
COPYING    LICENSE      Makefile  REPORTING-BUGS  arch    dbct    misc
ChangeLog  MAINTAINERS  README    TODO            binary  device  utils
2> make一下看
# make
--------------------------- NOTICE ------------------------------
If you always get error, please run "make NO_CHECK=1" instead.
-----------------------------------------------------------------
Checking whether host is big endian ... no
Checking gcc ... OK ( gcc version: 4.1.3 )
Checking whether the compiler supports x86 asm ... FAILED
*** It seems that the compiler don't support inline x86 AT&T ASM codes.
*** Run "make NO_DBCT=1" instead to ignore it.
make: *** [check] Error 1
重新按照下面的输入重新make
# make clean
# make NO_DBCT=1
耐心等待一下,我的计算机大概两分钟就ok了,直到下面的出现就表示ok了
****
**** The binary file located at 'binary/skyeye', enjoy it.
****
然后我们编辑一下环境变量,把path修改一下,让系统能直接找到skyeye
# nano /etc/environment
看第一行
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/skyeye/binary"
修改如上面的这样,然后保存--按快捷键 Ctrl+o,然后打回车
然后exit退出到登陆界面重新登陆一下,让刚才修改的生效
我们测试一下看ok了没
# skyeye -h
------------------------- SkyEye -V1.2 ---------------------------
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
出现了这个界面说明skyeye已经ok了
 
我们测试一下看看
三系统测试///--------------------------------------------------------

# cd /root/cache/
# ls
arm-elf-tools-20040427.sh  skyeye-testsuite-2.3      test    test.gdb
skyeye-1.2.4_Rel.tar.gz    skyeye-testsuite-2.3.tar.bz2  test.c
#
到放置skyeye等文件的目录
解压缩testsuite到这个目录
# tar xvjf skyeye-testsuite-2.3.tar.bz2
skyeye-testsuite-2.3/
skyeye-testsuite-2.3/rtems/
skyeye-testsuite-2.3/rtems/bf533/
skyeye-testsuite-2.3/rtems/bf533/kernel_prof.txt
...................
skyeye-testsuite-2.3/linux/cs89712/initrd.img
skyeye-testsuite-2.3/linux/auto_test
skyeye-testsuite-2.3/linux/initrd.img
# ls
arm-elf-tools-20040427.sh  skyeye-testsuite-2.3          test    test.gdb
skyeye-1.2.4_Rel.tar.gz    skyeye-testsuite-2.3.tar.bz2  test.c
#
解压缩ok了,我们进去
# ls
arm-elf-tools-20040427.sh  skyeye-testsuite-2.3          test    test.gdb
skyeye-1.2.4_Rel.tar.gz    skyeye-testsuite-2.3.tar.bz2  test.c
# cd skyeye-testsuite-2.3/
#
# ls
linux  rtems  u-boot  uClinux
# cd linux/
at91rm9200/ ep7312/     mpc8560/    s3c2410/  
cs89712/    ep9312/     pxa/        strongarm/
# cd linux/ep9312/
# ls
2.6.x
# cd 2.6.x/
# ls
initrd.img  skyeye.conf  skyeye_dbct.conf  vmlinux
OK我们进到具体的目录了,我们现在测试一下看能不能把基本的测试跑起来
运行下面的命令
# skyeye -e vmlinux -c skyeye.conf
简单的说一下,-e表示指定加载什么文件为内核,-c表示什么文件是配置文件
好,我们看一下
# skyeye -e vmlinux -c skyeye.conf
big_endian is false.
arch: arm
cpu info: armv4, arm920t, 41009200, ff00fff0, 2
mach info: name ep9312, mach_init addr 0x805bd90
uart_mod:0, desc_in:, desc_out:, converter:
SKYEYE: use arm920t mmu ops
Loaded RAM   ./initrd.img
exec file "vmlinux"'s format is elf32-little.
load section .init: addr = 0xc0008000  size = 0x00012000.
load section .text: addr = 0xc001a000  size = 0x000d4a1c.
load section __ex_table: addr = 0xc00eea20  size = 0x000008a0.
not load section .pci_fixup: addr = 0xc00ef2c0  size = 0x00000000 .
not load section __ksymtab: addr = 0xc00ef2c0  size = 0x00000000 .
not load section __ksymtab_gpl: addr = 0xc00ef2c0  size = 0x00000000 .
not load section __kcrctab: addr = 0xc00ef2c0  size = 0x00000000 .
not load section __kcrctab_gpl: addr = 0xc00ef2c0  size = 0x00000000 .
load section __param: addr = 0xc00ef2c0  size = 0x00000078.
load section .data: addr = 0xc00f0000  size = 0x00024a40.
not load section .bss: addr = 0xc0114a40  size = 0x00029678 .
not load section .comment: addr = 0x00000000  size = 0x0000127e .
call ARMul_InitSymTable,kernel filename is vmlinux.
start addr is set to 0xc0008000 by exec file.
Linux version 2.6.12 () (gcc version 3.3.2) #2 Fri Aug 5 14:03:55 CST 2005
CPU: ARM920Tid(wb) [41009200] revision 0 (ARMvundefined/unknown)
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
Machine: edb9312
Warning: bad configuration page, trying to continue
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists
Kernel command line: root=/dev/ram initrd=0xC1000000,0x200000 console=ttyAM0 rw
PID hash table entries: 256 (order: 8, 4096 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 32MB = 32MB total
Memory: 29056KB available (852K code, 312K data, 72K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
checking if image is initramfs...it isn't (bad gzip magic numbers); looks like an initrd
Freeing initrd memory: 2048K
Linux NoNET1.0 for Linux 2.6
CPU model: Cirrus Logic EP9315, silicon rev A
NetWinder Floating Point Emulator V0.97 (double precision)
Serial: EP93xx driver $Revision: 1.42 $
ttyAM0 at MMIO 0x808c0000 (irq = 52) is a uart-ep93xx
ttyAM1 at MMIO 0x808d0000 (irq = 54) is a uart-ep93xx
ttyAM2 at MMIO 0x808e0000 (irq = 55) is a uart-ep93xx
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 16 RAM disks of 12288K size 1024 blocksize
physmap flash device: 2000000 at 60000000
mice: PS/2 mouse device common for all mice
RAMDISK: ext2 filesystem found at block 0
RAMDISK: Loading 2048KiB [1 disk] into ram disk... done.
VFS: Mounted root (ext2 filesystem).
Freeing init memory: 72K
ifconfig: socket: Function not implemented
ifconfig: socket: Function not implemented
Welcome to
     _      _____      __   __    _      _
    / \    /  __ \    /  \_/  \  | |    |_|               
   / _ \   | |  | |  / /\   /\ \ | |     _ ____  _   _  _  _
  / /_\ \  | |__| | / /  \_/  \ \| |    | |  _ \| | | |\ \/ /
/ /___\ \ | |__\ \ | |       | || |___ | | |_| | |_| |/    \
/_/     \_\| |   \_\|_|       |_||_____||_|_| |_|\____|\_/\_/
         
ARMLinux for Skyeye
For further information please check:
 
BusyBox v1.00 (2004.12.27-02:03+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
/bin/ash: can't access tty; job control turned off
/ # uname -a
Linux skyeye 2.6.12 #2 Fri Aug 5 14:03:55 CST 2005 armv4tl unknown
/ # cat /proc/cpuinfo
Processor       : ARM920Tid(wb) rev 0 (v4l)
BogoMIPS        : 25.80
Features        : swp half thumb
CPU implementer : 0x41
CPU architecture: undefined/unknown
CPU variant     : 0x0
CPU part        : 0x920
CPU revision    : 0
Cache type      : write-back
Cache clean     : cp15 c7 ops
Cache lockdown  : format A
Cache format    : Harvard
I size          : 16384
I assoc         : 64
I line length   : 32
I sets          : 8
D size          : 16384
D assoc         : 64
D line length   : 32
D sets          : 8
Hardware        : edb9312
Revision        : 0000
Serial          : 0000000000000000
/ #
ok,我们查看过cpuinfo文件了,确定可以模拟了,呵呵,skyeye安装ok了
阅读(1402) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~