Title: Embedded Configurable Operating System
1Embedded Configurable Operating System
- Andreas Savvides Alireza Hodjat
- asavvide, ahodjat_at_ee.ucla.edu
- EE202a
- Fall 2001
2Why RTOS?
- Interactive embedded systems require real time
scheduling - Some legacy OS can provide some of this
functionality BUT they are too big to run on an
embedded systems
3Desirable Real-Time Kernel Features
- Multitasking
- Priority-based preemptive scheduling
- Inter-task synchronization and communication
- Semaphores, mailboxes, event-flags ...
- Basic memory management
- Interrupt handling
- Timer handling, time management
- Implementable on small deeply embedded systems
4Linux in Post-PC Computing
Client Platforms
Server Platforms
CommsInfrastructure
Thin Clients
DeeplyEmbedded
PC
Cellphones
STB
HH
OA
Pager
- Hard Real-time required
- Very small footprint required
(slide from EL/IX website)
5What is eCos?
- eCos Embedded Configurable Operating System
- Based on configurable components
- Kernel size from 32MB down to 32KB or less
- Supports ISO C and math library
- Implements the µITRON standard for embedded
systems - EL/IX standard support
- OS neutral API based on POSIX
- Designed to avoid fragmentation
6EL/IX Spans the Spectrum
GNU
Client Platforms
Server Platforms
CommsInfrastructure
Thin Clients
DeeplyEmbedded
PC
Cellphones
STB
HH
OA
Pager
(slide from EL/IX website)
7µITRON 4.0 Spec Supports
- Task management
- Task-depended synchronization
- Task exception management
- Basic synchronization and communication
- (semaphore, eventflag, data queue, mailbox)
- Extended Synchronization and Communication
- (mutex, message buffer, rendevous)
- Memory pool management
- Time management
- (cyclic handler, alarm handler, overrun handler)
- System state management
- Interrupt management
- Service call management
- System configuration management
8eCos Features
- Common software infrastructure for a diverse
range of embedded products - Highly configurable
- More than 200 configuration points
- Application specific
- Multiple implementation of kernel functions
including scheduling, allocating memory and
interrupt handling - Open source code
- Provides APIs for developers to write their own
kernel modules and plug them in eCos
configuration model
9Supported Hardware
- Ported to Playstation 2 and Dreamcast
- Will be supported in 2.5G/3.5G mobile multimedia
devices (see 3G labs page) - Fujitsu SPARClite MB8683x series
- Intel StrongARM Families
- 1110 (e.g in iPAQ PDA), XScale, ARM7, ARM9
- NEC UR4300
- PowerPC MPC8xx
- Toshiba TX39 architecture
- Device driver support for
- Flash, ethernet, serial, USB ( preliminary
TCP/IP stack) - http//sourceware.cygnus.com/ecos/hardware.html
10Configuration Tool
- Tailors eCos at source level, prior to
compilation or assembly, and provides a
configuration file and a set of files to build
appl.
11eCos configuration Architecture
- Component Repository
- Contains the sources used for building a
configuration - A set of files defining the structure of
relationships between the configuration tool and
other components - Written in Component Definition Language (CDL)
- Describes the constraints between the components
and configuration options - Packages
- They are the building blocks of an eCos
configuration - A set of core packages is provided by Red Hat
- kernel, C library, math library
- Additional packets can be provided by developers
- The eCos administration tool adds or removes
packages from component repository - The eCos configuration tool includes or excludes
packages from the configuration being built
12eCos Configuration Result
- Coherence is maintained with a set of consistency
rules - i.e ensures you have timer support if you are
using timeouts - Any illegal configuration will produce a conflict
- Templates
- Saved configuration (.ecc) includes a set of
packages and configuration item setting - Contains the infrastructure, kernel, C and math
libraries plus their support packages in eCos
configuration Architecture eCos
13The ISO standard C and Math libraries
- Compatibility with the ISO 98991990
specification - eCos C library package
- C library that implements the functions defined
by the ISO standard, except for the mathematical
functions - Math library
- Implements mathematical functions from the ISO C
libraray (math.h) - C library startup procedure
- Sets up the environment in which applications run
when they use the standard C library - main() entry point function
- exit() function that does the clean up required
by the standard
14Kernel Internals
- Scheduler options
- Bitmap scheduler
- Multi-level scheduler
- Experimental lottery scheduler (under
development) - Three level interrupt handling
- ISR Invoked in response to a hardware interrupt
- DSR Invoked in response to a request by an ISR
- Threads Are clients to the driver
15Kernel Internals (cont.)
- Exception handling is configurable
- Thread synchronization
- Available thread synchronization primitives
- Semaphores, Mutex, Condition variables, Flags,
Message Box - Provides simple mutex priority inheritance
- Now only works with multi-level queue scheduler
- Does not handle nested mutexes correctly
- Can be disabled if the application doesnt
require it
16Hardware Abstraction Layer
- Architecture HAL
- Abstracts the basic CPU and includes interrupt
delivery, context switching , CPU startup and
etc. - Platform HAL
- Abstracts the properties of the current platform
and includes startup, timer devised, I/O register
access and interrupt controllers - Implementation HAL
- Abstracts properties that lie between these two,
such as architecture variants and on-chip devices
17eCos Development Process
eCos configuration (enable assertion checking)
Integrity check (run test suites)
YES
Application development
Need config. update?
Target Neutral (simulated or synthetic target)
Target Specific (disable assertion checking)
NO
DONE
18Other Supporting Tools
- Redboot standart bootstrap and debugging
environment for Red Hat - Replaces gdb stubs and CygMon
- Handles the device bootup configuration
- Device attribute configuration(e.g setting IP
address for the device - GDB stubs for host based debugging over serial
port or ethernet - Insight Red Hats graphical front end to GDB
19Performance
- Metrics of interest
- Footprint size (ROM,RAM)
- Time it takes for an operation
- Determinacy of time interval
- How can the time taken be influenced by other
operations in the system? - Such numbers are useful to
- Compare different RTOSs
- Estimating cost of implementing things in eCos
- Observe how kernel tuning affects performance
20Some Performance Numbers
(time given in microseconds)
Task ARM7TDMI 20MHz ARM7TDMI 20MHz ARM7TDMI 20MHz Intel Xscale 600MHz Intel Xscale 600MHz Intel Xscale 600MHz
avg min max avg min max
Create Thread 257.18 168 568 6.53 5.48 8.55
Yield Thread 50.21 49.60 50.40 0.37 0.03 3.24
Suspend 36.26 36.00 36.80 0.24 0.00 2.06
Resume 37.20 36.80 37.60 0.25 0.00 0.73
Set Priority 56.24 56.00 56.80 0.36 0.09 0.82
Clock Int Latency 55.63 54.40 60.80 1.87 1.82 10.42
Clock DSR Latency 101.23 80.80 1433 3.02 2.58 7.67
21Conclusions
- Rich well supported toolset
- Effort to prevent fragmentation
- Configurability
- EL/IX µITRON support
- Will not always work on low end 8-bit MCUs
- Overall pretty good, flexible reconfigurable,
growing community
22References
- M. TiemannEL/IX Unfying APIs for Linux and
Post-PC computing, Available at
http//sources.redhat.com/elix/whitepaper.pdf - µITRON Specification Page, http//www.itron.gr.jp
- Available from http//sources.redhat.com/ecos/
- Getting Stared with eCos
- eCos Users Guide
- eCos Reference Manual
- eCos Component Writers Guide
- eCos EL/IX Compatibility Guide
- OpenBSD TCP/IP Stack Port and SNMP for eCos
- RedBoot User's Guide
- RTOS Buyers guide
- http//www.realtime-info.be/encyc/buyersguide/rtos
/Dir228.html
23References II
- eCos Developer Resources at 3G Lab
- http//www.3glab.org/developer/ecos/
- Describes extensions for multimedia tools, power
management under eCos - eCos discussions archives
- http//sources.redhat.com/ml/ecos-discuss/