|
在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
- #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
复制代码
这时在/usr/local下产生一个skyeye-insighe的文件夹,里面的内容为:
- #cd skyeye-insighe
- #ls
- bin include info lib man share
复制代码
将skyeye添加到PATH,方法:
- #echo "export PATH=$PATH:/usr/local/skyeye-insight/bin">>"~/.bashrc"
- #source ~/.bashrc
复制代码
这个时候,运行skyeye将会出现:
- #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)
复制代码
利用这个在debian下使用skyeye实在是再简单不过了.....下面实验下是否可以使用^_^
3,根据renbagshoes兄弟置顶的帖子,安装完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
然后:
- #chmod a+x arm-elf-tools-20030314.sh
- #./arm-elf-tools-20030314.sh
复制代码
实验一下(通过bash的tab补全功能):
- #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-
复制代码
4,测试你的arm-elf-gcc编译器
先写一个小程序hello.c
- int main(void)
- {
- int i;
- for(i = 0; i < 6; i++){
- printf("i = %d ",i);
- printf("Hello, embedded linux!\n");
- }
- return 0;
- }
复制代码
然后执行:
- #arm-elf-gcc -Wl,-elf2flt -o hello hello.c
复制代码
-elf2flt参数是将elf文件格式转为flat文件格式,这个工具是在你安装交叉编译器产生的。
- #ls
- hello hello.c hello.gdb
- #file hello
- hello: BFLT executable - version 4 ram
复制代码
你会发现,它是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
然后:
- #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
复制代码
另外,把你编译好的可执行程序拷贝到/romfs/bin目录里,这里就是hello了!
- #cp ~/hello ~/skyeye-binary-testutils-1.2.0/at91x40/uclinux2/romfs/bin
复制代码
然后
- #cd ~/skyeye-binary-testutils-1.2.0/at91x40/uclinux2/
- #ls
- boot.rom linux readme romfs skyeye.conf
复制代码
确保在当前文件夹下有skyeye.conf,然后
- [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!!!
- -----------------------------------------------------------
复制代码
这时,根据它的错误提示,继续:
- [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 (chy@localhost.localdomain) (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 <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)
- />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>
复制代码 |
|