T-106.5840 Seminar on Embedded Systems eCos - An Embedded Configurable Operating System Shilei He Department of computer science and engineering Aalto University shilei.he@aalto.fi December 4th, 2014 Overview ❏ ❏ ❏ ❏ ❏ ❏ Introduction Background Layout and Components Configuration Systems Configuration tools Comparison between eCos and other OS Introduction ● eCos is a real-time operating system intended for embedded applications. ● Open source, royalty-free ● Single process, multiple thread operating environment ● Single linked ELF binary image ● Highly configurable nature ● eCosCentric sells a closed , industrial strength “eCosPro” Background ● Initially developed by Cygnus Solutions on 1997. ● Primary goal was to bring a cost-effective, high-quality embedded software solution to the marketplace ● Later bought by Red Hat in November 1999. ● In January 2004, Red Hat agreed to transfer its eCos copyrights to the Free Software Foundation and finally implemented in May 2008, changed name to eCosCentric. Layout of eCos Example embedded software system showing layering of eCos packages Source: Anthony J. Massa , “Embedded Software Development with eCos” . 2002-11-25 eCos Core Components ● ● ● ● ● Hardware Abstraction Layer (HAL) Real-time Kernel ISO C and math libraries Device drivers GNU debugger (GDB) support Hardware Abstraction Layer (HAL) •The HAL is a software layer. •It provides a platform independent API for platform specific functionality. •Enhances portability of code. Real-time kernel ● The Kernel is the core component of eCos system. ● Supports standard functionality: - interrupt and exception handling scheduling thread synchronization timers device drivers memory management C and math libraries Configuration system ● It is the key innovation technology of eCos. ● Select only the packages that are necessary through configuration. ● Component architecture: standard eCos release, commercial third party developers and open source contributors ● Advantages of configuration system: o o o o customizable to precise application requirements minimize the resource footprint / memory use reduce time to market for embedded products reduce costs Configuration system (cont’d) Software components control: ● At run time o code size to be much larger ● At link time ( selective linking) o unreferenced functions and data are removed o But, only entire functions can be removed—an all-or-nothing approach ● Compile-time control/ source-level configuration o configure at earliest stage o best results in terms of code size o applications are faster - not at run time o the code is tailored for the application, creating an application-specific RTOS o reduce costs Configuration system (cont’d) ● eCos uses compile-time control methods for its software components, along with selective linking provided by the GNU linker. ● This allows the application writer control over individual lines of code in the packages. ● The control methods are implemented through C Preprocessor Configuration tools ● eCos uses Component Definition Language (CDL) to describe the configuration of the system. ● Each system should have at least one CDL script file ● Two configurators: o Configtool: GUI based o ecosconfig: command line based Configuration tools (cont’d) #ifdef INCLUDE_FUNCTIONALITY ... #else ... #endif Source-level configuration Configtool Source: Invoking the eCos Configuration Tool, Web source: http://ecos.sourceware.org/docs-latest/user-guide/ config-tool-invoking.html Comparison Comparison between eCos and Realtime Linux, MicroC/OS-II on memory requirement, context switch and interrupt latency Minimum memory requirement eCos (Bytes) RTLinux (Bytes) MicroC/OS-II (Bytes) 10K 4M 2K Table 1: Minimum memory requirement Source: 1. Amir Hossein Payberah, “Embedded OS Benchmarking” 2. Fei Li, “Comparison of several open-source realtime operating system”, October 2013. Context Switch (us) Interrupt Latency (us) Testing environment eCos 15.84 19.2 MPC860A3 (33MHz) RTLinux Idle system 33.1 13.5 PowerPC 604 (300MHz) RTLinux Loaded system 193.9 196.8 PowerPC 604 (300MHz) MicroC/OS-II 29.7~34.2 78.8 Intel80186 (33MHz) Table 2: Kernel performance comparison Conclusion ● eCos is a free open source real-time operating system intended for embedded applications. ● High configurability ● eCos uses compile-time control methods. ● Feature and Advantage o customizable to precise application requirements o minimize the resource footprint / memory use Question? Reference ● ● ● ● ● ● ● ● ● ● ● Red Hat, “Red Hat to contribute copyrights held in the eCos code based to the Free Software Foundation”, in Press. 2004-01-13. “The GNUPro Toolkit”, 2007, Red Hat, Inc. Retrieved 2014-11-25 Jonathan Larmour, “Smaller, faster, open source, free: the eCos RTOS”, 2006 eCos website, Web source: http://ecos.sourceware.org/, accessed on 2014-11-15. Pentek, Inc, Real-Time Embedded Configurable Operating System, Retrieved 2014-11-25 “eCosCentric annouces eCosPro Developer’s Kit ”(Press release). OSNews. 2003-09-02. Retrieved 2014-11-25 Anthony J. Massa , “Embedded Software Development with eCos” . 2002-11-25 Invoking the eCos Configuration Tool, Web source: http://ecos.sourceware.org/docs-latest/user-guide/config-tool-invoking.html, accessed on 2014-11-16 Arnaud Hubaux , Yingfei Xiong, Krzysztof Czarnecki, “A User Survey of Configuration Challenges in Linux and eCos”, 2012 Fei Li, “Comparison of several open-source real-time operating system”, October 2013. Amir Hossein Payberah, “Embedded OS Benchmarking”, Retrieved 2014-11-25