1、1、skyeye的安装 Code:cd /tmp/embed tar -jvxf skyeye-0.9.8.tar.bz2 cd skyeye ./configure -target=arm-elf -prefix=/usr/local/ -without-gtk-prefix -without-gtk-exec-prefix -disable-gtktest 如果机器上没有安装gtk的开发包,那么就需要加入大括弧之间的选项 make; make install 2、arm-elf-tools 的安装 所有的交叉编译工具都在arm-elf-tools-20030314.sh文件中,执行下面的命
2、令后将安装在/usr/local/bin目录下 ./arm-elf-tools-20030314.sh 3、ucosii4skyeye-1.9.3.tar.gz export CROSS_COMPILE=/usr/local/bin/arm-elf-或者把以上的命令加入/.bash_profile文件里 然后运行 su your_login_name -login tar -zvxf ucosii4skyeye-1.9.3.tar.gz 在没有编译之前先修改一下lib/skyeye_printf.c文件,不然在编译samples时会出现如下错误:Quote:skyeye_printf.o: I
3、n function getnum:/root/src/skyeye/ucosii4skyeye/samples/ucos_test/././lib/skyeye_printf.c:118: undefined reference to isdigit In function skyeye_printf164: make: * ucos_test.elf Error 1 (不知道在其他的系统中有没有这个Bug,我在RH9上测试时出现了这个问题),把以下代码加入skyeye_printf.c文件中 static int isdigit(char ch) if (ch = 0 & ch 9) re
4、turn 1;return 0; 然后把该文件中的#include 这一行注释掉。保存退出进入ucosii4skyeye/samples/ucos_test目录 cd ucosii4skyeye/samples/ucos_test make cleanall make config make dep make make test 进入(SkyEye)后,运行 target sim load r 如果读者看到了如下的界面:skyeye ucos_test.elf * * * SkyEyeSimulator Ver 0.9.8 withGDB/Insight 5.3 Interface * GNU
5、 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.show warr
6、anty 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 0x8161574 SKYEYE: use arm7100 mmu ops Connected to the simulator. (SkyEye) load Loading section .text, si
7、ze 0x7660 vma 0x1000000 Loading section .data, size 0x205c vma 0x1008000 Start address 0x1000000 Transfer rate: 308704 bits in hello world.! ;Task2 running. Your input string: hello world.!)pParam is 16814060Task1 running. Please input a string:恭喜你,你成功了,剩下的问题就是用skyeye深入的去熟悉ucos,理解它的内部结构并写出自己程序。除了这一个
8、ucos_test以外,在samples目录下还有其他的ucos的测试目录,其中lwip_on_ucos_test时作者把lwip移植到了ucos里面(ucos本身并不带协议栈),有兴趣的朋友可以试试,编译它的命令与编译ucos_test的一样。4、uclinux的安装和使用 1、安装 tar -zvxf uClinux-dist-20041215.tar.gz cd uClinux-dist make xconfig 在Target Platform Selection中选择GDB/skyeye,内核选择linux-2.4.x 如下图1所示 图1、uClinux Config选项 在当前目录
9、下建立仿真AT91的skyeye配置文件 skyeye.conf,内容如下:cpu: arm7tdmi mach: at91 mem_bank: map=M, type=RW, addr=0x00000000, size=0x00004000 map=M, type=RW, addr=0x01000000, size=0x00400000 map=M, type=R, addr=0x01400000, size=0x00400000, file=images/romfs.img map=M, type=RW, addr=0x02000000, size=0x00400000 map=M, ty
10、pe=RW, addr=0x02400000, size=0x00008000 map=M, type=RW, addr=0x04000000, size=0x00400000 map=I, type=RW, addr=0xf0000000, size=0x10000000 #set nic info state=on/off mac=xx:xx:xx ethmod=tuntap/vnet hostip=dd.dd.dd.dd net: state=on, mac=0:4:3:2:1:f, ethmod=tun, hostip=10.0.0.1 2、使用 skyeye linux-2.4.x/
11、linux 结果如下所示:nic0 info: state=1, ethmod num=1, mac addr=0:5:f, hostip=192.168.2.1 nic_init_begin tapif_init begin tapif_init: fd 6 system(ifconfig tap0 inet 192.168.2.1);tapif_init end nic_init_end Loaded ROM ./romfs.img Loading section .init, size 0xa000 vma 0x1000000 Loading section .text, size 0x
12、e0e90 vma 0x100a000 Loading section .data, size 0xa594 vma 0x10ec000 4018320 bits/sec. /root/src/skyeye/uclinux/linux Linux version 2.4.27-uc1 (rootTEST) (gcc version 2.95.3 20010315 (release)(Cold Fire patches - 20010318 from XIP and shared lib patches from #2 Fri Aug 5 15:13:59 CST 2005 Processor:
13、 Atmel AT91M40xxx revision 0 . . Shell invoked to run file: /etc/rc Command: hostname GDB-ARMulator /bin/expand /etc/ramfs.img /dev/ram0 mount -t proc proc /proc mount: /etc/mtab: Read-only file system mount -t ext2 /dev/ram0 /var mkdir /var/tmp mkdir /var/log mkdir /var/run mkdir /var/lock mkdir /v
14、ar/empty cat /etc/motd Welcome to _ _ /_| |_| _ _| | | _ _ _ | | | | | | |_ | | | | / / | |_| | |_| | | | | | |_| |/ |_|_|_|_| |_|_|_/_/ | | |_| GDB/ARMulator support by For further information check:http:/www.uclinux.org/ /bin/ifconfig eth0 up 10.0.0.2 Execution Finished, Exiting Sash command shell
15、 (version 1.1.1) / ps PID PORT STATSIZE SHARED %CPU COMMAND 1S 150K 0K5.0 /sbin/init 20.0 keventd 30.0 ksoftirqd_CPU0 40.0 kswapd 50.0 bdflush 60.0 kupdated 12 S0 R44K6.0 /bin/sh 1322K3.0 /bin/inetd 3、在uclinux里面添加自己的应用程序 先写一个hello world!的程序 stdio.hint main() printf(welcome to uclinux world!n编译hello.c, arm-elf-gcc -Wl,elf2flt hello.c -o hello 把hello 拷贝到romfs/bin目录下 接着运行 make romfs make image 再按2的方法运行一次 然后执行hello, 看到了吧. 往uclinux里面加入程序还有另外一种方发,不过那种方法很繁琐,这里就不介绍了, 有兴趣的朋友参考uclinux-dist/Documentation/Adding-User-Apps-HOWTO文件
copyright@ 2008-2023 冰点文库 网站版权所有
经营许可证编号:鄂ICP备19020893号-2