Chapter 4 Embedded Systems-sum-w4
Chapter 4 Embedded Systems-sum-w4
1
Agenda
•Embedded Systems
•Characteristics of Embedded Operating Systems
•eCos
•TinyOS
2 2
Embedded System
• Embedded system:
A combination of computer hardware and
software, and perhaps additional mechanical or
other parts, designed to perform a dedicated
function.
4
Examples
5
Examples
6
Embedded System
7
Embedded System
•Relaxed to very strict requirements and
combinations of different quality requirements.
for example, with respect to safety, reliability,
real-time, flexibility, and legislation
• Short to long life times
• Different environmental conditions in terms of,
for example, radiation, vibrations, and
humidity
8
Embedded System
• Different application characteristics resulting in
static versus dynamic loads, slow to fast speed,
compute versus interface intensive tasks, and/or
combinations thereof.
11
In addition to the processor and memory, there
are a number of elements that differ from the
typical desktop or laptop computer.
15
2. Reactive operation:
• Embedded software may execute in response to
external events.
16
3. Configurability:
• Because of the large variety of embedded systems,
there is a large variation in the requirements, both
qualitative and quantitative, for embedded OS
functionality.
17
5. Streamlined protection mechanisms:
• Embedded systems are typically designed for a limited,
well-defined functionality.
• Untested programs are rarely added to the software.
• After the software has been configured and tested, it
can be assumed to be reliable.
• Thus, apart from security measures, embedded systems
have limited protection mechanisms.
6. Direct use of interrupts:
• General-purpose operating systems typically do not
permit any user process to use interrupts directly.
18
19
• There are two general approaches
to developing an embedded OS.
21
Purpose-Built Embedded OS
• Typical characteristics include:
– fast and lightweight process or thread switch
– Scheduling policy is real time and dispatcher module
is part of scheduler
– Small size
– Responds to external interrupts quickly
– Minimizes intervals during which interrupts are
disabled
• To deal with timing constraints, the kernel:
– Provides bounded execution time for primitives
– Maintains a real-time clock
– Provides for special alarms and timeouts
– Supports real-time queuing disciplines
– Provides primitives to delay processing by a fixed
amount of time and to suspend/resume execution
Agenda
•Embedded Systems
•Characteristics of Embedded Operating Systems
•eCos
•TinyOS
24 24
25
eCos:
Embedded Configurable OS
• Open source,
• Real-time OS
• Most widely used embedded OS
• Targeted at high-performance small embedded
systems.
• An embedded form of Linux or other
commercial OS would not provide the
streamlined software required. ________
eCos
Configuration Tool
To met this
requirement, eCos
consists of a layered set
of components
Hardware Abstraction Layer
Deterministic behaviour:
• Throughout all aspect of execution, the kernels
performance must be predictable and bounded to
meet real-time application requirements.
Not in eCos Kernel
• Some functionality that is typically included
in the kernel of an OS is not included in the
eCos kernel.
• E.g. memory allocation is handled by a separate
package.
• Similarly, each device driver is a separate
package.
eCos I/O System
• The eCos I/O system is a framework for
supporting device drivers.
49
The mutex differs from a binary semaphore in two respects.
• the thread that locks the mutex must be the one to unlock it.
•But it is possible for one thread to lock a binary semaphore and
for another to unlock it.
• The other difference is that a mutex provides protection against
priority inversion, whereas a semaphore does not.
50
Mutexes and Condition Variables
A condition variable is used to block a thread
until a particular condition is true.
54
Wireless Sensor Network Topology
TinyOS was developed primarily for use with
networks of small wireless sensors.
63