Chapter 32. itron api, Introduction to itron, Itron and ecos – Comtrol eCos User Manual

Page 473: Μitron api, Introduction to µitron, Μitron and ecos, Chapter 32. µ itron api, Introduction to µ itron

Advertising
background image

Chapter 32.

µ

ITRON API

Introduction to

µ

ITRON

The µITRON specification defines a highly flexible operating system architecture designed specifically for appli-
cation in embedded systems. The specification addresses features which are common to the majority of proces-
sor architectures and deliberately avoids virtualization which would adversely impact real-time performance. The
µITRON specification may be implemented on many hardware platforms and provides significant advantages by
reducing the effort involved in understanding and porting application software to new processor architectures.

Several revisions of the µITRON specification exist. In this release, eCos supports the µITRON version 3.02 speci-
fication, with complete “Standard functionality” (level S), plus many “Extended” (level E) functions. The definitive
reference on µITRON is Dr. Sakamura’s book: µITRON 3.0, An Open and Portable Real-Time Operating System
for Embedded Systems
. The book can be purchased from the IEEE Press, and an ASCII version of the standard can
be found online at http://www.itron.gr.jp/. The old address http://tron.um.u-tokyo.ac.jp/TRON/ITRON/ still exists
as a mirror site.

µ

ITRON and eCos

The eCos kernel implements the functionality used by the µITRON compatibility subsystem. The configuration of
the kernel influences the behavior of µITRON programs.

In particular, the default configuration has time slicing (also known as round-robin scheduling) switched on; this
means that a task can be moved from

RUN

state to

READY

state at any time, in order that one of its peers may

run. This is not strictly conformant to the µITRON specification, which states that timeslicing may be imple-
mented by periodically issuing a

rot_rdq(0)

call from within a periodic task or cyclic handler; otherwise it

is expected that a task runs until it is pre-empted in consequence of synchronization or communication calls it
makes, or the effects of an interrupt or other external event on a higher priority task cause that task to become

READY

. To disable timeslicing functionality in the kernel and µITRON compatibility environment, please dis-

able the

CYGSEM_KERNEL_SCHED_TIMESLICE

configuration option in the kernel package. A description of kernel

scheduling is in

Kernel Overview

.

For another example, the semantics of task queueing when waiting on a synchronization object depend solely on
the way the underlying kernel is configured. As discussed above, the multi-level queue scheduler is the only one
which is µITRON compliant, and it queues waiting tasks in FIFO order. Future releases of that scheduler might
be configurable to support priority ordering of task queues. Other schedulers might be different again: for example
the bitmap scheduler can be used with the µITRON compatibility layer, even though it only allows one task at
each priority and as such is not µITRON compliant, but it supports only priority ordering of task queues. So which
queueing scheme is supported is not really a property of the µITRON compatibility layer; it depends on the kernel.

In this version of the µITRON compatibility layer, the calls to disable and enable scheduling and interrupts
(

dis_dsp()

,

ena_dsp()

,

loc_cpu()

and

unl_cpu()

) call underlying kernel functions; in particular, the

xxx_dsp()

functions lock the scheduler entirely, which prevents dispatching of DSRs; functions implemented by

DSRs include clock counters and alarm timers. Thus time “stops” while dispatching is disabled with

dis_dsp()

.

Like all parts of the eCos system, the detailed semantics of the µITRON layer are dependent on its configuration
and the configuration of other components that it uses. The µITRON configuration options are all defined in the

369

Advertising