一、引言
Sedona协议是朗德华楼控领域上重要的技术合作伙伴Tridium公司所研发的设计用于自控领域事实上的行业技术规范和标准。
Sedona Framework是一个开源的用于嵌入式设备编程和开发的软件平台,是一个“Micro-Niagara"。
如果Niagara是“Windows XP"的话,Sedona就是”Windows CE“。
二、详细介绍
Niagara大多时候是应用在控制系统的中上层,对于大量的底层智能设备,需要一个效率更高,更简单的平台。
在延续Niagara模块化结构的体系下,保留设备驱动,实时控制和图形化编程的功能。就是我们现在看到的Sedona。
所有的Sedona设备可以使用Worbench来编程(所有会Niagara的人都会很容易使用Sedona设备),
可以装载到不同的CPU和内存的嵌入式设备中:支持有线或无线电应用。
对于设备制造商来说:Sedona可以让智能设备的开发更便捷,大大缩短智能设备进入市场的时间
(功能强大的编程工具已经具备,大量的潜在客户无需太多的培训和支持)。
对于系统集成商:可以自己为硬件设备开发功能,适应不同用户的要求,并且这个功能还可以移植到新的硬件中。
这一切像极了我们今天所使用的智能手机,所有的功能是看第三方的软件设计的。
Sedona本质也是一个虚拟机,开源的不仅仅是虚拟机的虚拟引擎,而且还有编译器。
对比sedona的虚拟机和Java的虚拟机,发现sedona从Java虚拟机借用的思想还不少,但同时为了能在嵌入式系统上很好的运行,
也优化了Java虚拟机里面的一些内容,比如:将垃圾回收去掉了,换成了符合图形化开发的架构,
这样就非常适合用类似Niagara那样的组件化、图形化的编程方式来进行业务逻辑的开发。
三、总结
虚拟机的编写本来就有一定的难度,再重新定义一个sedona语言并实现这个语言的编译器,这就更难了。
另外,现在在sedona上面又架构了一个面向对象的框架,并实现了sox通信协议,以此来完成嵌入式设备的图形化开发的工作。
即Sedona协议是一套与硬件平台和操作系统无关的,用于构建以网络为中心的嵌入式智能设备的软件平台架构技术。
重点介绍;构建基于ubuntu的Sedona开发平台步骤:
1、检查java jdk环境,没有安装的用户请自行安装:
leekwen@Lenovo:~$ java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
2、安装jikes.tar.gz
leekwen@Lenovo:~$ tar zxvf jikes_1.22.orig.tar.gz
leekwen@Lenovo:~$ cd jikes-1.22.orig/
leekwen@Lenovo:~/jikes-1.22.orig$ ./configure
leekwen@Lenovo:~/jikes-1.22.orig$ make
leekwen@Lenovo:~/jikes-1.22.orig$ jikes -version
Jikes Compiler - Version 1.22 - 3 October 2004
Copyright (C) IBM Corporation 1997-2003, 2004.
- Licensed Materials - Program Property of IBM - All Rights Reserved.
Originally written by Philippe Charles and David Shields of IBM Research,
Jikes is now maintained and refined by the Jikes Project at:
<http://ibm.com/developerworks/opensource/jikes>
Please consult this URL for more information and for reporting problems.
3、修改ubuntu系统环境配置
# Add those line for Java HOME by leekwen
export JAVA_HOME="/home/leekwen/android/jdk1.6.0_45"
export JRE_HOME="$JAVA_HOME/jre"
export CLASSPATH=.:JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export SEDONA_HOME="/home/leekwen/sedonadev"
source $SEDONA_HOME/adm/unix/init.sh
export PATH=$JAVA_HOME/bin:$SEDONA_HOME/bin:$PATH
leekwen@Lenovo:~$ source ~/.bashrc
4、进入SEDONA_HOME目录进行虚拟机SVM的编译:
leekwen@Lenovo:~/sedonadev$ makeunixdev
Compile [sedona.jar]
Javac [/home/leekwen/sedonadev/src/sedona/src]
Jar [/home/leekwen/sedonadev/lib/sedona.jar]
Compile [sedonac.jar]
Javac [/home/leekwen/sedonadev/src/sedonac/src]
Jar [/home/leekwen/sedonadev/lib/sedonac.jar]
Compile [sedonacert.jar]
Javac [/home/leekwen/sedonadev/src/sedonacert/src]
Jar [/home/leekwen/sedonadev/lib/sedonacert.jar]
Compile [sys]
Parse [49 files]
WriteKit [/home/leekwen/sedonadev/kits/sys/sys-d3984c51-1.2.28.kit]
WriteManifest [/home/leekwen/sedonadev/manifests/sys/sys-d3984c51.xml]
Compile [inet]
Parse [11 files]
WriteKit [/home/leekwen/sedonadev/kits/inet/inet-25648ba7-1.2.28.kit]
WriteManifest [/home/leekwen/sedonadev/manifests/inet/inet-25648ba7.xml]
Compile [sox]
Parse [9 files]
WriteKit [/home/leekwen/sedonadev/kits/sox/sox-397a84dd-1.2.28.kit]
WriteManifest [/home/leekwen/sedonadev/manifests/sox/sox-397a84dd.xml]
Compile [soxcert]
Parse [1 files]
WriteKit [/home/leekwen/sedonadev/kits/soxcert/soxcert-69ef332c-1.2.28.kit]
WriteManifest [/home/leekwen/sedonadev/manifests/soxcert/soxcert-69ef332c.xml]
Compile [serial]
Parse [2 files]
WriteKit [/home/leekwen/sedonadev/kits/serial/serial-87314b6e-1.2.28.kit]
WriteManifest [/home/leekwen/sedonadev/manifests/serial/serial-87314b6e.xml]
Compile [web]
Parse [10 files]
WriteKit [/home/leekwen/sedonadev/kits/web/web-462d43e-1.2.28.kit]
WriteManifest [/home/leekwen/sedonadev/manifests/web/web-0462d43e.xml]
Compile [control]
Parse [94 files]
WriteKit [/home/leekwen/sedonadev/kits/control/control-808b7db3-1.2.28.kit]
WriteManifest [/home/leekwen/sedonadev/manifests/control/control-808b7db3.xml]
Compile [driver]
Parse [8 files]
WriteKit [/home/leekwen/sedonadev/kits/driver/driver-b4cc82ce-1.2.28.kit]
WriteManifest [/home/leekwen/sedonadev/manifests/driver/driver-b4cc82ce.xml]
Compile [datetime]
Parse [5 files]
WriteKit [/home/leekwen/sedonadev/kits/datetime/datetime-3a280dce-1.2.28.kit]
WriteManifest [/home/leekwen/sedonadev/manifests/datetime/datetime-3a280dce.xml]
Compile [datetimeStd]
Parse [1 files]
WriteKit [/home/leekwen/sedonadev/kits/datetimeStd/datetimeStd-fc5628d7-1.2.28.kit]
WriteManifest [/home/leekwen/sedonadev/manifests/datetimeStd/datetimeStd-fc5628d7.xml]
Compile [basicSchedule]
Parse [5 files]
WriteKit [/home/leekwen/sedonadev/kits/basicSchedule/basicSchedule-7fdca638-1.2.28.kit]
WriteManifest [/home/leekwen/sedonadev/manifests/basicSchedule/basicSchedule-7fdca638.xml]
Compile [pstore]
Parse [3 files]
WriteKit [/home/leekwen/sedonadev/kits/pstore/pstore-7ea2cb06-1.2.28.kit]
WriteManifest [/home/leekwen/sedonadev/manifests/pstore/pstore-7ea2cb06.xml]
Compile [logManager]
Parse [1 files]
WriteKit [/home/leekwen/sedonadev/kits/logManager/logManager-da7714f6-1.2.28.kit]
WriteManifest [/home/leekwen/sedonadev/manifests/logManager/logManager-da7714f6.xml]
Compile [../platforms/src/generic/win32]
Parse [6 files]
WriteKit [/home/leekwen/sedonadev/kits/platWin32/platWin32-3746c8c1-1.2.28.kit]
WriteManifest [/home/leekwen/sedonadev/manifests/platWin32/platWin32-3746c8c1.xml]
Compile [../platforms/src/generic/unix]
Parse [2 files]
WriteKit [/home/leekwen/sedonadev/kits/platUnix/platUnix-751711ab-1.2.28.kit]
WriteManifest [/home/leekwen/sedonadev/manifests/platUnix/platUnix-751711ab.xml]
Compile [types]
Parse [15 files]
WriteKit [/home/leekwen/sedonadev/kits/types/types-10936551-1.2.28.kit]
WriteManifest [/home/leekwen/sedonadev/manifests/types/types-10936551.xml]
Compile [func]
Parse [23 files]
WriteKit [/home/leekwen/sedonadev/kits/func/func-821b7396-1.2.28.kit]
WriteManifest [/home/leekwen/sedonadev/manifests/func/func-821b7396.xml]
Compile [hvac]
Parse [8 files]
WriteKit [/home/leekwen/sedonadev/kits/hvac/hvac-7264c67c-1.2.28.kit]
WriteManifest [/home/leekwen/sedonadev/manifests/hvac/hvac-7264c67c.xml]
Compile [logic]
Parse [24 files]
WriteKit [/home/leekwen/sedonadev/kits/logic/logic-9fe95ce1-1.2.28.kit]
WriteManifest [/home/leekwen/sedonadev/manifests/logic/logic-9fe95ce1.xml]
Compile [math]
Parse [20 files]
WriteKit [/home/leekwen/sedonadev/kits/math/math-c22b255c-1.2.28.kit]
WriteManifest [/home/leekwen/sedonadev/manifests/math/math-c22b255c.xml]
Compile [timing]
Parse [7 files]
WriteKit [/home/leekwen/sedonadev/kits/timing/timing-aeaac82a-1.2.28.kit]
WriteManifest [/home/leekwen/sedonadev/manifests/timing/timing-aeaac82a.xml]
Compile [pricomp]
Parse [7 files]
WriteKit [/home/leekwen/sedonadev/kits/pricomp/pricomp-b5cd6698-1.2.28.kit]
WriteManifest [/home/leekwen/sedonadev/manifests/pricomp/pricomp-b5cd6698.xml]
*** Success! ***
Removing "/home/leekwen/sedonadev/temp/generic-unix"
Removing "/home/leekwen/sedonadev/temp/generic-unix/.par"
Removing "/home/leekwen/sedonadev/temp/generic-unix/.par/svm"
Removing "/home/leekwen/sedonadev/temp/generic-unix/.par/out"
InitStagePlatform [generic-unix.xml]
ReadKits [4 kits]
StageVM [/home/leekwen/sedonadev/temp/generic-unix]
GenNativeTable [/home/leekwen/sedonadev/temp/generic-unix/nativetable.c]
StagePlatform
*** Success! ***
gcc -D__UNIX__=1 -DSOCKET_FAMILY_INET=1 -DPLAT_BUILD_VERSION=\"1.2.28\" /home/leekwen/sedonadev/temp/generic-unix/*.c -O2 -o /home/leekwen/sedonadev/bin/svm
/home/leekwen/sedonadev/temp/generic-unix/main.c: In function ‘runInStandaloneMode’:
/home/leekwen/sedonadev/temp/generic-unix/main.c:184:7: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘int64_t’ [-Wformat]
/home/leekwen/sedonadev/temp/generic-unix/main.c: In function ‘printVersion’:
/home/leekwen/sedonadev/temp/generic-unix/main.c:321:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat]
/home/leekwen/sedonadev/temp/generic-unix/sys_Sys_std.c: In function ‘sys_Sys_longStr’:
/home/leekwen/sedonadev/temp/generic-unix/sys_Sys_std.c:51:3: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘int64_t’ [-Wformat]
/home/leekwen/sedonadev/temp/generic-unix/sys_Sys_std.c: In function ‘sys_Sys_longHexStr’:
/home/leekwen/sedonadev/temp/generic-unix/sys_Sys_std.c:67:3: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘int64_t’ [-Wformat]
Success [/home/leekwen/sedonadev/bin/svm]
Creating folder /home/leekwen/sedonadev/temp/generic-unix/.par/out
5、运行编译好的SVM虚拟机:
leekwen@Lenovo:~/sedonadev$ svm --help
Sedona VM 1.2.28
buildDate: Mar 21 2014 14:15:26
endian: little
blockSize: 4
refSize: 8
usage:
svm [options] <scode file> [<sab file>] [<Sedona main args>]
svm [options] --plat
options:
--? dump usage
--ver dump version
--home=d set current working directory
--plat run in platform mode. 'kits.scode[.stage]' and 'app.sab[.stage]'
must be present in the working directory
到此虚拟机的编译已经全部完成了,至于编译的命令,其实都是在$SEDONA_HOME/adm目录下的python脚本文件,需要修改或扩展的请自行修改,欢迎大家来共同交流!
<-----------转载此文请注明出处------------->