Sie sind auf Seite 1von 37

EMBEDDED SYSTEM :DEEPAK MATHUR

Real-Time Messaging for Embedded Systems and Mobile Devices

Antenna GPS Embedded SMA sku: GPS-00177 Description: Embedded antenna for small, mobile applications. Basic unpackaged antenna with LNA. 5inch cable terminated with standard male SMA connector. Match it with an SMA interface cable to create a trul small !"S protot pe#

$his unit works %er well out of the bo&, but the full packaged antennas ha%e better strain relief where the SMA cable meets the antenna housing. 'f ou plan on using this antenna in a %ibration intensi%e application, we recommend ou reinforce the connection with epo& or Shoe !oo. Features:

!ain ()dB *S+, -(.. *oltage /./* 012 ..5* 3urrent 4(mA +eight 45g

Mobile and embedded computer-based devices are becoming integral components of business and mission-critical systems. As a result, device-

EMBEDDED SYSTEM :DEEPAK MATHUR


based software must increasingly communicate with software running on other devices as well as with backend enterprise applications. Applicationto-application messaging is the enabling technologyfor this communication.RTI s real-time messaging infrastructure was designed from the ground up to meet the uni!ue challenges posed by embedded and mobile computing. These include" #upport for speciali$ed mobile, embedded and real-time operating systems %RT&#' &peration in resource-constrained environments - with limited memory, storage, processor and network bandwidth

Real-time performance - with deterministically low latency and high


throughput

(eterogeneous interoperability - across programming languages,


operating systems and processor types )eployment in dynamic, ad hoc environments - without system administration or servers *ommunicating over +A,, wireless and satellite networks - which can be intermittent, low bandwidth, high delay and lossy Meeting high-assurance re!uirements - including certification to safety and security standards -ecause traditional enterprise messaging and integration technologies do not satisfy embedded and mobile re!uirements, developers have traditionally had to create their own custom communications infrastructure. These in-house solutions can be time-consuming and e.pensive to develop. They are also e.tremely costly to maintain as new re!uirements are introduced, personnel turns over, and systems become larger, more comple., more stovepipe and thus more brittle. +ith a commercial alternative, RTI accelerates time-to-deployment while significantly reducing software lifecycle costs.

RTI Attribute

Benefits over Custom Middleware

EMBEDDED SYSTEM :DEEPAK MATHUR

Commercial "C TS#

ff-T!e-S!elf

Turnkey messaging infrastructure Tracks the latest operating system and development environment releases

#aves time and costs otherwise re!uired for internal middleware development, porting, integration, maintenance and support

/rovides an ecosystem of integrated technologies from RTI and partners

0asily evaluated against re!uirements1 an in-house solution s capabilities, performance and scalability can not be known until it is complete

/rovides time and costcertainty1 eliminates risk that middleware development will take longer than e.pected

Standards com$liant

2M#, ))# and #34 applications programming interfaces %A/Is'

RT/# on-the-wire protocol

5amiliar, well-documented interfaces and readily available training improve productivity of application developers %middleware users'

/ortability and interoperability provide vendor independence and ease integration of independently developed components

Robust

set

*omprehensive feature /erformance and

Meets current and future re!uirements, eliminating the risk that time-consuming and costly re-

EMBEDDED SYSTEM :DEEPAK MATHUR


scalability headroom engineering will be re!uired later

-road platform, programming language and transport support

Eases integration

4oosely-coupled integration model based on publish6subscribe

Reduces overall system comple.ity and eliminates interdependencies between subsystems

5ull interoperability across platforms and programming languages

Individual components can be added or upgraded without impacting already running software

,ew platforms and programming languages can be transparently introduced

Reliable

&perationally proven in some of the world s most demanding systems

(igh technology readiness for mission-critical systems

)eveloped and tested in accordance with RTI s rigorous !uality process

%eatures of RTI&s real-time messaging infrastructure Available for embedded' mobile and real-time o$erating systems

EMBEDDED SYSTEM :DEEPAK MATHUR


In addition to support for enterprise operating systems such as 4inu., +indows and 7ni., RTI s real-time messaging infrastructure is available for all leading embedded, mobile and real-time operating systems %RT&#'. These include"

4inu. - i89, .9: and /ower/* distributions


;reen (ills #oftware - I,T0;RIT< 4ynu.+orks - 4yn.&# Microsoft - +indows *0 and +indows Mobile 3,= +ind River #ystems - >.+orks

RTI is continually adding support for new platforms, including separation kernels based on the Multiple Independent 4evels of #ecurity %MI4#' architecture. Eases a$$lication integration RTI eases integration of embedded and mobile applications with each other, with enterprise applications, and into a #ervice-&riented Architecture %#&A'.

Applications using RTI s infrastructure are fully interoperable


across programming languages, operating systems and processor types

Application /rogramming Interfaces %A/Is' are available for *, *?


?, 2ava %2M# and ))#', .,0T and Ada Message contents are automatically transformed so that they are interpreted correctly by applications written in different programming languages and running on processors with different native data representations RTI keeps in-memory data caches on embedded and mobile devices synchroni$ed with enterprise databases RTI s messaging infrastructure is easily integrated with enterprise middleware including Application #ervers, *omple. 0vent /rocessing %*0/' engines, 0nterprise #ervice -usses %0#-s' and visuali$ation platforms Su$$orts resource-constrained systems

EMBEDDED SYSTEM :DEEPAK MATHUR


5or resource-limited embedded and mobile systems that need to minimi$e #i$e, +eight and /ower %#+A/', RTI features include"

5ully deterministic memory utili$ation with no dynamic allocation


re!uired after system initiali$ation

,o filesystem re!uired - messages can be persisted in-memory


and configuration can be fully programmatic #mall footprint - with an e.tremely %as low as @AB C-' available for high assurance and severely resource limited systems Real-time (uality of Service "(oS# and $erformance RTI meets the demanding performance re!uirements of embedded realtime applications, including"

4atency as low as AB microseconds over ;igabit 0thernet with


very high determinism and low Ditter

Application-to-application throughput as high as millions of


messages per second with no inherent limit on overall system-wide capacity - aggregate throughput of hundreds of millions of messages per second can be achieved >isibility into and control over message lifespans and deadlines for timing-critical applications 5ine-grained control over tradeoffs between latency, throughput, reliability and resource consumption 5iltering based on time and content RTI s peer-to-peer architecture is inherently real-time because there are no message broker, server or daemon processes introducing priority inversions" the scheduler determines the priority with which messages are sent and received. De$loyable in !ig!ly dynamic' ad !oc environments RTI is well-suited to dynamic, ad hoc environments with no system administration or servers"

RTI s infrastructure can be completely embedded within


communicating applications, there are no e.ternal processes %such as message brokers or servers' that must be deployed or managed

EMBEDDED SYSTEM :DEEPAK MATHUR


Applications can automatically discover each other" no
configuration of hostnames or network addresses is re!uired Runs over a wide variety of networ)s RTI provides e.tremely fle.ible transport support for mobile applications and systems deployed outside the enterprise"

&ut-of-the bo. support for 4A,, +A,, secure %T4#', satellite and
wireless communication over I/v: and I/v9

Reliable multicast for efficient broad data distribution #hared memory transport for high-performance inter-process
communication between components running on the same node /luggable interface for integration with other transports, including backplanes and switched fabrics, even those without I/ support *ell-suited for mission-critical systems RTI meets the re!uirements of the most demanding business and missioncritical applications"

5ault tolerant infrastructure with no single point of failure at either


the node or system level inaccessible Messages can be simultaneously sent over multiple transports and networks for redundancy and partitioning #ystem-level introspection for health monitoring and applicationmanaged high availability Technology proven over @E years in hundred of the world s most demanding and mission-critical applications /roducts developed in accordance with RTI s rigorous !uality process, with more source code and development time dedicated to 3uality Assurance %3A' than to technology development

Automatic failover in the event that an application or node fails or beco

Embedded & Mobile Systems operates as a developer o data!ase a"d e#!edded s$st sol%t&o"s t'at retre&ve data ro# dev&(es )e#!edded s$ste#s* !ar (ode s(a""ers* #o!&le se(%rel$ ro%te &" or#at&o" &"to t'e e"terpr&se or #as',%ps* a"al$s&s* das'!oards a"d d #a-&"./E#!edded 0 Mo!&le S$ste#s Data!ase sol%t&o"s o(%s o" data e1tra(t&o"* tra" load&". )ET2+ a"d report&"./ T'&s data!ase e#p'as&s &"(l%des (%sto# appl&(at&o"s or

EMBEDDED SYSTEM :DEEPAK MATHUR

E1(el* a"d M$S42 %s&". S42* 5BA* a"d Perl la".%a.es (o#!&"ed 6&t' (o"vers&o"s or#ats/ Mo!&le dev&(e data!ases* Bar(ode &"p%t* a"d &"spe(t&o" or# !ased data!ase s o%r spe(&alt&es/ E#!edded 0 Mo!&le S$ste#s e#!edded s$ste#s develop#e"t e#p'as&7es !r&"., %p a"d start%p o e#!edded s$ste#s : test!e"(' (ode* d&a."ost&(s* !ootloaders* a"d a%to#at&o" s(r&pts/ E#!edded plat or#s &"(l%de 2&"%1* %,!oot* Po6erT5 set,tops* a"d 8&"do6s 9E %s&". :"% tool('a&"s or 9;;<9* =ort'* a"d >?6 Asse#!ler/ 8e re#a&" (o# orta!le 6&t' lo6,level e#!edded de!%. tools l&-e @s(opes* a"al$7ers* a"d HD2 s&#%lators/ E#!edded 0 Mo!&le S$ste#s A"(/ proBe(ts !e.&" 6&t' (%sto#er reC%&re#e"ts a"d a C%otat&o" 'av&". a" &" or#al s('ed%le/ Bot' data!ase a"d e#!edded s$ste# develop#e"t e orts (o##e"(e 6&t' a #%t%all$ a.reea!le proBe(t pla" pro(ess t$p&(all$ (o"s&st&". o reC%&re#e"ts* develop#e"t* test&".* deplo$#e"t* #a&"te"a"(e* a"d (o"t&"%&t$<tra"s&t&o"/ 8'e" $o% 'ave a data!ase or e#!edded s$ste# "eed* please (o"ta(t %s/ GPS T'e Global Positioning System )GPS+ &s a U/S/ spa(e,!ased .lo!al "av&.at&o" s$ste#/ At prov&des rel&a!le pos&t&o"&".* "av&.at&o"* a"d t&#&". serv&(es to 6orld6&de %sers o" a (o"t&"%o%s !as&s &" all 6eat'er* da$ a"d "&.'t* a"$6'ere o" or "ear t'e Eart'/ :PS &s #ade %p o t'ree parts: !et6ee" 24 a"d 32 satell&tes or!&t&". t'e Eart'* o%r (o"trol a"d #o"&tor&". stat&o"s o" Eart'* a"d t'e :PS re(e&ver o6"ed !$ %sers/ :PS satell&tes !road(ast s&."als ro# spa(e t'at are %sed !$ :PS re(e&vers to prov&de t'ree,d&#e"s&o"al lo(at&o" )lat&t%de* lo".&t%de* a"d alt&t%de+ pl%s t'e t&#e/ :PS 'as !e(o#e a 6&del$ %sed "av&.at&o" 6orld6&de* a"d a %se %l tool or (arto.rap'$* s%rve$&". * (o##er(e* s(&e"t& &( %ses* tra(-&". a"d s%rve&lla"(e/ &"(l%d&". t'e s(&e"t& &( st%d$ o eart'C%a-es a"d as a t&#e s$"('ro"&7at&o" so%r(e or (ell%lar "et6or- proto(ols/ :PS 'as !e(o#e a #a&"sta$ o tra"sportat&o" s$ste#s 6orld6&de* prov&d&". "av&.at&o" or av&at&o"* .ro%"d* a"d #ar&t&#e operat&o"s/ D&saster rel&e a"d e#er.e"($ serv&(es depe"d %po" :PS or lo(at&o" a"d t&#&". (apa!&l&t&es &" t'e&r l& e,sav&". #&ss&o"s/ Ever$da$ a(t&v&t&es s%(' as !a"-&".* #o!&le p'o"e operat&o"s* a"d eve" t'e (o"trol o po6er .r&ds* are a(&l&tated !$ t'e a((%rate t&#&". prov&ded !$ :PS/ =ar#ers* s%rve$ors* .eolo.&sts a"d (o%"tless ot'ers per or# t'e&r 6or#ore e &(&e"tl$* sa el$* e(o"o#&(all$* a"d a((%ratel$ %s&". t'e ree a"d ope" :PS s&."als/

EMBEDDED SYSTEM :DEEPAK MATHUR


The Global Positioning System (GPS) is the only fully functional Global Navigation Satellite System (GNSS). The GPS uses a constellation of at least 24 (32 by March 2 !) Me"ium #arth $rbit satellites that transmit %recise micro&ave signals' that enable GPS receivers to "etermine their location' s%ee"' "irection' an" time. GPS &as "evelo%e" by the (nite" States )e%artment of )efense. *ts official name is N+,ST+-.GPS. +lthough N+,ST+-.GPS is not an acronym/01' a fe& bac2ronyms have been create" for it/21. The GPS satellite constellation is manage" by the (nite" States +ir 3orce 4 th S%ace 5ing. S&#&lar satell&te "av&.at&o" s$ste#s &"(l%de t'e R%ss&a" :2DEASS )&"(o#plete as o 2FF?+* t'e %p(o#&". E%ropea" :al&leo pos&t&o"&". s$ste#* t'e proposed 9DMPASS "av&.at&o" s$ste# o 9'&"a* a"d ARESS o A"d&a/ T'e :lo!al Pos&t&o"&". S$ste# ):PS+ &s t'e o"l$ %ll$ %"(t&o"al :lo!al Eav&.at&o" Satell&te S$ste# ):ESS+/ T'e :PS %ses a (o"stellat&o" o at least 24 )32 !$ Mar(' 2FF?+ Med&%# Eart' Dr!&t satell&tes t'at tra"s#&t pre(&se #&(ro6ave s&."als* t'at e"a!le :PS re(e&vers to deter#&"e t'e&r lo(at&o"* speed* d&re(t&o"* a"d t&#e/ :PS 6as developed !$ t'e U"&ted States Depart#e"t o De e"se/ Ats o &(&al "a#e &s EA5STAR,:PS/ Alt'o%.' EA5STAR,:PS &s "ot a" a(ro"$#G1H* a e6 !a(-ro"$#s 'ave !ee" (reated or &tG2H/ T'e :PS satell&te (o"stellat&o" &s #a"a.ed !$ t'e U"&ted States A&r =or(e 5Ft' Spa(e 8&"./ Real Time Os A" (o#p%ter s(&e"(e * real-time computing )RT9+* or Irea(t&ve (o#p%t&".I* &s t'e st%d$ o 'ard6are a"d so t6are s$ste#s t'at are s%!Be(t to a Ireal,t&#e (o"stra&"tIJ&/e/* operat&o"al deadl&"es ro# eve"t to s$ste# respo"se/ B$ (o"trast* a non-real-time system &s o"e or 6'&(' t'ere &s "o deadl&"e* eve" & ast respo"se or '&.' per or#a"(e &s des&red or pre erred/ T'e "eeds o real,t&#e so t6are are o te" addressed &" t'e (o"te1t o real t&#e o operat&". s$ste# * a"d s$"('ro"o%s pro.ra##&". la".%a.e * 6'&(' prov&de ra#e6or-s o" 6'&(' to !%&ld real,t&#e appl&(at&o" so t6are/ A real t&#e s$ste# #a$ !e o"e 6'ere &ts appl&(at&o" (a" !e (o"s&dered )6&t'&" (o"te1t+ to !e #&ss&o" (r&t&(al / T'e a"t& lo(- !rea-es o" a (ar are a s&#ple e1a#ple o a real,t&#e (o#p%t&". s$ste# J t'e real,t&#e (o"stra&"t &" t'&s s$ste# &s t'e s'ort t&#e &" 6'&(' t'e !ra-es #%st !e released to preve"t t'e 6'eel ro# lo(-&"./ Real,t&#e (o#p%tat&o"s (a" !e sa&d to 'ave failed & t'e$ are "ot (o#pleted !e ore t'e&r deadl&"e* 6'ere t'e&r deadl&"e &s relat&ve to a" eve"t/ A real,t&#e deadl&"e #%st !e #et/ Designing Real-time Software

EMBEDDED SYSTEM :DEEPAK MATHUR


Designing Realtime software involves several steps. The basic steps are listed below:

Software architecture definition Co design Defining software subsystems Feature design Task design

Soft&are +rchitecture )efinition This is the first stage of Realtime Software design. Here the software team understands the system that is being designed. The team also reviews at the proposed hardware architecture and develops a very basic software architecture. This architecture definition will be further refined in Co-Design. Use Cases are also used in this stage to analyze the system. Use cases are used to understand the interactions between the system and its users. For example, use cases for a telephone exchange would specify the interactions between the telephone exchange, its subscribers and the operators which maintain the exchange. 6o.)esign Once the software architecture has been defined, the hardware and software teams should work together to associate software functionality to hardware modules. The software handling is partitioned between different processors and other hardware resources with the following key considerations:

The software functionality should be partitioned in such a fashion that processors and links in the system do not get overloaded when the system is operating at peak capacity. This involves simulating the system with the proposed software and hardware architecture. The system should be designed for future growth by considering a scalable architecture, i.e. system capacity can be increased by adding new hardware modules. The system will not scale very well if some hardware or software module becomes a bottleneck in increasing system capacity.

1F

EMBEDDED SYSTEM :DEEPAK MATHUR

Software modules that interact very closely with each other should be placed on the same processor, this will reduce delays in the system. Higher system performance can be achieved by this approach as inter-processor message communication taxes the CPU as well as link resources. This stage is sometimes referred to as Co-Design as the hardware and software teams work together to define the final system architecture. This is an iterative process. Changes in system architecture might result in changes in hardware and/or software architecture. The next step in Realtime system design is the careful analysis of the system to define the software modules. )efining Soft&are Subsystems 1. Determine all the features that the system needs to support. 2. Group the various features based on the type of work they perform. Identify various sub-systems by assigning one subsystem for one type of features. Identify the tasks that will implement the software features. Clearly define the role of each task in its subsystem. 3. Within each subsystem, classify and group the features appropriately and associate the various tasks constituting the subsystem. For example, the Call Handling subsystem in Xenon would support features like: o V5.2 Originating to ISUP Outgoing Call o V5.2 Originating to V5.2 Terminating Call o Conference Call o Toll free call 3eature )esign A typical Realtime system is composed of various task entities distributed across different processors and all the inter-processor communication takes place mainly through messages. Feature Design defines the software features in terms of message interactions between tasks. This involves detailed specification of message interfaces. The feature design is generally carried out in the following steps:

11

EMBEDDED SYSTEM :DEEPAK MATHUR


1. Specify the message interactions between different tasks in the system 2. Identify the tasks that would be controlling the feature. The controlling tasks would be keeping track of progress of feature. Generally this is achieved by running timers. 3. The message interfaces are defined in detail. All the fields and their possible values are identified. %eature Design +uidelines

Keep the design simple and provide a clear definition of the system composition. Do not involve too many tasks in a feature. Disintegrate big and complex features into small sub features. Draw message sequence charts for a feature carefully. Classify the legs of a scenario for a feature in such a way that similar message exchanges are performed by taking the common leg. Provide a clear and complete definition of each message interface. To check possible message loss, design timer based message exchanges. Always consider recovery and rollback cases at each stage of feature design. One way of doing this is to keep a timer for each feature at the task that controls the mainline activity of the feature. And then insert the timeout leg in the message sequence charts of the feature. To avoid overloading of message links choose design alternatives that include fewer message exchanges. Tas2 )esign Designing a task requires that all the interfaces that the task needs to support should be very well defined. Make sure all the message parameters and timer values have been finalized. Selecting t!e Tas) Ty$e Once the external interfaces are frozen, select the type of task/tasks that would be most appropriate to handle the interfaces:

12

EMBEDDED SYSTEM :DEEPAK MATHUR

SingleStateMachine: The tasks functionality can be implemented in a single state machine. The v5.2 call task in Xenon is a good example of a task of this type. MultipleStateMachines:The task manages multiple state machines. Such tasks would typically include a dispatcher to distribute the received messages to an appropriate state machine. Such tasks would create and delete state machine objects as and when required. MultipleTasks: This type of tasks are similar to the multiple state machine tasks discussed above. The main difference is that the task now manages multiple tasks. Each of the managed tasks implements a single state machine. The manager task is also responsible for creating and deleting the single state machine tasks. ComplexTask: This type of task would be required in really complex scenarios. Here the manager task manages other tasks which might be managing multiple state machines. Selecting t!e State Mac!ine Design After choosing the type of task, the designer should consider dividing the message interface handling into a sequence of state transitions. Two different type of state machines can be supported:

Flat State Machines: This is the most frequently used type of state transition. For example, the states of a call would be "Awaiting Digits", "Awaiting Connect", "Awaiting Release", "Awaiting On-hook" etc. This type of state division does not scale very well with increasing complexity. For a complex system this technique results in a state explosion, with the task requiring hundreds of states. HierarchicalStateMachines:Here the states are viewed as a hierarchy. For example the states covered above would map to "Originating : Awaiting Digits", "Originating: Awaiting Connect", "Releasing : Awaiting Release", "Releasing : Awaiting On-hook". The total number of states is the same here, but the main difference is that some states inherit from an "Originating" base state and others inherit from "Releasing" base state. The total number of message handlers in each state would be reduced drastically, as all the messages that have common handling in all the originating states would be just handled in the "Originating"

13

EMBEDDED SYSTEM :DEEPAK MATHUR


base state. In addition to this, the handlers of inheriting states can further refine the base state handling by taking additional actions. Tas) Design +uidelines

Do not complicate the design by introducing too many states. Such designs are very difficult to understand. Follow a simple rule of thumb, if you are having difficulty choosing the name of state, you may have identified the wrong state. Do not complicate the design by having too few states. If all the states in the system have not been captured in the state machine design, you will end up with lot of flags and strange looking variables which will be needed to control the message flow in the jumbo states. Keep the data-structure definitions simple. See if a simpler data-structure would do the same job just as well. Out of memory conditions should be handled. Tasks can and will run out of memory. So handle the out of memory conditions gracefully. This can lead to a lot of "if clutter" so consider exception handling as an option. All of the legs of the defined scenarios should be handled. This is easier said than done. Many times all the scenario legs identified in the feature design stage may not cover all the possible error scenarios for your task. Make sure that all the allocated resources are deallocated at the end. Again it is very easy to miss out on this one. Many times designers forget to release resources in the error legs. Consider using a hierarchical state machine to simplify the state machine design. Consider using Object Oriented programming languages like C++. Contrary to popular belief, languages like C++ might turn out to be more efficient in runtime performance because of better locality of reference. (Most objects would be referring to data that is contained in the same object, thus improving the locality of reference)

T'e #a&" o!Be(t&ve o t'e proBe(t &s to develop t'e e"a!l&". te('"olo.$ a"d &" rastr%(t%re reC%&red to e e(t&vel$ %se t'e #ost adva"(ed te('"&C%es developed or real,t&#e appl&(at&o"s 6&t' le1&!le s('ed%l&". reC%&re#e"ts* &" e#!edded s$ste#s des&." #et'odolo.&es a"d tools* prov&d&". t'e "e(essar$ ele#e"ts to tar.et re(o" &.%ra!le pro(ess&". #od%les a"d re(o" &.%ra!le d&str&!%ted ar('&te(t%res/

14

EMBEDDED SYSTEM :DEEPAK MATHUR


T'e approa(' to a('&eve t'&s #a&" o!Be(t&ve &s to &"te.rate adva"(ed le1&!le s('ed%l&". te('"&C%es d&re(tl$ &"to a" e#!edded s$ste#s des&." #et'odolo.$* (over&". all t'e levels &"volved &" t'e &#ple#e"tat&o"* ro# t'e DS pr&#&t&ves* t'ro%.' t'e #&ddle6are* %p to t'e appl&(at&o" level/ T'&s 6&ll !e a('&eved !$ (reat&". a (o"tra(t #odel t'at spe(& &es 6'&(' are t'e appl&(at&o" reC%&re#e"ts 6&t' respe(t to t'e le1&!le %se o t'e pro(ess&". reso%r(es &" t'e s$ste#* a"d also 6'at are t'e reso%r(es t'at #%st !e .%ara"teed & t'e (o#po"e"t &s to !e &"stalled &"to t'e s$ste#* a"d 'o6 t'e s$ste# (a" d&str&!%te a"$ spare (apa(&t$ t'at &t 'as* to a('&eve t'e '&.'est %sa.e o t'e ava&la!le reso%r(es/ T'&s (o"tra(t,!ased #et'odolo.$ reC%&res* or ea(' reso%r(e* a" %"derl$&". &#ple#e"tat&o" t'at &s (apa!le o e" or(&". t'e reservat&o"s &#pl&ed !$ t'e d& ere"t a(t&ve (o"tra(ts/ T'e (o"tra(ts 6&ll !e &"te.rated 6&t' a (o#po"e"t,!ased ra#e6or-* a"d 6&ll prov&de t'e reC%&red level o a!stra(t&o" to #a-e t'e (o#po"e"t #odel &"depe"de"t o t'e %"derl$&". &#ple#e"tat&o" a"d 'ard6are ar('&te(t%re/ T'e ra#e6or- 6&ll !e porta!le a(ross d& ere"t s('ed%l&". strate.&es a"d plat or#s/ Be(a%se o t'e d$"a#&( "at%re o t'e (o"tra(ts a"d t'e &"depe"de"(e t'at t'e$ prov&de a#o". t'e d& ere"t real,t&#e (o#po"e"ts o t'e appl&(at&o"* t'e #et'odolo.$ &s 6ell s%&ted to address ver$ d$"a#&( s$ste#s* s%(' as t'ose !ased o" re(o" &.%ra!le ar('&te(t%res/ E#!edded data!ase *ombining in-memory database with storage caching of disk database, ITTIA )- #34%TM' enables application development on embedded systems. (ybrid database can contain related data that is divided into memory and disk tables. Memory tables are optimi$ed to minimi$e */7 cycles, while disk tables emphasi$e throughput when data is saved to blockdevices. -y using solid relational model foundation, relationships are navigated with #34 !ueries or accessed directly with low-level functions. FFFFFFFFFFFFFFFFFFFF &ctober G, EBBH - -ellevue, +A - 0mbedded devices continuously process information from a wide variety of sources, such as sensors, user input, network communications. )evelopers recogni$e cases for whichdata must be accessed !uickly with predictable speed and cases for which data must be saved continuously to flash media or a hard drive. To address this need, ITTIA unveils the revolutionary new ITTIA )- #34TM hybrid memory and disk database for application development on embedded systems and devices. ITTIA )- #34 hybrid combines the fast, predictable performance of an inmemory database with the robust storage caching of a disk database. ITTIA )- #34 hybrid delivers capabilities culminated from decades of database

15

EMBEDDED SYSTEM :DEEPAK MATHUR


evolution in a compact, self-managing package for development of applications in consumer electronics, medical devices, portable media players, network appliances, telecommunication systems, and other embedded systems. An ITTIA )- #34 hybrid database can contain related data that is divided into memory and disk tables. Memory tables are optimi$ed to minimi$e */7 cycles, while disk tables emphasi$e throughput when data is saved to block devices such as flash media or a hard disk. -y usinga solid relational model foundation, relationships are easily navigated with #34 !ueries or accessed directly with low-level functions. All tables share the same transactional database kernel, whether they are stored in memory or on disk. )ata is always accessed through common A/Is and can be shared between threads and processes. Transactions ensure the integrity and consistency of the data, but, because the data is managed within a single database, without the comple.ity of distributed transactions. Modular devices can e.tend their functionality dynamically by adding new tables and fields to the database. )evices and embedded systems that use ITTIA )- #34 benefit from ITTIA s philosophy of fle.ibility. +hile ITTIA offers several differenteditions to target the wide variety of re!uirements for database features and footprint, all ITTIA )- libraries are source, file, and binary-compatible. Manufacturers can build a complete line of products that are based on a single code base for data access. (igh-performancecode can use concise, low-level calls to access and modify individual rows directly. The same data can also be accessed with high-level #34 !ueries, for interoperability and accelerated prototyping. The hybrid model used by ITTIA )- #34 is ideal for devices that log events occurring at a very high fre!uency. The event log itself maybe stored temporarily in memory, and related data such as event types, critical events, and thresholds can be stored in disk tables that are automatically and continuously saved to flash media. The device can monitor and store the ma.imum values for each type of event. -oth the event log and associated data can be shared between the logging task, reporting mechanism, user interface, and any other components. IITTIA )- #34 hybrid offers developers a broad selection of lightweight R)-M# embeddable database features to meet their specific application re!uirements,I said #asan Montaseri, ITTIA /resident. I&ur customers already benefit from ITTIA )- #34 s fle.ibility, performance at lower cost. The introduction of ITTIA )- #34 hybrid completes this value-added offering. +e continue our focus to deliver the highest !uality products and services at a lower cost.I A free, AB-day evaluation of ITTIA )- #34 is available at the ITTIA )0valuation *enter. The evaluation kit contains a complete embedded database library, optional server, and #34 tools.

16

EMBEDDED SYSTEM :DEEPAK MATHUR


About ITTIA ITTIA offers a leading-edge embedded R)-M# for platforms where limited memory, storage, and processing power make software development challenging. ITTIA develops fast, high-performance relational lightweight database products and tools with the goal of providing e.cellentdata management software for embedded systems and devices. ITTIA s products are designed to be suitable for application development and deployment at significantly reduced cost. ITTIA s customers include 5reescale #emiconductor, /anasonic, /uget #ound 0nergy, -oeing, and others. EMBEDDED DATABASE TE9HD2D:Y =DR SE9URATY SYSTEMS DRA92E EMBEDDED Se(%r&t$ s$ste#s L 6'et'er p%re so t6are or a (o#!&"at&o" o Se(%r&t$ s$ste#s "eed data!ase 'ard6are a"d so t6are L #%st store a"d #a"a.e (r&t&(alstora.e B%st l&-e #a"$ ot'erappl&(at&o"s/ Ho6ever* t'e &" or#at&o" rel&a!l$/ Be(a%se t'ese s$ste#s are a (r%(&al part o t'e spe(&al reC%&re#e"ts o t'e se(%r&t$ #ar-et #ea" t'at se(%r&t$ &" rastr%(t%re or e"terpr&ses* t'e$ 'ave %"%s%al ve"dors #%st ('oose t'e&r reC%&re#e"ts "ot (o##o" to #a"$ !%s&"ess appl&(at&o"s t'at %se data!ase part"er (are %ll$/ database technology 9'oos&". t'e r&.'t data!ase prod%(t (a" &"(rease rel&a!&l&t$* &#prove per or#a"(e a"d e"'a"(e t'e level o se(%r&t$ prov&ded !$ #&ss&o",(r&t&(al deplo$ed s$ste#s/ Securing Data from Attac Se(%r&t$ &" rastr%(t%re* B%st l&-e ot'er appl&(at&o"s* operates o" data L %ser pass6ords* pro &le a"d pre ere"(es* roles a"d respo"s&!&l&t&es* a((ess lo.s* (o" &.%rat&o" sett&".s a"d #ore/ U"l&-e #a"$ !%s&"ess appl&(at&o"s* t'o%.'* se(%r&t$ &" rastr%(t%re prod%(ts #%st !e 'arde"ed a.a&"st atta(-/ As a res%lt* t'e (o#po"e"ts t'at #a-e %p t'e se(%r&t$ so t6are* &"(l%d&". a"$ data!ase s$ste#* #%st !e des&."ed or se(%re deplo$#e"t/ Se(%r&t$ t'reats (a" (o#e ro# a "%#!er o &#ple#e"tat&o" ('o&(es &" so t6are/ Espe(&all$ (o##o"* t'o%.'* are t'reats d%e to e1posed ad#&"&strat&ve or %ser,level &"ter a(es* 6'&(' allo6 a" atta(-er to (o##%"&(ate d&re(tl$ 6&t' a s%!s$ste# &" t'e se(%r&t$ prod%(t/ Ma"$ data!ase s$ste#s rel$ o" s%(' &"ter a(es &" "or#al operat&o"/ Des&."ers o se(%r&t$ &" rastr%(t%re are o te" !est served !$ ('oos&". a tr%l$ e#!edda!le data!ase #a"a.e#e"t s$ste#* rat'er t'a" a (o"ve"t&o"al RDBMS des&."ed or !%s&"ess appl&(at&o"s* or %se &" t'e&r prod%(ts/ A (o##er(&al e#!edded data!ase (a" prov&de all t'e per or#a"(e* rel&a!&l&t$ a"d re(overa!&l&t$ .%ara"tees t'at appl&(at&o"s reC%&re* a"d (a" also &#prove overall se(%r&t$ !$ el&#&"at&". &"ter a(es t'at (o%ld !e %se to (o#pro#&se t'e s$ste#/ Dra(leMs a#&l$ o e#!edded data!ase prod%(ts* &"(l%d&". Dra(le Data!ase* Dra(le T&#esTe" A",Me#or$ Data!ase* Dra(le Ber-ele$ DB a"d Dra(le Data!ase 2&te* 6as des&."ed or %se &" appl&(at&o"s t'at "eed ast* rel&a!le stora.e serv&(es* 6&t'o%t reC%&r&". a data!ase ad#&"&strator/ T'ese prod%(ts (a" !e deplo$ed or

13

EMBEDDED SYSTEM :DEEPAK MATHUR


7ero or "ear 7ero ad#&"&strat&o"* so t'at t'e$ are &"v&s&!le a"d &"a((ess&!le to %sers a"d #al&(&o%s atta(-ers/ El&#&"at&". Pat's o Atta(- T'e s&#plest 6a$ to se(%re a A (o##o" strate.$ or !rea('&". se(%r&t$ &s to se"d !ad data to t'e p%!l&( s$ste# &s to el&#&"ate pat's t'at atta(-ers (a" %se to &"ter a(es o a s$ste# L stole" lo.&" &" or#at&o"* lar.e str&".s t'at over lo6 !% ers* (o#pro#&se &t/ &lle.al ('ara(ters or s$ste# (o##a"ds/ Rat'er t'a" val&date ever$ s&".le &"p%t str&".* a s&#pler strate.$ or 'arde"&". s$ste#s &s s&#pl$ to el&#&"ate t'ose &"ter a(es alto.et'er/ Dra(leMs e#!edded data!ase prod%(ts (a" 'ave #ost or all o t'e&r ad#&"&strat&ve %"(t&o"s 'a"dled pro.ra##at&(all$/ T'&s #ea"s t'at t'e se(%r&t$ appl&(at&o"* rat'er t'a" a '%#a" !e&".* (a" ta-e respo"s&!&l&t$ or tas-s l&-e !a(-%ps* ('e(-po&"t&".* lo. ar('&val a"d so o"/ B$ re#ov&". t'ese operat&o"s ro# t'e do#a&" o '%#a"s* a"d !$ 'a"dl&". t'e# &"s&de t'e 'arde"ed s$ste#s* t'e data!ase e".&"e #a&"ta&"s a '&.' de.ree o overall se(%r&t$/ A" add&t&o"* Dra(leMs e#!edded prod%(ts #a$ .e"erall$ !e (losel$ (o%pled 6&t' t'e deplo$ed s$ste#/ Rat'er t'a" rel$&". o" "et6or-,!ased proto(ols or (o##%"&(at&o"* t'ese s$ste#s (a" %se ('a""els lo(al to a s&".le #a('&"e* s%(' as s'ared #e#or$ or eve" %"(t&o",(all &"ter a(es &" a s&".le pro(ess* to et(' a"d store data/ T'&s #ea"s t'at atta(-ers (a""ot %se t'e data!ase e".&"e as a 6a$ to .a&" a((ess to t'e #a('&"e* s&"(e t'ere are "o "et6or- (o##%"&(at&o" ('a""els ope" ro# &"s&de t'e data!ase/ Per or#a"(e* Rel&a!&l&t$* S(ala!&l&t$ D (o%rse* se(%r&t$ prod%(ts are o te" (r%(&al p&e(es o &" rastr%(t%re/ As a res%lt* t'e$ #%st !e ast* rel&a!le* a"d a!le to 'a"dle %"e1pe(ted sp&-es &" de#a"d/ 9'oos&". a" e#!edded data!ase s$ste# or stora.e (a" 'elp/ All o Dra(leMs data!ase prod%(ts 'ave a lo". '&stor$ o real,6orld deplo$#e"t &" #&ss&o",(r&t&(al s$ste#s/ Ea(' del&vers '&.',per or#a"(e data stora.e serv&(es* a"d (a " s%rv&ve so t6are a"d 'ard6are a&l%res 6&t'o%t los&". &" or#at&o"/ T'e R&.'t Tool or t'e No! Dra(leMs prod%(t l&"e &"(l%des a ra".e o e#!edda!le s$ste#s/ Developers (a" ('oose t'e data!ase s$ste# t'at !est #eets t'e reC%&re#e"ts o t'e&r appl&(at&o"/ !racle Database Dra(le Data!ase &s t'e &"d%str$Ms lead&". e"terpr&se relat&o"al data!ase #a"a.e#e"t s$ste# a"d o ers a r&(' eat%re set s%pport&". :r&d 9o#p%t&".* prov&des '&.'l$ ava&la!&l&t$* a"d e1tre#el$ rel&a!le data!ase serv&(es or tra"sa(t&o" pro(ess&".* data 6are'o%s&". a"d #a"$ ot'er t$pes o appl&(at&o"s/ Dra(le Data!ase (a" !e pa(-a.ed alo". 6&t' t'e appl&(at&o" t'at %ses &t* &"stalled a"d (o" &.%red s&le"tl$ !$ t'e appl&(at&o"* a"d ad#&"&stered a"d #a"a.ed !$ t'e appl&(at&o" (o#pletel$ a%to#at&(all$* 6&t' "o '%#a" &"terve"t&o"/ !racle "imes"en #n-Memory Database Dra(le T&#esTe" &s a '&.',per or#a"(e data!ase s$ste# des&."ed or appl&(at&o"s 6'ere per or#a"(e &s a!sol%tel$ (r&t&(al/ T&#esTe" .%ara"tees t'at t'e e"t&re data!ase res&des &" #e#or$ at all t&#es* a"d %ses a pate"ted stora.e a"d sear(' strate.$ to lo(ate &",#e#or$ data C%&(-l$/ T&#esTe" &s a %ll$ tra"sa(t&o"al*

1?

EMBEDDED SYSTEM :DEEPAK MATHUR


S42!ased data stora.e e".&"e* so o ers developers a#&l&ar &"ter a(es or data a((ess/ !racle $er eley D$ Ber-ele$ DB &s Dra(leMs o"l$ "o",relat&o"al s%&te o data!ase prod%(ts/ Ber-ele$ DB prov&des '&.',per or#a"(e B,tree* 'as'* pers&ste"t C%e%e a"d ot'er str%(t%res or stor&". pro.ra# data &" &ts "at&ve or#at/ Ber-ele$ DB l&"-s d&re(tl$ &"to t'e address spa(e o t'e appl&(at&o" t'at %ses &t/ As a res%lt* t'ere &s "o separate server to &"stall or ad#&"&ster/ !racle Database %ite Dra(le Data!ase 2&te &s t'e (o#pa"$Ms e#!edded data!ase s$ste# des&."ed or #o!&l&7ed appl&(at&o"s/ Dra(le 2&te o ers d&s-,!ased S42 stora.e serv&(es &" a s#all, ootpr&"t pa(-a.e/ Developers (a" also %se t'e S$"('ro"&7at&o" Server to -eep a (olle(t&o" o Dra(le 2&te (l&e"t data!ases s$"('ro"&7ed 6&t' a (e"tral&7ed Dra(le Data!ase store/ &onclusion Dra(le o ers a ra".e o data!ase prod%(ts to developers !%&ld&". se(%r&t$ s$ste#s/ Data #a"a.e#e"t &s at t'e (ore o v&rt%all$ ever$ (o#p%ter s$ste#* &"(l%d&". se(%r&t$ s$ste#s/ T'e %"%s%al reC%&re#e"ts &" se(%r&t$* 'o6ever* #ea" t'at des&."ers #%st (are %ll$ (o"s&der t'e&r opt&o"s 6'e" ('oos&". data!ase te('"olo.$ or deplo$#e"t/ 9o##er(&all$,ava&la!le prod%(ts (a" prov&de o%tsta"d&". per or#a"(e* rel&a!&l&t$ a"d s(ala!&l&t$* !%t %"less t'e$ are e1pressl$ des&."ed or e#!edded %se* #a$ (o#pro#&se overall s$ste# se(%r&t$/ Dra(leMs a#&l$ o e#!edda!le data!ase prod%(ts L Dra(le Data!ase* Dra(le T&#esTe"* Dra(le Ber-ele$ DB a"d Dra(le 2&te L o er a ra".e o stora.e serv&(es* &" pa(-a.es t'at (a" !e eas&l$ deplo$ed &" #&ss&o",(r&t&(al se(%r&t$ s$ste#s/ T'e (o#!&"at&o" o per or#a"(e* rel&a!&l&t$* s(ala!&l&t$ a"d se(%r&t$ t'at Dra(le o ers &s a" &#porta"t adva"ta.e to ve"dors !%&ld&". prod%(ts &" t'&s spa(e/ #nformation apliances .e"eral ter#s* a" information appliance or information de'ice &s #a('&"e or dev&(e t'at &s %sa!le or t'e p%rposes o (o#p%t&". * tele(o##%"&(at&o" * reprod%(t&o" * a"d prese"tat&o" e"(oded A" or#at&o" &" #$r&ad or#s a"d appl&(at&o"sH T'e (o##o" te('"&(al %sa.e o Iinformation applianceI )#A+ &s #ore spe(& &( J &/e/* a" appl&a"(e t'at &s spe(&all$ des&."ed to per or# a spe(& &( %"(t&o" Js%(' as pla$&". #%s&( * p'oto.rap'$ / T$p&(al e1a#ples are s#artp'o"e a"d perso"al d&.&tal ass&sta"t/ A" or#at&o" appl&a"(es part&all$ overlap &" de &"&t&o" 6&t'* or are so#et&#es re erred to as* s#art dev&(es* e#!edded s$ste# * #o!&le dev&(es* 6&reless dev&(es* or 'a"d'elddev&(es/
Pervasive Computing is the main characteristic of the emerging fourth era of computer evolution. The paper discusses features of a new generation of intelligent sensor-based information appliances for distributed heterogeneous real-time applications. These appliances

1K

EMBEDDED SYSTEM :DEEPAK MATHUR


will be found in the intelligent homes, offices, automobiles and cities of the future. They will also offer higher mobility and convenience to professionals and open new avenues to many industrial and health applications. 1. Introduction Since its emergence, some forty years go, computing industry has passed through a rapid sequence of technological phases: central computing/mainframe (1950s-1980s), personal computer/PC (1980s-...), computer networks (1990s -...). A fourth era is emerging now, when computers become pervasive, i.e. a technology more noticeable by its absence than its presence [1], [6], [11], [14], [17], [22], [25]. The first mass-produced pervasive computing devices are starting to appear. The Clarion AutoPC [8] provides an efficient, reliable and secure integrated communications, computing, navigation, car control and entertainment system. The NCR Microwave Oven/Home Banking Terminal [21] and the Electrolux Internet Connected Screen Fridge [12], allow effortless home management. A good example scenario is given in [16]: "Opening the fridge to take out a soda, you may notice that there is only one left. The smart fridge recorded that and adds an action item on your shopping list. The next day, as you drive home from work, the GPS-enabled AutoPC in your car, previously informed by your fridge that purchases need to be made, signals that you are near a supermarket. As you cruise the isles of the supermarket, wearing your augmented-reality goggles and your wearable computer a soda supply triggers an object recognition program and an alarm reminds you to buy soda. The same could be done by your pocket Personal Digital Assistant (PDA) when sensing the presence of the soda supply." Another pervasive computing example is given in [14]:

,age "Your intelligent car develops an engine problem, but instead of flashing you a warning light it sends a message directly to the manufacturer over a wireless connection to the network. The manufacturer's systems diagnose the problem and transmit a fix back to the electronics complex in your car. In fact, that corrective fix is transmitted to all models everywhere in the world, without ever having to notify the owners. .... Instant information on performance is captured and sent immediately into product development and manufacturing. " The recently announced Cisco Internet Home, a 170 square-meter living space, has almost all house appliances (refrigerator, microwave oven, internet-based phone, television, computer, Web cams, wireless touch-pads, health maintenance devices, ...) connected to Internet through a Residential Gateway. Cisco Systems Inc. wants to prove that "... the Internet is the next utility in the home, and, within three to five years, will be as pervasive as gas, water or electricity." Electric servo appliances are a good example of pervasive technology [4], [6]. The average North American home contains two dozen or more electric motors. A multitude of sensors is gathering the information needed to control them. As all these are buried inside many appliances (vacuum cleaners, microwave ovens, refrigerators, VCRs, etc.) we have difficulty identifying them and we actually don't care where and how many they are as long as they are doing their job. In the future, the same will be true with computers, most of which will be hidden in information appliances [22]. These new appliances are "smart devices" embedded with microprocessors that allow users to plug into intelligent networks and gain direct, simple, and secure access to both relevant information and services. These devices are as simple to use as calculators, telephones or kitchen toasters. Pervasive Computing envisions the " networked home" where domestic devices can interact seamlessly with each other and with in-home and external networks. Using the existing home infrastructure based on open industry standards, a person will be able to integrate the home network with external networks to easily manage home devices, both locally and remotely. Recent progress in computer, integrated circuit, and communications technologies allows the use of complex algorithms from various domains (such as signal and image processing, system identification, modelling, control, and AI). It becomes also possible to implement user friendly virtual environments for the development of an ever growing diversity of real-time intelligent sensing applications ranging from Computer Integrated Manufacturing (CIM) to smart homes and offices [15], [18], [23]. Early digital and computer-based instrumentation architectures and communications standards

2F

EMBEDDED SYSTEM :DEEPAK MATHUR


as HP-IB (IEEE 488) represented embryonic smart sensing solutions supporting the first generation of computer based industrial applications. Microprocessor controlled sensors and virtual instrumentation integration environments such as LabView, together with wireless and Internet communications, allowed to develop a large variety of embedded industrial applications. The advent of pervasive computing marks an urgent need for a new generation of intelligent sensing agents and information appliances as well as for related resource management

,age .
environments to be used in a broader selection of applications involving loosely coupled, eventdriven, heterogeneous information appliances. The aim of this paper is to discuss development scenarios for intelligent sensor environments and pervasive computer architectures able to support a new generation of information appliances for distributed heterogeneous real-time applications. 2. Sensor-based information appliances While the smart networked home is a very good first example, the development of intelligent sensing agents and sensor-based information appliances will spread the pervasive technology ideas to a multitude of human activities such as mining and manufacturing, security industry, transportation, training and health etc. It is not exaggerate to claim that this technology, when integrated with the emerging global information infrastructure, will have a profound impact on our personal and professional activities, and will open business opportunities, of a similar or even higher scale than what we are experiencing presently with the Internet. As their perception, intelligence and networking abilities grow, the electric appliances are evolving into information appliances representing the next, information-intensive, evolutionary stage for the pervasive computing paradigm. Donald Norman makes a compelling argument in [22] for the information appliance paradigm that he sees as being "the natural successor to today's [computer] complexity ... through the user-centered, human-centered, humane technology of appliances where the technology of the computer disappears behind the scenes into taskspecific devices that maintain all the power without the difficulties." The business model for this disruptive technology shifts from the technology-driven computer industry to the consumerdriven model of the consumer appliance industry. Lower profit margins are to be expected from high volumes of consumable devices, services and content. The nature of pervasive information appliances requires that the developed architectures should distributed rather than centralized. These appliances will provide a seamless intelligent connection of the perception to action, [7]. These new developments point to a new type of intelligent control based on a multisensory perception of the state of the controlled process and its environment [7], [10]. The use of multiple sensors is beneficial in improving the accuracy, the cost and robustness of the perception process. World models, built and maintained from information gathered by a multitude of sensors, provide a common abstract representation of the state of the environment. At the perception level, the world model is analyzed to infer relationships between different objects. Sensor architectures integrating both proprioceptors (sensors monitoring the internal state of information appliances) and exteroceptors (sensors monitoring the state of the environment outside the information appliance) using sensor-models and world-models will provide superior modularity, interchangeability ("plug and play") and transparence. All these will eventually allow for easier sensor fusion and knowledge extraction.

,age /
Intelligent task-directed information gathering features will allow for a more elastic and efficient use of the inherently limited sensing and processing capabilities of each sensor. Each task a sensor has to carry out determines the nature and the level of the information that is actually needed. Sensors should be able of selective environment perception that focuses on parameters important for the specific task at hand and avoid wasting effort to process irrelevant data. A task-specific decision making process will guide the incremental refinement of the environment model. Information appliance should be able to learn and adapt their behavior to changes in their working environment including other appliances as well as human users. Such adaptability is already provided by the smart habitat controls of some cars which offer an automatic adjustment of the seat, mirrors, and drive wheel's column tilt to accommodate every driver's preference. These appliances should also be able to deal with multiple redundant communication carriers

21

EMBEDDED SYSTEM :DEEPAK MATHUR


(Intranet, Internet, power lines, wireless, infrared, etc.). Some of the specific objectives for the development of these sensor based information appliances are: (i) design of hybrid deliberative/reactive architectures integrating deliberative reasoning and behavior-based control functions [5]; (ii) design of model-based multi-sensor fusion systems able to integrate a variety of sensors that cover all four phases in the environment perception process: far away, near to, touching, and manipulation; (iii) study of new task-directed sensor fusion and learning methods for an active perception, which will allow the information appliance to gather information by interaction with the environment; (iv) design of redundant multi-carrier communication systems. 3. "Symbiont" intelligent appliances Human-computer interaction (HCI) is a well-established field of computer science and engineering [1]-[3], [24]. The advent of the embedded computing systems led to a system integration approach to HCI design which is quite well summarized by the following quote from [2]: "Instead of workstations, computers may be in the form of embedded computational machines, such as parts of spacecraft cockpits or microwave ovens. Because the techniques for designing these interfaces bear so much relationship to the techniques for designing workstations interfaces, they can be profitably treated together." As the era of pervasive computing commences, portable wireless PDAs or wearable computers will be widely used [4], [19], [20] and [25]. There are applications such as remote sensing, environment monitoring, and telerobotics for hazardous operating environments requiring very complex monitoring and control processes. Many of these applications cannot be fully automated. Human operator expertise is still needed to carry out tasks requiring a higher level of intelligence. In such cases, human operators

,age 0
and intelligent sensing systems are called to work together as symbionts, each contributing the best of their specific abilities, as illustrated in Figure 1. A proper control of these operations cannot be accomplished without some telepresence capability allowing the human operator to experience the feeling that he/she is virtually immersed in the working environment. Figure 1: Human operators and sensor-based appliances work together as symbionts, each contributing the best of their specific abilities. HCI (Human Computer Interaction) interfaces provide a telepresence capability allowing the human operator to experience the feeling that he/she is virtually immersed in the working environment. Appropriate geometric-, force-, and touch-domain human-feedback devices will have to be developed in addition to the currently available visual and sound HCI devices.

,age 1
In order to find efficient solutions to the complex perception tasks, these symbiont intelligent appliances will have to combine their intrinsic reactive-behavior with higher-order world model representations of the immersive virtual reality systems. 4. Management of heterogeneous functions for a large diversity of information appliances Pervasive computing environments involve both human-machine and machine-machine interaction and cooperation paradigms. The discussion will concentrate on machine-machine aspects. We are all familiar with human-to-human communication and cooperation, which require a common language and an underlying system of shared knowledge and common values. In order to achieve a similar degree of machine-machine interaction and cooperation, a framework should be developed to allow for the management of heterogeneous functions and knowledge for a large diversity of pervasive computing devices. Such a framework should address the communication needs of pervasive devices at a higher level than the classical communication network protocols and even distributed computing frameworks such as CORBA (Common Object Request Broker Architecture) which provide mainly distribution transparency. Heterogeneous pervasive computing devices cannot realistically be expected to talk exactly the same language. However, these devices will share domain-specific knowledge, which may be expressed by each of them in different format/dialect. Accordingly, the proposed management framework should define a domain specific semantic for

22

EMBEDDED SYSTEM :DEEPAK MATHUR


common knowledge and functions. This framework is expected to act as a universal translator between different dialects. In order to provide a flexible extensible open framework allowing for the information appliances interoperability, methods should be developed to allow different devices to exchange the grammars describing their own dialects and to learn to understand each other. This way, the devices will be able to advertise their own functions, search and discover providers of required services, and express their needs in a collaborative environment. Going beyond its original scope to interchange structured documents conveniently over the Internet, XML (Extensible Markup Language), [13] and [26], could provide high level protocols for exchanging information between different information appliances. XML provides a syntax for building a formal model known as a DTD (Document Type Definition), which describes relationships between entities, elements and attributes of each class of documents related to a certain application domain. Since a DTD gives a standard format for information related to a specific domain, it can be used to simplify the exchange of information between different sources which refer to the same domain regardless of the internal format used by each source. Many kinds of domains have standard DTDs, as for example chip manufacturers, chemical applications, etc. XML could also be developed to facilitate the interoperability of information appliances. Figure 2 illustrates the main communication processes an information appliance is supposed to manage.

,age 2
Figure 2: Information appliances should interact in an unobtrusive way with humans, other appliances and the rest of the world while carrying on their specific task in their physical environment. World models, built and maintained from information gathered by a multitude of sensors, provide a common abstract representation of the state of the environment. A hybrid deliberative/reactive architecture integrates the deliberative reasoning and behavior-based control functions. A distributed computing frameworks together with high level information exchange mechanisms provide a flexible extensible open framework allowing for the information appliances interoperability. Special communication mechanisms will allow the information appliance to handle a variety of redundant and complementary information channels. 5. Networking technologies for pervasive information appliances. As a very large number of devices will be connected through infrared and radio wireless and wire-line global networks infrastructure, existing technologies will be rendered inefficient; new solutions have to be invented. Bandwidth and resource limitations of the wireless medium require that information content is compressed as much as possible, in order to consume the least amount of resource possible.

,age 3
However, such low redundancy makes the information vulnerable, especially in an error-prone environment such as wireless channels and networks. Personal Area Network (IEEE 802.15) and existing Local and Wide Area Network (e.g. IEEE 802.11), Internet Protocols (Mobile IP, IPv6, RTP/RTCP, RSVP, XTP etc.), Wireless Application Protocol (WAP) are already available. However, it is expected that the size and complexity of the problem would require the development of new technologies and standards when developing a new Distributed Networks Architectures (DNA) suitable for the support of pervasive computing at a large scale. The development should address wired and wireless networking issues looking for the development of cost-effective solutions for environments where deployment of advanced networking infrastructure could be unjustifiably costly. The following appear to be of an immediate interest: Service admission control and connection establishment policies, as well as resource allocation and resource adaptation algorithms for the support of pervasive devices. Quality of Service capable, error-resilient and resource allocation-efficient multiple-access protocols for the efficient transportation of sensor traffic. Intelligent networking infrastructure and definition of suitable architectures of distributed nature. Cost -effective network solutions for environments where there is no advanced networking

23

EMBEDDED SYSTEM :DEEPAK MATHUR


infrastructure deployment. Acknowledgment This work was funded in part by Communications and Information Technology Ontario (CITO) and the Natural Sciences and Engineering Research Council (NSERC) of Canada. References 1. *** "A Brief History of Wearable Computing," http://wearables.www.media.mit.edu/projects/wearables/timeline.html 2. ***, "Human-Computer Interaction Bibliography," http://www.hcibib.org/ 3. ***, "Human-Computer Interaction Resources," http://dir.yahoo.com/Science/Computer_Science/Human_Computer_Interaction__HCI_/ 4. ***, "Special Issue on Information Appliances," IEEE Computer Graphics and Applications Magazine, May/June 2000. 5. R.C. Arkin, Behavior-Based Robotics, The MIT Press, 1998 6. J. Birnbaum, "Pervasive Information Systems", Communications of the ACM, Vol. 40, No.2, pp. 40-41, Feb. 1997 7. A. Brooks, L.A. Stein, "Building Brains for Bodies", Autonomous Robots, Vol. 1, No.1, pp. 7-25, 1994 8. Clarion Corp., "Auto PC ," http://www.autopc.com/walkthrough/communication/, 1999 9. P. Dabke, "Enterprise Integration via CORBA-Based Information Agents", IEEE Internet Computing, vol. 3, no. 5, pp. 49-57, Sept-Oct. 1999

,age 4
10. B.V. Dasarathy, "Sensor Fusion Potential Exploitation Innovative Architectures and Illustrative Applications," Proc. IEEE, Vol. 85, No. 1, pp. 24-38, Jan. 1997 11. M.L.Dertouzos, "The Future of Computing", Scientific American, 52, pp.52-55, Aug. 1999 12. Electrolux Inc., "Electrolux screen Fridge", http://www.wired.com/news/news/email/explode-infobeat/technology/story/%17894.html, 1999 13. L.M. Garshol, "Introduction to XML," http://www.stud.ifi.uio.no/lmariusg/download/xml/xml_eng.html 14. L. Gerstner, "Pervasive Computing" , Keynote -CeBIT 98, http://195.27.241.3/news/news1/ns-3975.html 15. M. Hardwick, D.L. Spooner, T. Rando, K.C. Morris, "Data Protocols for the Industrial Virtual Enterprise," IEEE Internet Computing, vol. 1, no. 1, pp. 20-29, Jan-Feb. 1997 16. A.C. Huang, B. Ling, S. Ponnekanti, and A. Fox. "Pervasive Computing: What Is It Good For?" Workshop on Mobile Data Management (MobiDE) in conjunction with ACM MobiCom 99 17. IBM, "What is Pervasive Computing", http://www-3.ibm.com/pvc/pervasive.html 18. R. Itschner, C. Pommerell, M. Rutishausser, "Glass: Remote Monitoring of Embedded Systems in Power Engineering," IEEE Internet Computing, vol. 2, no. 3, pp. 46-52, MayJune. 1998 19. S. Mann, "Wearable Computing: A First Step Toward Personal Imaging", IEEE Computer, 30 (2), Feb. 1997 20. S. Mann, "Humanistic Computing: WearComp as a New Framework and Application for Intelligent Signal Processing," Proc. IEEE, Vol. 86, No. 11, pp. 2123-2151, Nov. 1998 21. NCR Corp., "NCR Microwave Oven / Home Banking," http://www.wired.com/news/news/technology/story/14949.html 22. D.A. Norman, The Invisible Computer: Why Good Products Can Fail, the Personal Computer Is so Complex, and Information Appliances Are the Solution, The MIT Press, 1999. 23. C.M. Pancerella, N.M. Berry, "Adding Intelligent Agents to Existing EI Frameworks ," IEEE Internet Computing, vol. 3, no. 5,pp. 60-61, Sept-Oct. 1999 24. R.W. Picard, "Human-Computer Coupling," Proc. IEEE, Vol. 86, No. 8, pp. 1803-1807, Aug. 1998 25. B. Rhodes, "Context-Aware Computing (or, why context needs wearables and wearables need context)," http://wearables.www.media.mit.edu/projects/wearables/context.html 26. World Wide Web Consortium (W3C), "Extensible Markup Language (XML) 1.0," http://www.w3.org/TR/REC-xml

24

EMBEDDED SYSTEM :DEEPAK MATHUR T%tor&al: Des&."&". real,t&#e a"d sa et$,(r&t&(al e#!edded Nava appl&(at&o"s , Part 2 So t Real,T&#e Nava Develop#e"t :%&del&"es

B$ Kelv&" E&lse"* Ao"&1 E#!edded/(o# )F6<23<F6* 12:55:FF PM EDT+ As de &"ed &" t'e Real T&#e Spe(& &(at&o" or Nava )RTSN+* so t real t&#e des(r&!es s$ste#s &" 6'&(' a" a(t&o" per or#ed at t'e 6ro". t&#e )e&t'er too earl$ or too late+ 'as so#e pos&t&ve val%e eve" t'o%.' &t 6o%ld 'ave 'ad .reater val%e & per or#ed at t'e proper t&#e/ T'e d& ere"(e !et6ee" 'ard real,t&#e a"d so t real,t&#e does "ot depe"d o" t'e t&#e ra".es spe(& &ed or deadl&"es or per&od&( tas-s/ =or e1a#ple* a so t real,t&#e s$ste# #&.'t 'ave a deadl&"e o 1FF Os* 6'&le a 'ard real,t&#e s$ste# #a$ 'ave a deadl&"e o 3 se(o"ds/ To 'elp developers 6'o 6&s' to avo&d t'e %se o trad&t&o"al Nava@s a%to#at&( .ar!a.e (olle(t&o" a"d &"stead %se t'e s(oped #e#or$ a!stra(t&o"s &"trod%(ed !$ t'e Real T&#e Spe(& &(at&o" or Nava )RTSN+* t'e Dpe" :ro%p@s Real,T&#e a"d E#!edded =or%# &s develop&". a set o .%&del&"es !ased o" #a-&". e e(t&ve %se o t'e trad&t&o"al sta"dard ed&t&o" Nava &" (o#!&"at&o" 6&t' appropr&ate pro &les o t'e Real,T&#e Spe(& &(at&o" or Nava/ =ollo6&". are te" !as&( r%les or e e(t&ve so t real,t&#e Nava develop#e"t:

25

EMBEDDED SYSTEM :DEEPAK MATHUR Rule () *se the +a'a Standard Edition platform T'e !e"e &ts t'at Nava !r&".s to so t real,t&#e #&ss&o",(r&t&(al s$ste#s are #ost releva"t to lar.e* (o#ple1* d$"a#&( appl&(at&o"s/ S&"(e t'e N2ME plat or# represe"ts a" &"(o#pat&!le s%!set o %ll NSE* &t does "ot prov&de a((ess to NSE,sta"dard 9DTS l&!rar$ (o#po"e"ts/ A appl&(at&o"s reC%&re e"terpr&se ed&t&o" (apa!&l&t&es* o!ta&" t'e spe(& &( e"terpr&se ed&t&o" l&!rar&es t'at are reC%&red a"d r%" t'e# o" a so t real,t&#e NSE plat or#/ Alter"at&vel$* r%" t'e reC%&red e"terpr&se ed&t&o" %"(t&o"al&t$ o" trad&t&o"al )"o" real,t&#e+ N5M plat or#s 6'&(' (o##%"&(ate 6&t' t'e so t real,t&#e N5M #a('&"es %s&". RMA or ot'er "et6or-&". proto(ols/ Rule ,) $aseline a particular 'ersion of the +SE libraries =or a"$ .&ve" develop#e"t proBe(t* &t &s &#porta"t to sta"dard&7e o" a part&(%lar vers&o" o t'e NSE l&!rar&es/ As Sta"dard Ed&t&o" Nava 'as evolved* ea(' "e6 release adds "e6 (apa!&l&t&es a"d e1pa"ds #e#or$ ootpr&"t reC%&re#e"ts/ Ea(' "e6 release also depre(ates )or re#oves+ (erta&" (apa!&l&t&es 6'&(' are repla(ed 6&t' "e6er sol%t&o"s/ A $o% are 6or-&". o" a lar.e proBe(t or 6'&(' so t6are #a&"te"a"(e #%st spa" #a"$ $ears* $o% pro!a!l$ 6a"t to sele(t a (erta&" Sta"dard Ed&t&o" plat or# a"d ree7e t'at ('o&(e/ Dt'er6&se* $o% 6&ll e"d %p #a-&". #a"$ %""e(essar$ ('a".es to $o%r (ode !ase B%st to #a&"ta&" (o#pat&!&l&t$ 6&t' t'e ever ('a".&". de &"&t&o" o t'e Nava plat or#/ Do(%#e"t t'&s de(&s&o" to all developers a"d #a"a.ers/ Rule -) .ollow /best practices/ recommendations for +a'a de'elopment T'e so t6are C%al&t$ #eas%res are ver$ s&#&lar or so t real, t&#e Nava a"d trad&t&o"al Nava/ U"less spe(& &ed to t'e (o"trar$* ollo6 t'e a((epted .%&del&"es or 6r&t&". porta!le a"d #a&"ta&"a!le NSE (ode/ 26

EMBEDDED SYSTEM :DEEPAK MATHUR Rule 0) *se +.ace and S1" for graphical user interfaces Most #&ss&o",(r&t&(al so t6are does "ot reC%&re .rap'&(al %ser &"ter a(es/ A so t real,t&#e s$ste#s do reC%&re .rap'&(al %ser &"ter a(es* %se t'e ope",so%r(e S8T a"d N=a(e l&!rar&es &"stead o t'e propr&etar$ A8T a"d S6&". (o#po"e"ts/ S8T a"d N=a(e r%" &" less #e#or$ a"d r%" aster t'a" S8T a"d S6&"./ Rule 2) *se cooperating hard real-time components to interface with nati'e code T'e NEA proto(ol &"trod%(es s&."& &(a"t data #ars'all&". over'ead 6'e" o!Be(ts are s'ared !et6ee" t'e Nava a"d "at&ve e"v&ro"#e"t/ =%rt'er#ore* t'e s'ar&". proto(ols #a$ e1pose Nava o!Be(ts a"d Ipr&vateI v&rt%al #a('&"e data str%(t%res to %"d&s(&pl&"ed 9 (o#po"e"ts* &"trod%(&". t'e r&s- t'at #&s!e'av&". 9 (ode 6&ll (o#pro#&se t'e &"te.r&t$ o t'e v&rt%al #a('&"e e"v&ro"#e"t/ E1per&e"(e o e1&st&". (%sto#ers &" several real proBe(ts &"volv&". '%"dreds o #a" $ears o develop#e"t do(%#e"t t'at t'ese r&s-s are real* 'av&". (ost develop#e"t tea#s s&."& &(a"t e ort a"d (ale"dar t&#e to (orre(t errors &"trod%(ed &"to t'e Nava e"v&ro"#e"t !$ 9 developers 6r&t&". NEA (o#po"e"ts/ Better per or#a"(e a"d stro".er separat&o" o (o"(er"s &s real&7ed !$ &#ple#e"t&". all &"ter a(es to "at&ve (ode as (ooperat&". 'ard real,t&#e (o#po"e"ts as de &"ed !$ t'e 'ard real,t&#e RTSN pro &le/ Rule 3) *se cooperating hard real-time components with performance-critical code A t'e t'ro%.'p%t o (erta&" so t real,t&#e (o#po"e"ts &s "ot s% &(&e"t to #eet per or#a"(e reC%&re#e"ts* &#ple#e"t t'e reC%&red %"(t&o"al&t$ as (ooperat&". 'ard real,t&#e (o#po"e"ts as de &"ed !$ t'e 'ard real,t&#e RTSN pro &le/ Be(a%se t'e (ode .e"erat&o" #odel or 'ard real,t&#e 23

EMBEDDED SYSTEM :DEEPAK MATHUR (o#po"e"ts does "ot "eed to (oord&"ate 6&t' .ar!a.e (olle(t&o"* t'ese (o#po"e"ts .e"erall$ r%" t6o to t'ree t&#es aster t'a" so t real,t&#e Nava (o#po"e"ts/ Rule 4) *se cooperating hard real-time components to interact with hardware de'ices A t'e so t real,t&#e (o#po"e"t "eeds to (o##%"&(ate d&re(tl$ 6&t' 'ard6are dev&(es 6'&(' are "ot represe"ted !$ operat&". s$ste# dev&(e dr&vers* &#ple#e"t t'e dev&(e dr&ver as a (ooperat&". 'ard real,t&#e (o#po"e"t as de &"ed !$ t'e 'ard real,t&#e RTSN pro &le/ A t'e operat&". s$ste# prov&des a dev&(e dr&ver t'at represe"ts t'&s dev&(e as a &le* %se t'e sta"dard Bava/&o or Bava/"&o l&!rar&es to a((ess t'e dev&(e/ A t'e operat&". s$ste# prov&des a dev&(e dr&ver 6&t' a d& ere"t APA t'a" t'e &le s$ste#* %se a (ooperat&". 'ard real,t&#e (o#po"e"t to &#ple#e"t t'e &"ter a(e to t'e dev&(e dr&ver/ Rule 5) Restrict the use of /ad'anced libraries/ 9erta&" sta"dard Nava l&!rar&es are "ot ava&la!le &" (erta&" e#!edded e"v&ro"#e"ts !e(a%se t'e %"derl$&". operat&". s$ste# or 'ard6are &s #&ss&". des&red (apa!&l&t&es/ A#o". t'e l&!rar&es t'at #a$ "ot !e ava&la!le o" all plat or#s* l&sted &" de(reas&". order o porta!&l&t$ (o"(er"* are: JFace and SWT libraries: T'ese .rap'&(al l&!rar&es are o"l$ ava&la!le o" s$ste#s t'at 'ave .rap'&(al 'ard6are a"d t'e S8T &"te.rat&o" so t6are reC%&red to dr&ve t'e .rap'&(al 'ard6are/ java.nio libraries: Ma"$ e#!edded operat&". s$ste#s do "ot s%pport as$"('ro"o%s A<D/

2?

EMBEDDED SYSTEM :DEEPAK MATHUR java.io libraries: So#e e#!edded tar.ets 'ave "o "ot&o" o std&"* stdo%t* or stderr/ So#e e#!edded tar.ets 'ave "o "ot&o" o "o",volat&le &le stora.e/ java.net libraries: So#e e#!edded tar.ets 'ave "o "et6or(o""e(t&v&t$/ Re(o."&7e t'at t'e %se o t'ese l&!rar&es #a$ l&#&t t'e porta!&l&t$ o (ode a"d #a$ (o"tr&!%te to t'e %t%re #a&"te"a"(e !%rde"/ Rule 6) #solate +7M dependencies E1&st&". so t real,t&#e v&rt%al #a('&"es d& er &" 'o6 t'e$ s%pport (erta&" &#porta"t #&ss&o",(r&t&(al (apa!&l&t&es/ 8rap all N5M depe"de"(&es &" spe(&al (lasses t'at (a" !e .&ve" e1tra atte"t&o" & t'e (ode #%st !e ported to a d& ere"t N5M/ Spe(& &( serv&(es t'at reC%&re t'&s 'a"dl&". &"(l%de: A8 H&.',pre(&s&o" t&#&". serv&(es: o!ta&"&". real,t&#e 6&t' .reater pre(&s&o" t'a" 1 #sP dr& t, ree sleep)+* 6a&t)+* a"d Bo&")+ serv&(es/ $8 9PU,t&#e a((o%"t&".: Ho6 #%(' 9PU t&#e (o"s%#ed !$ ea(' t'readQ Ho6 #%(' 9PU t&#e &s (o"s%#ed at ea(' pr&or&t$ levelQ &8 :ar!a.e (olle(t&o" pa(&".: Ho6 to #o"&tor t'e #e#or$ allo(at&o" !e'av&or o t'e appl&(at&o" so t6are a"d t'e e e(t&ve"ess o :9Q Ho6 to s('ed%le :9 to #a&"ta&" pa(e 6&t' allo(at&o" ratesQ D8 S('ed%l&".: A a v&rt%al #a('&"e o ers '&.',level s('ed%l&". s%pport* s%(' as earl&est,deadl&"e &rst or #a1&#%#

2K

EMBEDDED SYSTEM :DEEPAK MATHUR a((r%ed %t&l&t$ s('ed%l&".* t'e s('ed%l&". a"d s$"('ro"&7at&o" serv&(es s'o%ld !e &solated 6&t'&" a (e"tral&7ed APA/ Rule (9) &arefully select an appropriate soft real-time 'irtual machine D"e o t'e #ost &#porta"t de(&s&o"s &" deter#&"&". t'e s%((ess o a so t real,t&#e Nava develop#e"t e ort &s sele(t&o" o a s%&ta!le N5M/ Ea(' develop#e"t proBe(t 'as %"&C%e reC%&re#e"ts a"d (o"stra&"ts* so &t #a$ !e "e(essar$ to &"depe"de"tl$ eval%ate t'e releva"(e o var&o%s ava&la!le v&rt%al #a('&"e prod%(ts or ea(' develop#e"t e ort/ A" sele(t&". a v&rt%al #a('&"e* (o"s&der at #&"&#%# ea(' o t'e ollo6&". &ss%es: A8 Real,T&#e .ar!a.e (olle(t&o" s'o%ld 'ave a #a1&#%# pree#pt&o" late"($ a"d s'o%ld !e &"(re#e"tal so t'at 6'e" t'e .ar!a.e (olle(tor &s pree#pted !$ '&.'er pr&or&t$ appl&(at&o" t'reads* &t (a" res%#e 6&t' t'e "e1t &"(re#e"t o 6or- 6'e" t'e appl&(at&o" t'read rel&"C%&s'es t'e 9PU/ $8 T'e .ar!a.e (olle(tor s'o%ld de ra.#e"t t'e 'eap &" order to ass%re rel&a!le lo".,r%""&". operat&o" or s'o%ld prov&de so#e alter"at&ve #e('a"&s# to avo&d rel&a!&l&t$ pro!le#s res%lt&". ro# ra.#e"tat&o" o t'e 'eap/ A"d &t #%st a((%ratel$ re(la&# all dead #e#or$ rat'er t'a" re(la&#&". o"l$ a (o"servat&ve appro1&#at&o" o t'e dead #e#or$/ =&"all$* &t #%st !e pa(ed to ass%re t'at #e#or$ &s re(la&#ed at rates (o"s&ste"t 6&t' t'e appl&(at&o"@s stead$,state de#a"d or "e6 #e#or$ allo(at&o"/ &8 All s$"('ro"&7at&o" lo(-s #%st &#ple#e"t pr&or&t$ &"'er&ta"(e/ All 6a&t C%e%es #%st !e ordered a((ord&". to t'read pr&or&t&es/

3F

EMBEDDED SYSTEM :DEEPAK MATHUR D8 T'e v&rt%al #a('&"e "eeds to prov&de #o"&tor&". a(&l&t&es to allo6 s%perv&sor$ t'reads to o!serve a"d #eas%re t'e real, t&#e reso%r(e reC%&re#e"ts o &"d&v&d%al (o#po"e"ts/ A#o". reC%&red (apa!&l&t&es are t'e a!&l&t$ to deter#&"e 'o6 #%(' 9PU t&#e &s (o"s%#ed !$ part&(%lar t'reads* 'o6 #%(' 9PU t&#e &s (o"s%#ed !$ t'e .ar!a.e (olle(t&o" t'read)s+* t'e rates at 6'&(' part&(%lar t'reads are allo(at&". #e#or$* a"d t'e total a#o%"t o #e#or$ !e&". reta&"ed as l&ve/ E8 Deter#&"e t'e release level o t'e N2SE l&!rar&es reC%&red or a part&(%lar proBe(t a"d ass%re t'at t'e ve"dor &s a!le to s%pport t'e des&red l&!rar$ vers&o" t'ro%.'o%t t'e d%rat&o" o $o%r develop#e"t proBe(t/ .8 Ass%re t'at t'e v&rt%al #a('&"e prov&des l&!rar&es or '&.', pre(&s&o" t&#e #eas%re#e"ts* a"d or dr& t, ree 6a&t)+* Bo&")+* a"d sleep)+ serv&(es/ G8 Ass%re t'at t'e v&rt%al #a('&"e &s s%pported !$ appropr&ate A'ead,o ,T&#e (o#p&lat&o" a"d l&"-&". tools & t'e s$ste# &s stat&(all$ (o#p&led a"d loaded/ :8 A t'e s$ste# #%st d$"a#&(all$ load (o#po"e"ts* ass%re t'at t'e d$"a#&( (lass loader (a" !e (o" &.%red to r%" at lo6er pr&or&t$ t'a" t'e o".o&". real,t&#e appl&(at&o" 6or-load/ #8 A t'e d$"a#&( (lass loader #%st per or# NAT (o#p&lat&o"* ass%re t'at t'e NAT (o#p&ler (a" !e (o" &.%red to s%pport ea.er l&"-&". a"d tra"slat&o"* #ea"&". t'at all (o#po"e"ts are %ll$ resolved a"d tra"slated 6'e" t'e &rst o t'e &"terdepe"de"t #od%les &s loaded* rat'er t'a" de err&". NAT tra"slat&o" %"t&l t'e #o#e"t ea(' (ode #od%le &s &rst e1e(%ted/ So#e s$ste#s "eed to d$"a#&(all$ load (o#po"e"ts 6'&(' 6ere t'e#selves a'ead,o ,t&#e (o#p&led/ 5er& $ t'&s 31

EMBEDDED SYSTEM :DEEPAK MATHUR (apa!&l&t$ &s s%pported & releva"t to $o%r proBe(t reC%&re#e"ts/ +8 Ass%re t'at t'e v&rt%al #a('&"e &"(l%des "e(essar$ develop#e"t tools* &"(l%d&". s$#!ol&( de!%..&". o !ot' &"terpreted a"d (o#p&led (ode a"d r%",t&#e per or#a"(e a"d #e#or$ %sa.e pro &l&"./ ;8 Ass%re t'at t'e v&rt%al #a('&"e &"(l%des s%pport or (ooperat&". 'ard real,t&#e Nava (o#po"e"ts & t'e pla""ed develop#e"t proBe(t #a$ reC%&re &"te.rat&o" 6&t' (ooperat&". 'ard real,t&#e (o#po"e"ts/

Embedded Java
by Vincent Perrier 08/15/2001 Java's strong appeal for embedded applications is sometimes offset by concerns about its speed and its memory requirements !o"ever# t$ere are tec$niques t$at you can use to boost Java performance and reduce memory needs# and of course t$e Java virtual mac$ine you c$oose affects Java performance# too %ou can ma&e better'informed decisions about using Java by understanding t$e factors t$at affect its performance and selecting meaningful benc$mar&s for embedded applications

(ec$niques for improving application e)ecution and c$oosing t$e rig$t Java virtual mac$ine *JV+, address only a fe" aspects of system arc$itecture t$at affect overall Java performance -$en selecting an embedded Java platform# you must ta&e into account a $ost of ot$er factors# beyond t$e scope of t$is article# t$at $ave an impact on performance .mong t$em are $ard"are processor selection# Java compatibility and supported .P/s# application reliability and scalability# t$e c$oice of a real'time operating system *0(12, "it$ associated native libraries and drivers# t$e availability of Java development tool &its and middle"are# grap$ics support# and t$e ability to put t$e application code into 01+

1nce you've selected a $ard"are and soft"are development platform# t$ere are a variety of factors to consider t$at "ill $elp you c$oose t$e best'performing Java virtual mac$ine *JV+, for your application

Java Is Big and Slow: Myth or Reality?


.lt$oug$ t$e average Java bytecode application e)ecutes about ten times more slo"ly t$an t$e same program "ritten in 3 or 344# $o" "ell an application is "ritten in Java can $ave a tremendous impact on performance# as a study by 5ut6 Prec$elt# 73omparing Java vs 3/344 8fficiency 9ifferences to /nterpersonal 9ifferences7 *3ommunications of t$e .3+# 1ctober 1:::,# $as s$o"n /n t$e study# ;8 programmers "ere as&ed to "rite t$e same application program in eit$er 3/344 or Java .pplying statistical analysis to t$e performance data for t$e programs revealed t$at actual performance differences depended more on t$e "ay t$e programs "ere "ritten t$an on t$e language used /ndeed#

32

EMBEDDED SYSTEM :DEEPAK MATHUR


t$e study s$o"ed t$at a "ell'"ritten Java program could equal or e)ceed t$e efficiency of an average'quality 3/344 program

Various approac$es are available for boosting bytecode e)ecution speed ($ey include using a <ust'in'time *J/(, compiler# an a$ead'of'time compiler# or a dynamic adaptive compiler= putting t$e Java application code into 01+ *701+i6ing7 it,= re"riting t$e JV+'s bytecode interpretation loop in assembly language= and using a Java $ard"are accelerator

Consider Compilers

%ou can impliment grap$ics above t$e $ard"are level "it$ Java's $eavy "eig$t grap$ical tool &it *left, or t$e lig$t"eig$t version *rig$t, ($e lig$t"eig$t version runs faster and $as a smaller memory footprint# but "riting an implementaion is $arder and slo"er

J/( compilers# "$ic$ compile bytecode on t$e fly during e)ecution# generally aren't suitable for embedded applications# t$oug$ ($ey produce e)cellent performance improvements in des&top Java applications but typically require 1> to ;2 +? of 0.+ in addition to t$e application's requirements ($e large memory requirement places J/( compilers out of reac$ for many categories of embedded applications

.$ead'of'time compilers rival J/( compilers in increasing Java e)ecution speed @nli&e J/( compilers# t$ey're used before t$e application is loaded onto t$e target device# as t$eir name indicates ($at eliminates t$e need for e)tra 0.+# but it creates t$e need for more 01+ or flas$ memory *t$at is# storage static memory,# because compiled mac$ine code requires four to five times t$e memory of Java bytecode 3ompiling a$ead of time tends to undermine one of t$e great benefits of t$e Java platform because a measure of dynamic e)tensibility can be lost# since it may not be possible to do"nload ne" versions of compiled classes .dditionally# any dynamically loaded code# li&e an applet# "on't benefit from a$ead'of'time compilation and "ill e)ecute more slo"ly t$an resident compiled code

Profiling Java code# alt$oug$ some"$at comple)# can $elp minimi6e code e)pansion "$en you're using an a$ead'of' time compiler . good goal is to compile only t$at 20 percent of t$e Java classes in "$ic$ t$e application spends 80 percent or more of its time

9ynamic adaptive compilers offer a good compromise bet"een J/( and a$ead'of'time compilers *see (able 1, ($ey're similar to J/( compilers in t$at t$ey translate bytecode into mac$ine code on t$e fly 9ynamic adaptive compilers# $o"ever# perform statistical analysis on t$e application code to determine "$ere t$e code merits compiling and "$ere it's better to let t$e JV+ interpret t$e bytecode ($e memory used by t$is type of compiler is user'configurable# so you can evaluate t$e trade'off bet"een memory and speed and decide $o" muc$ memory to allocate to t$e compiler

33

EMBEDDED SYSTEM :DEEPAK MATHUR

Placing t$e bytecode into 01+ can contribute to faster application performance /t doesn't ma&e t$e code run faster /t does# $o"ever# translate t$e code into a format t$at t$e JV+ can e)ecute directly from 01+# causing t$e code to load faster by eliminating class loading and code verification# tas&s normally performed by t$e JV+

.not$er "ay to speed up bytecode e)ecution "it$out using a$ead'of'time or dynamic compilation tec$niques is to re"rite t$e bytecode interpreter in t$e JV+ ?ecause t$e interpreter is a large 3 program# you can ma&e it run faster by re"riting it in assembly language

Java $ard"are accelerators# or Java c$ips# are t$e ultimate option for speeding up code e)ecution ($ey're emerging in t"o fundamental configurations 3$ips of t$e first type# suc$ as 3$icory 2ystems' !ot2$ot and Aa6omi 3ommunications' J2(.0# operate as Java coprocessors in con<unction "it$ a general'purpose microprocessor# in muc$ t$e same "ay t$at grap$ics accelerators are used Java c$ips in t$e ot$er category# li&e Patriot 2cientific's P231000 and aJile's aJ'100# replace t$e general'purpose 3P@

3learly# t$e latter are limited to applications t$at can be "ritten entirely in Java .s for t$e first type# adding components of course raises costs# so t$is type offers a viable option only "$en t$e cost is acceptable /ndeed# t$e price of Java c$ips $as been $ig$ because of relatively lo" production volumes . $ig$'volume solution# $o"ever# may be fort$coming in t$e form of t$e .0+:B0 general processor "it$ an integrated Java accelerator# called Ja6elle

Memory Requirements
($e Prec$elt study determined t$at t$e average memory requirement of a program "ritten in Java is t"o to t$ree times greater t$an for one "ritten in 3/344 8ven t$e compact nature of bytecode# usually about 50 percent smaller t$an compiled 3/344 mac$ine code# can't offset t$at over$ead 0ecogni6ing t$at trying to drop Java in its original# des&top'oriented form into embedded systems "on't "or&# 2un +icrosystems# Java's originator# too& t$e language t$roug$ several evolutionary steps in an effort to tailor it to t$e embedded environment (oday# t$e Java 2 Platform# +icro 8dition *J2+8,# represents t$e latest# most evolved# and slimmest version of Java for t$e embedded space

34

EMBEDDED SYSTEM :DEEPAK MATHUR


%ou can trim J2+8 by eliminating classes and code components t$at aren't needed for your application ($e JV+# native libraries# core classes# and application bytecode go into 01+ JV+s for embedded applications generally run under 500 &?# "$ereas class libraries for J2+8 typically don't e)ceed 1 5 +? Java components t$at affect 0.+ requirements include t$e JV+ *for bytecode e)ecution,# t$e potential dynamic compiler# t$e Java $eap# and t$e number of t$reads *t$e latter t"o obviously depend on t$e application, 8)ecuting as muc$ of t$e application as possible using an interpreter '' "$ile maintaining acceptable e)ecution performance '' $elps contain t$e memory footprint

2electing a $ig$ly scalable operating system and 3 run'time pac&age allo"s you to tune t$ese soft"are components for optimal memory efficiency 2caling 2$are some of t$e tec$niques t$at you use in designing embedded Java t$e Java environment can be comple)# $o"ever systems Post your omments @sually# a t"o'stage process is involved Cirst# you can use t$e command line verbose option# <ava 'v# to see t$e classes an application uses and t$en manually e)tract t$e needed libraries and classes /f t$is process doesn't save sufficient space# you can use filtering tools# li&e JavaCilter from 2un's 8mbeddedJava platform

/f you're using Java# you s$ould e)pect to increase memory and 3P@ resources compared "it$ using 3/344 *see (able 2,

Choosing the Right Java Platform


1f course# your c$oice of JV+ is one &ey to optimi6ing Java performance for your application 1bviously# you need a JV+ designed for embedded applications

8mbedded JV+s are $ig$ly user'configurable to matc$ different embedded system requirements# but "$ic$ embedded JV+ s$ould you useD Java benc$mar&s are meant to $elp you evaluate JV+s and Java performance# but you need to be careful about "$ic$ ones you use and about t$e conclusions you dra" from t$em . good benc$mar& score for a particular JV+ doesn't necessarily mean t$at using it "ill ma&e your application go faster

3onsequently# before evaluating a JV+# you $ave to evaluate any benc$mar& to determine $o" meaningful it may be to your application# ta&ing into account t$e "$ole Java environment t$at's associated "it$ it 2ome benc$mar&s are very application'specific *a c$at server benc$mar& li&e Volano+ar&# for instance, and may not apply to t$e &ind of Java applications you're developing .dditionally# because JV+ vendors commonly optimi6e t$eir products to ac$ieve good benc$mar& scores# t$e scores can be misleading about $o" muc$ a given JV+ "ill improve t$e performance of your particular application 3onversely# if your application $as specific problems in certain areas# an environment t$at's optimi6ed to improve general processing "on't solve t$ose specific processing problems

35

EMBEDDED SYSTEM :DEEPAK MATHUR

Measuring !ppli ation Performan e


-$en considering a benc$mar& to determine t$e overall performance of a Java application# bear in mind t$at bytecode e)ecution# native code e)ecution# and grap$ics eac$ play a role ($eir impact varies depending on t$e nature of t$e specific applicationE "$at t$e application does# $o" muc$ of it is bytecode versus native code# and $o" muc$ use it ma&es of grap$ics !o" "ell a JV+ "ill perform for a given application depends on $o" t$e unique mi) of t$ese t$ree functional areas maps onto its capabilities Fiven t$ese variables# t$e best "ay to benc$mar& a JV+ is against your o"n application 2ince t$at's not possible before t$e application $as been "ritten# you must find t$ose benc$mar&s t$at are most relevant to t$e application you intend to "rite

2orting t$roug$ Java benc$mar&s to find t$e ones t$at are relevant for embedded applications can be confusing 2pecJV+:8# for e)ample# provides a relatively complete set of benc$mar&s t$at test diverse aspects of t$e JV+ 2ounds good '' but 2pec'JV+':8 runs in a client/server environment and requires a minimum of B8 +? of 0.+ on t$e client side for t$e JV+ ($at e)cludes it from any relevance to most embedded applications /n addition# it can't be used "it$ precompiled classes

1t$er benc$mar&s $ave different pitfalls Volano+ar&# for e)ample# is a c$at server implementation and is t$erefore relevant only for benc$mar&ing applications "it$ t$e same set of requirements as c$at servers ($e J+ar& benc$mar& assumes t$at t$e application includes t$e applet vie"er and a full implementation of Java's .bstract -indo"ing (ool&it *.-(, ($is benc$mar& can be irrelevant for t$e many embedded applications t$at $ave no grap$ics or $ave limited grap$ics t$at don't require full .-( support# suc$ as devices running a PersonalJava minimal'.-( implementation

8mbedded 3affeine+ar& *83+,# t$e embedded version of t$e 3affeine+ar& benc$mar& from Pendragon 2oft"are *it $as no grap$ics tests,# is easy to run on any embedded JV+# since it requires support for basic Java core classes only# and it doesn't require a large amount of memory +ore importantly# t$ere's a $ig$ correlation bet"een good scores on t$is benc$mar& and improved bytecode performance in embedded applications

(o get t$e most meaningful results from 83+# you must use e)actly t$e same $ard"are "$en testing different JV+s %ou must also pay attention to implementation differences among t$e JV+s you're testing /f# for e)ample# you're comparing a JV+ "it$ a J/( compiler against a JV+ "it$out one# it's important to run t$e JV+ t$at $as t$e J/( "it$ t$e <ava

-nojit option on t$e command line to ensure an apples'to'apples comparison

83+ "ill typically ma&e any JV+ using compilation loo& good# no matter t$e type of compilation# because it includes a very small set of classes and al"ays repeats t$e same small set of instructions 9ynamic compilers <ust cac$e t$e complete translation of t$e Java code in 0.+ and e)ecute ne)t iterations of t$e tests in native code .$ead'of'time compilers can easily optimi6e t$e loops and algorit$ms used in 83+# too

.lt$oug$ t$e industry abounds "it$ ot$er Java benc$mar&s# li&e Java Frande# 2ci+ar&# <?%(8mar&# 9$rystone benc$mar& in Java# and @329 ?enc$mar&s for Java# t$ere is no 7ultimate7 benc$mar& t$at can give you certainty about Java and JV+ performance in embedded applications ($e best strategy is to identify a suite of benc$mar&s t$at seem most relevant to your application and use t$e combined results of t$ose benc$mar&s to $elp predict Java performance in a particular system environment

Curt$ermore# t$e e)isting benc$mar&s may not measure ot$er aspects of your application code (uning Java applications to meet performance goals may require addressing many program functions besides bytecode e)ecution 2ome of t$ose functions '' for e)ample# t$read management# sync$roni6ation# met$od'to'met$od calls# class resolution# ob<ect allocation and $eap management *including garbage collection,# calls to native met$ods# bytecode verification# and e)ception $andling '' occur "it$in t$e JV+ ?ecause fe" if any benc$mar&s address suc$ functions# it falls to you to conduct an in'dept$ study of a JV+'s internals to understand $o" its design may affect crucial aspects of your application -riting special programs t$at e)ercise critical aspects of a JV+ can $elp you evaluate it for t$e application /f# for e)ample# your application uses a $eavy mi) of Java and 3 code# you can benefit by "riting a program t$at tests native met$od call performance 1t$er functions# including native code e)ecution and suc$ factors as net"or& latency# may occur outside t$e JV+

"raphi s Performan e
-$at if your application includes grap$icsD (o start# t$ere are t"o ma<or factors t$at affect grap$ics performance in Java applicationsE 9oes t$e application's grap$ics display driver use grap$ics coprocessor $ard"are accelerationD /s t$e application configured "it$ a lig$t"eig$t *faster, or a $eavy"eig$t *slo"er, implementation of t$e .bstract -indo"ing (ool&itD *2ee t$e figure , /n addition# li&e any ot$er $ig$'level Java service# grap$ics performance is affected by t$e "ay t$at t$e grap$ics services integrate "it$ lo"er'level native libraries

36

EMBEDDED SYSTEM :DEEPAK MATHUR


-ind 0iver's Personal J-or&s includes a good benc$mar& for evaluating grap$ics performance in embedded systems ($e benc$mar& targets t$e PersonalJava .-( "it$ a set of ;: tests of images# buttons# scrolling# te)t# and basic 2'9 grap$ics

Real#$orld Performan e
Cinally# you need to consider t$e performance of your 3P@ (o $elp you identify 3P@'bound performance# you s$ould supplement simple benc$mar&s by running real'"orld applications t$at e)ercise large amounts of different# comple) Java code 2uc$ test code must meet a number of requirementsE /t s$ould contain a large number of classes t$at reflect an estimate of t$e real application *20'plus is a good ballpar&, /t must also be large *t$ousands of lines# at least, and $ave no file system access and no grap$ics 2ome e)isting programs meet all t$ose criteria ($e FA@ regular e)pression pac&age# rege)p# for e)ample# comprises about ;#000 lines of code and more t$an 21 classes# providing a large number of e)pressions to parse and matc$ .not$er program# t$e ?ean 2$ell interpreter# is a simple prime number sieve t$at $as G0 classes and several t$ousand lines of code Java3ode3ompact# 2un's PersonalJava 01+i6ing tool# also "ould ma&e a good test program

($e result of running t$ese programs as test cases illustrates t$e "ide variance in t$e meaning of benc$mar& scores Cor e)ample# a JV+ using a J/( compiler may run 8mbedded 3affeine+ar& up to ;0 times faster t$an "$en t$e no<it option is turned on *t$us running in pure interpretation mode,# but t$e same JV+ runs t$e ?ean 2$ell and rege)p tests only about one and a $alf times faster "$en using t$e J/( compiler *($e apparently impressive t$irtyfold speedup on a simple benc$mar& li&e 8mbedded 3affeine+ar& is ac$ieved t$roug$ cac$ing tec$niques t$at t$e compiler uses on t$e small amount of code and classes in 83+ , ($e difference in results clearly demonstrates t$at $ig$ benc$mar& scores may not translate into a commensurate level of performance improvement in real'"orld applications

.ctually# 2pecJV+:8 and J+ar& yield results t$at most closely appro)imate t$ose for real'"orld applications ($ey do suffer# t$oug$# from t$e limitations discussed above /n particular# t$e usefulness of t$e former in t$e embedded space depends greatly on your ability to overcome t$e problems associated "it$ your test infrastructure requirements

33

Das könnte Ihnen auch gefallen