QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1682|回复: 4

在debian下安装和使用skyeye的过程

[复制链接]
发表于 2005-5-31 09:54:29 | 显示全部楼层 |阅读模式
在debian下安装和使用skyeye的过程
参考以前的在debian下安装skyeye的帖子实验了一个上午,最后以失败而告终,于是找到了一个简单的方法在debian下安装和使用skyeye,那就是安装skyeye-insight-0.9.4-binary-in-debian3.tar.bz2
http://gro.clinux.org/frs/downlo ... -in-debian3.tar.bz2
详细过程如下:
1,下载skyeye-insight-0.9.4-binary-in-debian3.tar.bz2
http://gro.clinux.org/frs/downlo ... -in-debian3.tar.bz2

2,解压缩到/usr/local
[code:1]
#cp skyeye-insight-0.9.4-binary-in-debian3.tar.bz2 /usr/local
#tar xvfj skyeye-insight-0.9.4-binary-in-debian3.tar.bz2
[/code:1]
这时在/usr/local下产生一个skyeye-insighe的文件夹,里面的内容为:
[code:1]
#cd skyeye-insighe
#ls
bin  include  info  lib  man  share
[/code:1]
将skyeye添加到PATH,方法:
[code:1]
#echo "export PATH=$PATH:/usr/local/skyeye-insight/bin">>"~/.bashrc"
#source ~/.bashrc
[/code:1]
这个时候,运行skyeye将会出现:
[code:1]
#skyeye
***********************************************************************
****                                                               ****
****   SkyEye  Simulator Ver 0.9.2 with  GDB/Insight 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=i686-pc-linux-gnu --target=arm-elf".
(SkyEye)
[/code:1]
利用这个在debian下使用skyeye实在是再简单不过了.....下面实验下是否可以使用^_^

3,安装完skyeye后应该安装arm-elf交叉编译器,首先下载arm-elf-tools-20030314.sh
ftp://166.111.68.183/pub/embed/uclinux/soft/tools/arm

ftp://166.111.8.229/OS/Embeded
然后:
[code:1]
#chmod a+x arm-elf-tools-20030314.sh
#./arm-elf-tools-20030314.sh
[/code:1]
实验一下(通过bash的tab补全功能):
[code:1]
#arm-elf-
arm-elf-addr2line   arm-elf-gasp        arm-elf-protoize
arm-elf-ar          arm-elf-gcc         arm-elf-ranlib
arm-elf-as          arm-elf-gdb         arm-elf-readelf
arm-elf-c++         arm-elf-ld          arm-elf-run
arm-elf-c++filt     arm-elf-ld.real     arm-elf-size
arm-elf-elf2flt     arm-elf-nm          arm-elf-strings
arm-elf-flthdr      arm-elf-objcopy     arm-elf-strip
arm-elf-g++         arm-elf-objdump     arm-elf-unprotoize
#arm-elf-
[/code:1]

4,测试你的arm-elf-gcc编译器

先写一个小程序hello.c
[code:1]int main(void)
{
    int i;

    for(i = 0; i < 6; i++){

        printf("i = %d  ",i);

        printf("Hello, embedded linux!\n");
    }

    return 0;
}
[/code:1]
然后执行:
[code:1]
#arm-elf-gcc -Wl,-elf2flt -o hello hello.c
[/code:1]
-elf2flt参数是将elf文件格式转为flat文件格式,这个工具是在你安装交叉编译器产生的。
[code:1]
#ls
hello  hello.c  hello.gdb
#file hello
hello: BFLT executable - version 4 ram
[/code:1]
你会发现,它是BFLT(binary FLAT),你目标平台所支持的文件格式。

5,执行你的hello程序
这里,我们将借助genromfs这个小工具来完成测试,这个工具就是你在安装交叉编译器时产生的,你可以直接使用它。

http://gro.clinux.org/frs/downlo ... utils-1.2.0.tar.bz2
下载skyeye-binary-testutils-1.2.0.tar.bz2
然后:
[code:1]
#tar xvfj skyeye-binary-testutils-1.2.0.tar.bz2
#cd skyeye-binary-testutils-1.2.0/at91x40/uclinux2
#mkdir romfs
#mkdir /mnt/tmp
#mount -o loop boot.rom /mnt/tmp
#cp -r /mnt/tmp/* romfs
#cd romfs
#ls
bin  dev  etc  home  lib  mnt  proc  sbin  tmp  usr  var
[/code:1]
另外,把你编译好的可执行程序拷贝到/romfs/bin目录里,这里就是hello了!
[code:1]
#cp ~/hello ~/skyeye-binary-testutils-1.2.0/at91x40/uclinux2/romfs/bin
[/code:1]
然后
[code:1]
#cd ~/skyeye-binary-testutils-1.2.0/at91x40/uclinux2/
#ls
boot.rom  linux  readme  romfs  skyeye.conf
[/code:1]
确保在当前文件夹下有skyeye.conf,然后
[code:1]
[root]@[/usr/local/skyeye-binary-testutils-1.2.0/at91x40/uclinux2]#skyeye linux
***********************************************************************
****                                                               ****
****   SkyEye  Simulator Ver 0.9.2 with  GDB/Insight 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=i686-pc-linux-gnu --target=arm-elf"...
(no debugging symbols found)...
(SkyEye) target sim
cpu info: armv3, arm7tdmi, 41007700, fff8ff00, 0
mach info: name at91, mach_init addr 0x8184ee0
nic[0] info: state=1, ethmod num=1, mac addr=0:4:3:2:1:f, hostip=10.0.0.1
log_info: log is off.
log_info:log file is /tmp/test.log, fd is 0x8491710
log_info: log start clock 3200000
log_info: log end clock 3330000
nic_init_begin
tapif_init begin
tapif_init: fd -1
tapif_init:open: No such file or directory
-----------------------------------------------------------
NOTICE: you should be root at first !!!
NOTICE: you should inmod linux kernel net driver tun.o!!!
NOTICE: if you don't make device node, you should do commands:
NOTICE:    mkdir /dev/net; mknod /dev/net/tun c 10 200
NOTICE: now the net simulation function can not support!!!
NOTICE: Please read SkyEye.README and try again!!!
-----------------------------------------------------------
[/code:1]
这时,根据它的错误提示,继续:
[code:1]
[root]@[/usr/local/skyeye-binary-testutils-1.2.0/at91x40/uclinux2]#mkdir /dev/net
[root]@[/usr/local/skyeye-binary-testutils-1.2.0/at91x40/uclinux2]#mknod /dev/net/tun c 10 200
[root]@[/usr/local/skyeye-binary-testutils-1.2.0/at91x40/uclinux2]#skyeye linux
***********************************************************************
****                                                               ****
****   SkyEye  Simulator Ver 0.9.2 with  GDB/Insight 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=i686-pc-linux-gnu --target=arm-elf"...
(no debugging symbols found)...
(SkyEye) target sim
cpu info: armv3, arm7tdmi, 41007700, fff8ff00, 0
mach info: name at91, mach_init addr 0x8184ee0
nic[0] info: state=1, ethmod num=1, mac addr=0:4:3:2:1:f, hostip=10.0.0.1
log_info: log is off.
log_info:log file is /tmp/test.log, fd is 0x8491710
log_info: log start clock 3200000
log_info: log end clock 3330000
nic_init_begin
tapif_init begin
tapif_init: fd 7
tapif_init: system("ifconfig tap0 inet 10.0.0.1");
tapif_init end
nic_init_end
SKYEYE: use arm7100 mmu ops
Loaded ROM   ./boot.rom
Connected to the simulator.
(SkyEye) load
Loading section .init, size 0xa000 vma 0x1000000
Loading section .text, size 0xd0480 vma 0x100a000
Loading section .data, size 0x9154 vma 0x10dc000
Start address 0x1000000
Transfer rate: 7450272 bits in <1 sec.
(SkyEye) run
Starting program: /usr/local/skyeye-binary-testutils-1.2.0/at91x40/uclinux2/linux
Linux version 2.4.20-uc0 ([email protected]) (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/)) #7 五 8月 1 19:43:07 CST 2003
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... 12.97 BogoMIPS
Memory: 4MB = 4MB total
Memory: 2984KB available (833K code, 181K 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-157D3FF [VIRTUAL 1400000-157D3FF] (RO)
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
SkyEye NE2k Ethernet driver version 0.2 (2003-04-27)
sene2k dev name: eth0: <6>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.
sys_mount:dev_name /dev/root,dir_name /root, type ext2, flag 0x8001, data 0
sys_mount:1 data_page 1122000, type_page 113bf74, dev_page 0, dir_page 8001
sys_mount:2 data_page 0, type_page 117f000, dev_page 117d000, dir_page 117e000
sys_mount:3 data_page 0, type_page 117f000, dev_page 117d000, dir_page 117e000
sys_mount:4 data_page 0, type_page 117f000, dev_page 117d000, dir_page 117e000
sys_mount:dev_name /dev/root,dir_name /root, type romfs, flag 0x8001, data 0
sys_mount:1 data_page 0, type_page 117f000, dev_page 117d000, dir_page 8001
sys_mount:2 data_page 0, type_page 117f000, dev_page 117d000, dir_page 117e000
sys_mount:3 data_page 0, type_page 117f000, dev_page 117d000, dir_page 117e000
sys_mount:4 data_page 0, type_page 117f000, dev_page 117d000, dir_page 117e000
VFS: Mounted root (romfs filesystem) readonly.
sys_mount:dev_name .,dir_name /, type <NULL>, flag 0x2000, data 0
sys_mount:1 data_page 111c120, type_page 0, dev_page 10e5d00, dir_page 10e5174
sys_mount:2 data_page 0, type_page 0, dev_page 117f000, dir_page 1122000
sys_mount:3 data_page 0, type_page 0, dev_page 117f000, dir_page 1122000
sys_mount:4 data_page 0, type_page 0, dev_page 117f000, dir_page 1122000
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
sys_mount:dev_name /proc,dir_name /proc, type proc, flag 0xc0ed0000, data 11d2008
sys_mount:1 data_page 1000, type_page 1002, dev_page 118e008, dir_page c0ed0000sys_mount:2 data_page 118b000, type_page 118d000, dev_page 118c000, dir_page 1122000
sys_mount:3 data_page 118b000, type_page 118d000, dev_page 118c000, dir_page 1122000
sys_mount:4 data_page 118b000, type_page 118d000, dev_page 118c000, dir_page 1122000
mount: /etc/mtab: Read-only file system
Command: mount -t ext2 /dev/ram0 /var
sys_mount:dev_name /dev/ram0,dir_name /var, type ext2, flag 0xc0ed0000, data 11d2008
sys_mount:1 data_page 111c260, type_page 119fe40, dev_page 0, dir_page c0ed0000sys_mount:2 data_page 1189000, type_page 118b000, dev_page 118a000, dir_page 1122000
sys_mount:3 data_page 1189000, type_page 118b000, dev_page 118a000, dir_page 1122000
sys_mount:4 data_page 1189000, type_page 118b000, dev_page 118a000, dir_page 1122000
mount: /etc/mtab: Read-only file system
Command: mkdir /var/tmp
Command: mkdir /var/log
Command: mkdir /var/run
Command: mkdir /var/lock
Command: cat /etc/motd
Welcome to
          ____ _  _
         /  __| ||_|
    _   _| |  | | _ ____  _   _  _  _
   | | | | |  | || |  _ \| | | |\ \/ /
   | |_| | |__| || | | | | |_| |/    \
   |  ___\____|_||_|_| |_|\____|\_/\_/
   | |
   |_|

GDB/ARMulator support by <[email protected]>
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)
/>ls
bin
dev
etc
home
lib
mnt
proc
sbin
tmp
usr
var
/> cd /bin
/bin> ls
boa
boot.rom
busybox
dhcpcd
expand
ftp
ftpd
gdbserver
hello
ifconfig
inetd
init
login
mount
ping
reboot
route
sh
telnet
telnetd
umount
/bin> hello
i=0Hello,Embedded Linux!
i=1Hello,Embedded Linux!
i=2Hello,Embedded Linux!
i=3Hello,Embedded Linux!
i=4Hello,Embedded Linux!
i=5Hello,Embedded Linux!
/bin>
[/code:1]
 楼主| 发表于 2005-5-31 09:55:02 | 显示全部楼层
6,编译并运行uClinux-dist-20030909.tar.gz

ftp://166.111.68.183/pub/embed/uclinux/soft/
或到
ftp://166.111.8.229/OS/Embeded/uclinux/pub/uClinux/dist
下载uClinux-dist-20030909.tar.gz
[code:1]
#cp uClinux-dist-20030909.tar.gz /usr/src
#cd /usr/src
#tar xvfz uClinux-dist-20030909.tar.gz
......
#cd uClinux-dist
[/code:1]
这个时候在我的debian下无法使用make xconfig和make menuconfig进行编译,错误如下:
[code:1][root]@[/usr/src/uClinux-dist]#make xconfig
config/mkconfig > config.in
make -C /usr/src/uClinux-dist/config/scripts tkparse
make[1]: Entering directory `/usr/src/uClinux-dist/config/scripts'
make[1]: `tkparse' is up to date.
make[1]: Leaving directory `/usr/src/uClinux-dist/config/scripts'
ARCH=dummy /usr/src/uClinux-dist/config/scripts/tkparse < config.in > config.tmpcat /usr/src/uClinux-dist/config/scripts/header.tk >> ./config.tk
cat config.tmp >> config.tk
rm -f config.tmp
echo "set defaults \"/dev/null\"" >> config.tk
echo "set help_file \"config/Configure.help\"" >> config.tk
cat /usr/src/uClinux-dist/config/scripts/tail.tk >> config.tk
chmod 755 config.tk
make: wish: Command not found
make: *** [xconfig] Error 127
[root]@[/usr/src/uClinux-dist]#
[/code:1]
[code:1][root]@[/usr/src/uClinux-dist]#make menuconfig
config/mkconfig > config.in
make -C /usr/src/uClinux-dist/config/scripts/lxdialog all
make[1]: Entering directory `/usr/src/uClinux-dist/config/scripts/lxdialog'
/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status

>> Unable to find the Ncurses libraries.
>>
>> You must have Ncurses installed in order
>> to use 'make menuconfig'

make[1]: *** [ncurses] Error 1
make[1]: Leaving directory `/usr/src/uClinux-dist/config/scripts/lxdialog'
make: *** [menuconfig] Error 2
[root]@[/usr/src/uClinux-dist]#
[/code:1]ps:在我的/lib下包含ncurses,如下:
[code:1][root]@[/lib]#ls|grep -i ncurses
libncurses.so.5
libncurses.so.5.4
[root]@[/lib]#
[/code:1]
接下来我make config,vendor/product中选择GDB/ARMulator,kernel版本选择2.4,uClibc,下面全部默认(没有看到save and exit),然后make deb,再make后,在/usr/src/uClinux-dist/linux-2.4.x目录下生成了可执行文件linux,在/usr/src/uClinux-dist/images/生成了romfs.img等文件.如下:
[code:1]zhyfly@zhyfly:/usr/src/uClinux-dist$ cd images
zhyfly@zhyfly:/usr/src/uClinux-dist/images$ ls
image.bin  linux.data  linux.text  romfs.img
zhyfly@zhyfly:/usr/src/uClinux-dist/images$
[/code:1]
然后在uClinux-dist目录下编辑skyeye.conf,内容如下:
[code:1]#cat 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.imgmem_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
[/code:1]
在uClinux-dist目录下用root执行:
[code:1][root]@[/usr/src/uClinux-dist]#skyeye linux-2.4.x/linux
***********************************************************************
****                                                               ****
****   SkyEye  Simulator Ver 0.9.2 with  GDB/Insight 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=i686-pc-linux-gnu --target=arm-elf"...
(SkyEye) target sim
cpu info: armv3, arm7tdmi, 41007700, fff8ff00, 0
mach info: name at91, mach_init addr 0x8184ee0
SKYEYE: use arm7100 mmu ops
Loaded ROM   images/romfs.img
Connected to the simulator.
(SkyEye) load
Loading section .init, size 0xa000 vma 0x1000000
Loading section .text, size 0xdb290 vma 0x100a000
Loading section .data, size 0x8a34 vma 0x10e6000
Start address 0x1000000
Transfer rate: 7792160 bits/sec.
(SkyEye) run
Starting program: /usr/src/uClinux-dist/linux-2.4.x/linux
Linux version 2.4.22-uc0 (root@zhyfly) (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/)) #1 Tue May 31 10:41:04 GMT 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: 2948KB available (876K code, 173K 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-14A4FFF [VIRTUAL 1400000-14A4FFF] (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)
/> ls
bin
dev
etc
home
lib
mnt
proc
sbin
tmp
usr
var
[/code:1]
回复

使用道具 举报

发表于 2005-6-1 12:44:09 | 显示全部楼层
skyeye-binary-testutils-1.2.0.tar.bz2是测试用的吗??真正使用时还要装UCLINUX系统的??
为什么我安照你说的去编译程序(FILE NAME:test),复制到BIN目录里,,但我进入到UCLINUX里的bin目录ls却没发现我复制进的程序??
回复

使用道具 举报

 楼主| 发表于 2005-6-3 10:09:58 | 显示全部楼层
这个问题不会吧,你复制到哪里了?仔细看看!
回复

使用道具 举报

发表于 2005-6-3 18:15:57 | 显示全部楼层
拷贝到按照你写的一样:/romfs/bin
我装UCLINUX并不出错,,很正常安装,,是机的环境问题吧
回复

使用道具 举报

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

本版积分规则

GMT+8, 2024-11-23 06:06 , Processed in 0.066180 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

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