ARM开发 在skyeye上运行uClinuxWord下载.docx
《ARM开发 在skyeye上运行uClinuxWord下载.docx》由会员分享,可在线阅读,更多相关《ARM开发 在skyeye上运行uClinuxWord下载.docx(10页珍藏版)》请在冰点文库上搜索。
![ARM开发 在skyeye上运行uClinuxWord下载.docx](https://file1.bingdoc.com/fileroot1/2023-5/3/fd6ac422-97bb-4f1c-af29-cd407b76a855/fd6ac422-97bb-4f1c-af29-cd407b76a8551.gif)
1、skyeye的安装
Code:
cd/tmp/embed
tar-jvxfskyeye-0.9.8.tar.bz2
cdskyeye
./configure--target=arm-elf--prefix=/usr/local/{--without-gtk-prefix--without-gtk-exec-prefix--disable-gtktest}
如果机器上没有安装gtk的开发包,那么就需要加入大括弧之间的选项
make;
makeinstall
2、arm-elf-tools的安装
所有的交叉编译工具都在arm-elf-tools-20030314.sh文件中,执行下面的命令后将安装在/usr/local/bin目录下
./arm-elf-tools-20030314.sh
3、ucosii4skyeye-1.9.3.tar.gz
exportCROSS_COMPILE="
/usr/local/bin/arm-elf-"
或者把以上的命令加入~/.bash_profile文件里
然后运行suyour_login_name--login
tar-zvxfucosii4skyeye-1.9.3.tar.gz
在没有编译之前先修改一下lib/skyeye_printf.c文件,不然在编译samples时会出现如下错误:
Quote:
skyeye_printf.o:
Infunction`getnum'
:
/root/src/skyeye/ucosii4skyeye/samples/ucos_test/../../lib/skyeye_printf.c:
118:
undefinedreferenceto`isdigit'
Infunction`skyeye_printf'
164:
make:
***[ucos_test.elf]Error1
(不知道在其他的系统中有没有这个Bug,我在RH9上测试时出现了这个问题),把以下代码加入skyeye_printf.c文件中
staticintisdigit(charch)
{
if(ch>
='
0'
&
&
ch<
9'
)
return1;
return0;
}
然后把该文件中的"
#include<
ctype.h>
"
这一行注释掉。
保存退出进入ucosii4skyeye/samples/ucos_test目录
cducosii4skyeye/samples/ucos_test
makecleanall
makeconfig
makedep
make
maketest
进入(SkyEye)后,运行
targetsim
load
r
如果读者看到了如下的界面:
skyeyeucos_test.elf
***********************************************************************
****
****
SkyEye
SimulatorVer0.9.8with
GDB/Insight5.3Interface****
GNUgdb5.3
Copyright2002FreeSoftwareFoundation,Inc.
GDBisfreesoftware,coveredbytheGNUGeneralPublicLicense,andyouare
welcometochangeitand/ordistributecopiesofitundercertainconditions.
Type"
showcopying"
toseetheconditions.
ThereisabsolutelynowarrantyforGDB.
showwarranty"
fordetails.
ThisSkyEyewasconfiguredas"
--host=i686-pc-linux-gnu--target=arm-elf"
...
(SkyEye)targetsim
cpuinfo:
armv3,arm7tdmi,41007700,fff8ff00,0
machinfo:
nameat91,mach_initaddr0x8161574
SKYEYE:
usearm7100mmuops
Connectedtothesimulator.
(SkyEye)load
Loadingsection.text,size0x7660vma0x1000000
Loadingsection.data,size0x205cvma0x1008000
Startaddress0x1000000
Transferrate:
308704bitsin<
1sec.
(SkyEye)r
Startingprogram:
/root/src/skyeye/ucosii4skyeye/samples/ucos_test/ucos_test.elf
Task1running...Pleaseinputastring:
>
helloworld...~!
;
Task2running...Yourinputstring:
"
helloworld...~!
)"
pParamis16814060Task1running...Pleaseinputastring:
恭喜你,你成功了,剩下的问题就是用skyeye深入的去熟悉ucos,理解它的内部结构并写出自己程序。
除了这一个ucos_test以外,在samples目录下还有其他的ucos的测试目录,其中lwip_on_ucos_test时作者把lwip移植到了ucos里面(ucos本身并不带协议栈),有兴趣的朋友可以试试,编译它的命令与编译ucos_test的一样。
4、uclinux的安装和使用
1>
、安装
tar-zvxfuClinux-dist-20041215.tar.gz
cduClinux-dist
makexconfig
在"
TargetPlatformSelection"
中选择"
GDB/skyeye"
内核选择linux-2.4.x
如下图1所示
[图1、uClinuxConfig选项]
在当前目录下建立仿真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,type=RW,addr=0x02400000,size=0x00008000
map=M,type=RW,addr=0x04000000,size=0x00400000
map=I,type=RW,addr=0xf0000000,size=0x10000000
#setnicinfostate=on/offmac=xx:
xx:
xxethmod=tuntap/vnethostip=dd.dd.dd.dd
net:
state=on,mac=0:
4:
3:
2:
1:
f,ethmod=tun,hostip=10.0.0.1
2>
、使用
skyeyelinux-2.4.x/linux
结果如下所示:
nic[0]info:
state=1,ethmodnum=1,macaddr=0:
5:
f,hostip=192.168.2.1
nic_init_begin
tapif_initbegin
tapif_init:
fd6
system("
ifconfigtap0inet192.168.2.1"
);
tapif_initend
nic_init_end
LoadedROM
./romfs.img
Loadingsection.init,size0xa000vma0x1000000
Loadingsection.text,size0xe0e90vma0x100a000
Loadingsection.data,size0xa594vma0x10ec000
4018320bits/sec.
/root/src/skyeye/uclinux/linux
Linuxversion2.4.27-uc1(root@TEST)(gccversion2.95.320010315(release)(Cold
Firepatches-20010318fromXIPandshared
libpatchesfrom#2FriAug515:
13:
59CST2005
Processor:
AtmelAT91M40xxxrevision0
.......
......
Shellinvokedtorunfile:
/etc/rc
Command:
hostnameGDB-ARMulator
/bin/expand/etc/ramfs.img/dev/ram0
mount-tprocproc/proc
mount:
/etc/mtab:
Read-onlyfilesystem
mount-text2/dev/ram0/var
mkdir/var/tmp
mkdir/var/log
mkdir/var/run
mkdir/var/lock
mkdir/var/empty
cat/etc/motd
Welcometo
_____
_
/
__|||_|
_
_||
||_____
_
|||||
||||
_\||||\\//
||_|||__||||||||_||/
\
|
___\____|_||_|_||_|\____|\_/\_/
||
|_|
GDB/ARMulatorsupportby<
davidm@>
Forfurtherinformationcheck:
http:
//www.uclinux.org/
/bin/ifconfigeth0up10.0.0.2
ExecutionFinished,Exiting
Sashcommandshell(version1.1.1)
/>
ps
PIDPORTSTAT
SIZESHARED%CPUCOMMAND
1
S
150K
0K
5.0/sbin/init
2
0.0keventd
3
0.0ksoftirqd_CPU0
4
0.0kswapd
5
0.0bdflush
6
0.0kupdated
12
S0R
44K
6.0/bin/sh
13
22K
3.0/bin/inetd
3>
、在uclinux里面添加自己的应用程序
先写一个helloworld~!
的程序
stdio.h>
intmain()
printf("
welcometouclinuxworld~!
\n"
编译hello.c,
arm-elf-gcc-Wl,elf2flthello.c-ohello
把hello拷贝到romfs/bin目录下
接着运行
makeromfs
makeimage
再按2的方法运行一次
然后执行hello,
看到"
了吧...
往uclinux里面加入程序还有另外一种方发,不过那种方法很繁琐,这里就不介绍了,
有兴趣的朋友参考uclinux-dist/Documentation/Adding-User-Apps-HOWTO文件