Vous êtes sur la page 1sur 35

Embedded Software Development with

eCos Real Time Operating System

Introduction to eCos world


Engineers from Cygnus Solutions in 1989 developed small set
of tools which they were selling out in the markets the tool was
GNUPro.
GNUPro Developers Kit.
GCC
the highly optimized ANSI-C compiler.
G++

ANSI-tracking C++ compiler.


GDB

source- and assembly-level debugger.


GAS
GNU assembler.
LD
GNU linker.
Cygwin

UNIX environment for Windows.


Insight

a graphical user interface (GUI) for GDB.


Source-Navigator
source code comprehension tool.

Introduction to eCos world


Initial design discussions for eCos began in the spring of 1997.
The primary goal was to bring a cost-effective, high-quality
embedded software solution to the marketplace.
This new development would also complement the existing
GNUPro tools, thereby expanding Cygnus product.
By working with different semiconductor companies, Cygnus
was able to architect a real-time operating system (RTOS) that
abstracted the hardware layer and was highly configurable.
This enabled the RTOS to fit into many diverse embedded
systems.

Introduction to eCos world


By using the open-source model, eCos was available with no
initial costs.
It could be downloaded and test driven free of charge.
Developers have full access to the entire software source code,
including the tools, which can be modified as necessary.
Numerous companies are using eCos, and many successful
products have been launched running eCos, including the
Brother HL-2400 CeN network color laser printer, Delphi
Communiport, and the Iomega Hip Zip Digital Audio Player.

Configurability
The eCos architecture, is build with the component framework
that makes up the eCos system.
The eCos component framework has been designed to control
components to minimize memory use, allow users to control
timing behavior to meet real-time requirements, and use usual
programming languages (e.g., C, C++, and assembly language.
eCos can be scaled from a few hundred bytes up to hundreds of
kilobytes when features such as networking stacks are included
and third-party contributions such as Web servers are used.
Developers are able to select components that satisfy basic
application needs, and configure that particular component for
the specific implementation requirements for the application.

Configurability
eCos offers the developer options such as the ability to
select the number of priority levels and whether time slicing
is used.
Any code unnecessary to meeting the developers
requirements is eliminated in the final image of the
application.
The eCos framework encourages the users to extend the
features and functionality of the core eCos components.

eCos Core Components


Certain standard functionality is expected in a real-time
embedded operating system, including interrupt handling,
exception and fault handling, thread synchronization,
scheduling, timers, and device drivers.
eCos delivers these standard components with the real-time
kernel as the central core.
The core components are:
Hardware Abstraction Layer (HAL) Providing a
software layer that gives general access to the hardware.
Kernel Including interrupt and exception handling,
thread and synchronization support, a choice of scheduler
implementations, timers, counters, and alarms.

eCos Core Components


ISO C and math libraries Standard compatibility with
function calls.
Device drivers Including standard serial, Ethernet,
Flash ROM, and others.
GNU debugger (GDB) support provides target
software for communicating with a GDB host enabling
application debugging.

A minimal test infrastructure is included with eCos.


The Configuration Tool provides the facilities for administering
the tests.

Processor & Platform Support


eCos supports a wide variety of popular embedded processor
architectures.
This makes eCos a great choice for companies using many diverse
hardware architectures on different product lines.
Once the eCos HAL has been ported to a new architecture, the
application layer can be moved over to support the new application
requirements.
The main processor architectures supported include:
ARM
Fujitsu FR-V
Hitachi H8/300

Processor & Platform Support


Intel x86
Matsushita AM3x
MIPS
NEC V8xx
PowerPC
Samsung CalmRISC16/32
SPARC
SPARClite
SuperH

Architecture overview
eCos is designed as a configurable component architecture
consisting of several key software components such as the
kernel and the HAL.
The fundamental goal is to allow construction of a complete
embedded system from these reusable software components.
This allows you to select different configuration options within
the software component, or remove unused components
altogether, in order to create a system that specifically matches
the requirements of your application.
By creating an eCos image that closely matches your system
requirements, the size of the software is compact, only
including used components.

Building Blocks &


Components
These are components which are layered together to incorporate the
functionality needed for a specific application.
Component Framework
The collection of tools that allow users to configure the
eCos system and manage different packages in the
repository is called the component framework.
Included in the component framework are the commandline configuration tool, the graphical Configuration Tool,
the Memory Layout Tool, and the Package Administration
Tool.

Embedded Software System showing Layering


of eCos Packages

Embedded Software System showing Layering


of eCos Packages

Embedded Software System showing Layering of eCos Packages.


A configuration contains the packages that have been
selected, as well as the status of options within the package
describing whether the option is enabled, disabled, or set to
a particular value.
shows a portion of the eCos Kernel package from the
Configuration Tool.
The figure shows how the building blocks are encapsulated
within each other to create a complete and independent
package.

Configuration Control Block that Compose a


Package

Configuration Control Block that Compose a


Package
We can see the hierarchy of the configuration from
packages to components to configuration options to sub
options.
we see the eCos Kernel package, which contains the Kernel
Exception Handling component and the Kernel Schedulers
component.
The nesting of configuration options, such as Scheduler
Timeslicing, and sub options that compose the
components.

eCos Components
HAL
The first component in the eCos system architecture is the hardware
abstraction layer, which can be broken down into three sub-modules.
The first HAL sub-module defines the architecture:
Each processor family supported by eCos is said to be a different
architecture.
Each architecture sub-module contains the code necessary for CPU
startup, interrupt delivery, context switching, etc for architecture of that
processor family.

eCos Components
Second HAL sub-module defines the variant:
A variant is a specific processor within a processor family.
An example of an eCos feature at this level is support for an on-chip
peripheral like a memory management unit (MMU).

Third HAL sub-module defines the platform:


The platform includes the code for startup, chip select configuration,
interrupt controllers, and timer devices.

eCos Components
The eCos kernel consists of a scheduler and mechanisms for thread
synchronization, exception handling, interrupt handling, and timers.
Scheduler:
The scheduler is the heart of the kernel and contains two modes of
operation: bitmap and multi-level queue scheduling.
Only one scheduler can be supported at a time.
The bitmap scheduler represents each thread, which must have a unique
priority, with a bit in a bitmap.
The multi-level queue implements a number of thread priorities, where
threads of the same priority can be time sliced.

eCos Components
Thread synchronization:
It is accomplished through the use of mutexes and semaphores.
These can be combined with event flags and message queues for thread
communication.
Exception handlers:
These are are routines for handling machine exceptions raised by
hardware and software.
Interrupt handlers:
These process events caused by external devices.
eCos provides a generalized scheme of utilizing an interrupt service
routine (ISR) and a deferred service routine to maintain low interrupt
latency.

eCos Components
Timer:
Timer-related elements of the kernel include counters,
clocks, and alarms.
Drivers
The driver component provides different means for I/O, including
simple serial ports and Ethernet devices.
Typical drivers included for specific platforms are Ethernet, flash,
PCMCIA, and serial.
Development tools
The GNU development tools provide the build and debug capabilities
and binary utilities support.

eCos Components
Third-party support:
Along with the core functionality, additional features are
available that greatly extend the capabilities of eCos for different
applications.
POSIX 1003.1-EL/IX compatibility.
uITRON 3.0 compatibility.
RedBoot ROM monitor.
File system.
Networking.
Web server.
PCI library.
USB slave support.

POSIX 1003.1 El/IX Support


Let us look at how EL/IX, a standards-based application programming
interface (API) implementation based on Posix, solves this problem.

POSIX 1003.1 El/IX Support


The EL/IX are dedicated to the development and standardization of Linux
for embedded devices.
EL/IX is an application programming interface (API) based on the Linux
API allowing embedded applications to be ported easily and quickly
between any EL/IX compliant operating systems.
The goal of EL/IX is, first and foremost, to standardize the APIs available
in desktop Linux today in such a way that embedded system developers
have a clear and consistent idea of what functionality they can expect for a
given embedded target

POSIX 1003.1 El/IX Support


The El/IX standard is designed to bring some order into application programming
interface for the open-source Linux operating system
The initiative hopes to provide flexibility and freedom while eliminating the
tendency towards fragmentation in the design of software.
ITRON3.0-specification kernel
Task management
Direct manipulation and referencing of task status.
Task-dependent synchronization
Task synchronization function in the task itself.
Synchronization and communication
Three synchronization and communication functions
independent of tasks, namely, semaphore, event flag and mailbox functions

ITRON3.0-specification kernel
Extended synchronization and communication
Two advanced task-independent synchronization and
communication functions, namely, message buffer and rendezvous.

Interrupt management
Function for defining a handler for external interrupts.
Function for disabling and enabling external interrupts.
Memory pool management
Functions for software management of memory pools and
memory block allocation.
Time management
Functions for system clock setting and reference.
Task delay function.
Timer handler functions, for time-triggered starting.

ITRON3.0-specification kernel
System management
Functions for setting and referencing the system environment as
a whole.
Network support
Management and support functions for a loosely coupled
network
Rom Monitor:
A ROM monitor is a program, typically residing in
ROM or flash memory, which provides debug functionality.
The ROM monitor is used to load an application
program into memory for debugging.

Redboot Rom Monitor


RedBoot is an acronym for Red Hat Embedded Debug and
Bootstrap.
RedBoot is an eCos-based application and uses the eCos
Hardware Abstraction Layer for its foundation.
RedBoot can be used for debug support during the product
development cycle or in a released product to provide flash
and network booting.

What is Bootstrap
The bootstrap is a short program loaded by the BIOS upon system startup.
The BIOS has no information about the environment required by the
operating system and therefore can do nothing to initialize the system
This is where the bootstrap program comes into play
Operating system specific bootstraps either load the operating system itself
or load a more advanced initialization program.
It is the bootstraps responsibility to load an appropriate operating
environment.

File System
eCos provides three different file system implementations:
ROM, RAM, and JFFS2.
Both the ROM and RAM file system use the POSIX File I/O
Compatibility Layer
The Journalling Flash File System version 2 (JFFS2) is a logstructured file system intended for embedded systems
containing flash memory devices.

Networking support
Internet connectivity for embedded devices is quickly
becoming a standard requirement.
From Internet Appliances to remote sensor controllers, the
ability to send and receive data over the Internet, is
becoming standard.
The core to this connectivity is the network stack.
This diagram shows a general architecture diagram of the
some of the protocols supported by the eCos Networking
package.

Networking Support

PCI Library
The eCos PCI library package contains a main source file pci.c
ahigh-level PCI library API functions.
The high-level API routines are used by applications to control
the devices on the PCI bus.
USB Support
The current version of the USB specification is 2.0. USB
supports four different types of communication.
Control Transfers: All devices must respond to certain
standard control messages.
Interrupt Transfers: limited-latency transfer to or from a
device.
Isochronous Transfers: intended for multimedia devices
with large amounts of data that is continuously exchanged.

USB support
Bulk Transfers: Typically consists of larger amounts of data.

Embedded Web Server:


The latest trend is to use Web protocols, such as Hypertext
Transfer Protocol (HTTP), Hypertext Markup Language (HTML), and
Java, for remote device management, also called Web-based
management.
This is accomplished through the use of an embedded Web server
running on the device.
A devices data can be used to generate dynamic content that is
represented in a Web page.

Embedded Web Server


These pages are accessed by any standard
browser and become the graphical interface to the device.
Devices become more user friendly when they
can be controlled using a common interface, such as the
browser.
Companies currently using the GoAhead Web
Server in products include Hewlett-Packard, Honeywell,
Siemens, and Canon.

Vous aimerez peut-être aussi