首页 > 代码库 > Fedora10上搭建TinyOS系统

Fedora10上搭建TinyOS系统

  最近在研究无线传感器网络方面的东西,于是在VirtualBox中安装了一个Fedora10的虚拟机,在这个Fedora10中搭建了TinyOS操作系系统的软件环境。下面是我的搭建过程,希望对大家有帮助。

1、安装JDK

(1)安装

#wget http://down1.chinaunix.net/distfiles/jdk-6u10-dlj-linux-i586.bin

#./jdk-6u10-dlj-linux-i586.bin

(2)配置环境变量

#vi /etc/profile

加入如下内容:

#Java

export PATH=$PATH:/home/source_code/jdk1.6.0_10/bin

export CLASSPATH=/home/source_code/jdk1.6.0_10/lib/dt.jar:/home/source_code/jdk1.6.0_10/lib/tools.jar

export JAVA_HOME=/home/source_code/jdk1.6.0_10

(3)生效环境变量

#source  /etc/profile

 

2、安装编译器

#wget http://www.tinyos.net/dist-2.1.0/tools/linux/avr-binutils-2.17tinyos-3.i386.rpm

#rpm -ivh avr-binutils-2.17tinyos-3.i386.rpm

#wget http://www.tinyos.net/dist-2.1.0/tools/linux/avr-gcc-4.1.2-1.i386.rpm

#rpm -ivh avr-gcc-4.1.2-1.i386.rpm

#wget http://www.tinyos.net/dist-2.1.0/tools/linux/avr-libc-1.4.7-1.i386.rpm

#rpm -ivh avr-libc-1.4.7-1.i386.rpm

#yum install avarice-2.6-3

#wget http://www.tinyos.net/dist-1.2.0/tools/linux/avr-insight-6.3-1.i386.rpm

#rpm -ivh avr-insight-6.3-1.i386.rpm

#wget http://www.tinyos.net/dist-2.1.0/tools/linux/avrdude-tinyos-5.6cvs-1.i386.rpm

#rpm -ivh avrdude-tinyos-5.6cvs-1.i386.rpm

#wget http://www.tinyos.net/dist-1.2.0/tools/linux/msp430tools-base-0.1-20050607.i386.rpm

#rpm -ivh msp430tools-base-0.1-20050607.i386.rpm

#wget http://www.tinyos.net/dist-1.2.0/tools/linux/msp430tools-python-tools-1.0-1.noarch.rpm

#rpm -ivh msp430tools-python-tools-1.0-1.noarch.rpm

#wget http://www.tinyos.net/dist-1.2.0/tools/linux/msp430tools-binutils-2.16-20050607.i386.rpm

#rpm -ivh msp430tools-binutils-2.16-20050607.i386.rpm

#wget http://www.tinyos.net/dist-1.2.0/tools/linux/msp430tools-gcc-3.2.3-20050607.i386.rpm

#rpm -ivh msp430tools-gcc-3.2.3-20050607.i386.rpm

#wget http://www.tinyos.net/dist-1.2.0/tools/linux/msp430tools-libc-20050308cvs-20050608.i386.rpm

#rpm -ivh msp430tools-libc-20050308cvs-20050608.i386.rpm

#wget http://www.tinyos.net/dist-1.2.0/tools/linux/msp430tools-jtag-lib-20031101cvs-20050610.i386.rpm

#rpm -ivh msp430tools-jtag-lib-20031101cvs-20050610.i386.rpm

#wget http://www.tinyos.net/dist-1.2.0/tools/linux/msp430tools-gdb-6.0-20050609.i386.rpm

#rpm -ivh msp430tools-gdb-6.0-20050609.i386.rpm

 

3、安装TinyOS工具链

#wget http://tinyos.stanford.edu/tinyos-rpms/nesc-1.3.1-1.fc9.i386.rpm

#rpm -ivh nesc-1.3.1-1.fc9.i386.rpm1

#wget http://www.tinyos.net/dist-2.1.0/tinyos/linux/tinyos-deputy-1.1-1.fc9.i386.rpm

#rpm -ivh tinyos-deputy-1.1-1.fc9.i386.rpm

#wget http://tinyos.stanford.edu/tinyos-rpms/tinyos-tools-1.4.0-3.ubuntu.i386.rpm

#rpm -ivh tinyos-tools-1.4.0-3.ubuntu.i386.rpm

 

4、安装TinyOS 2.x资源树

#wget http://tinyos.stanford.edu/tinyos-rpms/tinyos-2.1.1-3.ubuntu.noarch.rpm

#rpm -ivh tinyos-2.1.1-3.ubuntu.noarch.rpm

#yum install libpng10

#yum install graphviz

 

5、配置环境变量

#vi /etc/profile

加入下列内容:

#TinyOS

export TOSROOT=/opt/tinyos-2.x

export TOSDIR=$TOSROOT/tos

export CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java/tinyos.jar:.

export MAKERULES=$TOSROOT/support/make/Makerules

生效环境变量:

#source /etc/profile

 

6、测试

#cd $TOSROOT/apps/Blink

#make sim micaz

mkdir -p simbuild/micaz

placing object files in simbuild/micaz

writing XML schema to app.xml

compiling BlinkAppC to object file sim.o

....

 

*** Successfully built micaz TOSSIM library.

 

Fedora10上搭建TinyOS系统