240 likes | 519 Views
Embedded Configurable Operating System. Andreas Savvides & Alireza Hodjat {asavvide, ahodjat}@ee.ucla.edu EE202a Fall 2001. Why RTOS?. Interactive embedded systems require real time scheduling
E N D
Embedded Configurable Operating System Andreas Savvides & Alireza Hodjat {asavvide, ahodjat}@ee.ucla.edu EE202a Fall 2001
Why 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
Desirable 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
Linux in Post-PC Computing • Cost driven means custom to specific plat- form • Linux brings a. developers b. open-source c. low-cost • Currently on proprietary OS • Linux is an opportunity to make these open platforms - 3rd party developers • Trend towardsApp-specific servers @ the low-end PC-like (multi-func) Client Platforms Server Platforms CommsInfrastructure Thin Clients DeeplyEmbedded PC • Internet • File Server • Routers • Telecom Cellphones STB HH OA Pager • Hard Real-time required • Very small footprint required (slide from EL/IX website)
What 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
eCos Linux Embedded Linux EL/IX API EL/IX Spans the Spectrum GNU Client Platforms Server Platforms CommsInfrastructure Thin Clients DeeplyEmbedded PC • Internet • File Server • Routers • Telecom Cellphones STB HH OA Pager (slide from EL/IX website)
μ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
Supported 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
Configuration Tool • Tailors eCos at source level, prior to compilation or assembly, and provides a configuration file and a set of files to build appl.
eCos 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
eCos 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
The ISO standard C and Math libraries • Compatibility with the ISO 9899:1990 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
Kernel 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
Kernel 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 doesn’t require it
Hardware 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
eCos 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
Other 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 Hat’s graphical front end to GDB
Performance • 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
Some Performance Numbers *(time given in microseconds)
Conclusions • 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
References • 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 User’s Guide • eCos Reference Manual • eCos Component Writer’s Guide • eCos EL/IX Compatibility Guide • OpenBSD TCP/IP Stack Port and SNMP for eCos • RedBoot User's Guide • RTOS Buyer’s guide: • http://www.realtime-info.be/encyc/buyersguide/rtos/Dir228.html
References 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/