A highly configurable - eCos

Shilei He Department of computer science and engineering Aalto University Helsinki, Finland [email protected]

Abstract— This paper introduces an embedded maintainer of eCos and laid off the developing team. configurable operating system – eCos. It describes the Nevertheless, some of the laid off employees continued the background and functionality of eCos; and it gives a deep work of eCos and made their business by providing services discussion of its configuration method, which is the key for eCos. According to the request from eCos development innovation technology and making eCos distinguish from other community, agreed to transfer the ownership and operating systems. Moreover, it compares the memory maintenance of eCos to Foundation [6]. With requirement and kernel performance between eCos and the feature of open sourse, eCos had to be royalty-free, in traditional operating systems. other words, eCos was abled to be developed with no initial cost which reduced the costs for embedded products [3]. Keywords—eCos; Real Time Operating Systems; Open Source Software; High configurable RTOS

III. ECOS ARCHITECTURE I. INTRODUCTION eCos (embedded configurable operating system) [4] is an With the development of science and technology, open source real-time operating system intended for embedded operating systems are widely used in many fields, embedded applications, and it is supported by the GNU open source development tools. eCos made the innovation on its such as military, industry and electric equipment. This paper highly configurable system, which allows the developers to introduces an embedded configurable operating system – create customized applications with precise requirements. eCos. It describes the background, functionality and the configuration method of eCos. The key innovation A. eCos Core Functionality technology of eCos is its high configurable architecture. eCos supports the standard functionality of real-time This paper discusses the implementation of the eCos embedded operating systems, including interrupt handling, configuration method and provides a view on the exception and fault handling, thread synchronization, configuration tools of eCos. Finally, It compares the scheduling, timers, device drivers, memory management and memory requirement and kernel performance between eCos C, math libraries. Moreover, eCos provides the tools to and traditional operating systems develop embedded products, such as eCos software configuration and build tools. The core functionalities [5] are: II. BACKGROUND • Hardware Abstraction Layer (HAL) eCos originated from Cygnus Solutions, which was founded by , David Henkel-Wallace, and • Real-time kernel John Gilmore in 1989 [1]. The primary goal of Cygnus Solutions was to provide the support and development of • µITRON 3.0 compatible API open source software. Based on this business model, this • POSIX compatible API three-person team developed the GNUPro Developers Kit, which is well known in the world [2]. In 1997, Cygnus • ISO C and math libraries Solutions intended to launch a cost-effective, high-quality • Serial, ethernet, SPI, I2C, framebuffer, CAN, ADC, embedded software solution to the market, and this is the wallclock and watchdog device drivers initial prototype of eCos. • USB slave support eCos was designed to be a real-time operating system that abstracted the hardware layer and has highly • TCP/IP networking stacks configurable nature. Due to this feature, eCos was able to be implemented into a wide range of embedded uses and it • C++ Standard Template Library (uSTL) reduced developing time for embedded products. • GDB debug support Cygnus Solutions was bought by Red Hat in November 1999. In 2002, Red Hat suspended serving as the role of B. Supported Hardware based configurator; another one is ecosconfig – a command eCos is powerful and supports a variety of embedded line based configurator. architectures. As the kernel, libraries and runtime components of eCos are implemented on the hardware abstraction layer (HAL), once the HAL has been ported to a new architecture, the applications can be run on any target architectures. At present, eCos supports 13 architectures: 68K/ColdFire, ARM (including ARM7TDMI, ARM9TDMI, Cortex-M, StrongARM, XScale), CalmRISC16 and CalmRISC32 (RedBoot only), Fujitsu FR-V, Fujitsu FR30, Hitachi H8/300, Intel x86, Matsushita AM3x, MIPS, NEC V8xx, PowerPC, SPARC, SuperH [6].

IV. CONFIGURATION METHOD Embedded Systems should be smaller and faster. However, most of the embedded software provides more components than what might need for the application. For example, for a simple “Helo Word” program, it is not necessary to provide scheduler, timers or thread synchronization functions, which are generally included in most RTOSes. Based on this purpose, eCos has been Figure 1: Configuration tool - configtool [8] designed to a highly configurable operating systems. Developers are allowed to determine the necessary eCos supports two types of the configuration. First, it can components and configure the systems using eCos enable or disable the entire components or software packages configuration tools. according to the needs of the application. This high level Since eCos is an open source software with highly control determines whether to include the relevant files of configurable nature, it allows developers to include the the component in the build or not. It also implements the component architecture from not only standard eCos release, effect from the source level configuration control to the CDL but also commercial third party developers and open source script file. Second, it has control on the hardware. contributors [7]. Developers select a hardware target and eCos can provide the particular package, which supports the device. In A. High Configurability addition, eCos provide the templates of he configuration as a Controlling the behavior of software components is starting point and it gives the initial configuration of both important for an embedded product. One of the control software components and hardware target. methods is to control the components at run time. All components are linked and ready to be used. When receiving a request, load the component and start the application. V. COMPARISON However, this method make the code size to be much larger as it include all the components. Another method is to There are many traditional operating systems, which are control at the link time, or called selective linking. The well known and widely used by people, such as Linux. necessary components are linked at linking time and make Those operating systems are usually containing all the the code size small. However, it has limitations that only the components, including scheduler, file IO and thread whole function can be added or deleted. Nevertheless, there synchronization. Configuration of the traditional operating is a solution - compile-time control, or called source-level systems is difficult and unnecessary for most users [12]. configuration. It makes the configuration at the beginning Apart from the traditional Operating System, eCos can and offer the control of the smallest unit. This method is customize the application and control the footprint of the implemented by using #ifdef and #endif in the source code, code as it has the high configurability. As we can see from the enabled functionality will be included at the compile Table 1, the minimum memory requirement for Real Time time. Source-level configuration provides the best solution Linux operating system is 4M bytes while the requirement for the smallest code size that makes the embedded systems for eCos is 10K bytes. faster and a decrease the cost of product development. eCos RTLinux MicroC/OS- B. Configuration tools (Bytes) (Bytes) II (Bytes) eCos uses Component Definition Language (CDL) to Minimum 10K 4M 2K describe the configuration of the system [9]. Each system memory should have at least one CDL script file. There are two requirement configurators that can be used to help the configuration process. One is a configtool (shown in Figure 1) – a GUI- Table 1: Minimum memory requirement [10]

[2] “The GNUPro Toolkit”, 2007, Red Hat, Inc. Retrieved Context Interrupt Testing 2014-11-25 Switch Latency environment (us) (us) [3] Jonathan Larmour, “Smaller, faster, open source, free: eCos 15.84 19.2 MPC860A3 the eCos RTOS”, 2006 (33MHz) [4] eCos website, Web source: http://ecos.sourceware.org/, RTLinux 33.1 13.5 PowerPC 604 accessed on 2014-11-15. Idle system (300MHz) [5] Pentek, Inc, Real-Time Embedded Configurable RTLinux 193.9 196.8 PowerPC 604 Operating System, Retrieved 2014-11-25 Loaded (300MHz) system [6] “eCosCentric annouces eCosPro Developer’s MicroC/OS- 29.7~34.2 78.8 Intel80186 Kit ”(Press release). OSNews. 2003-09-02. Retrieved II (33MHz) 2014-11-25

[7] Anthony J. Massa , “Embedded Software Development Table 2: Kernel performance comparison [10 - 11] with eCos” . 2002-11-25

According to Table 2, we can see eCos has an excellent [8] Invoking the eCos Configuration Tool, Web source: performance. It just needs 15.84 us for the context switch http://ecos.sourceware.org/docs-latest/user- guide/config-tool-invoking.html, accessed on 2014-11- and it has a 19.2 us interrupt latency. However, for the 16 RTLinux, the context switch time is 33.1 at idle time and

193.9 at loaded time, the interrupt latency for the loaded system is about 200 us which is much longer than eCos. In [9] Arnaud Hubaux , Yingfei Xiong, Krzysztof Czarnecki, addition, although the minimum memory requirement for “A User Survey of Configuration Challenges in Linux and MicroC/OS-II is just 2K bytes, it still needs 29.7~34.2 us for eCos”, 2012 context switch and 78.8 us for the interrupt latency which is [10] Fei Li, “Comparison of several open-source real-time longer than eCos. operating system”, October 2013.

[11]Amir Hossein Payberah, “Embedded OS VI. CONCLUSION Benchmarking”, Retrieved 2014-11-25 Based on the discussion, we can draw the conclusion that eCos is a highly configurable operating system. Developers can customize the applications by enable or disable the [12] Port to Atmel ARM9 Microcontroller SAM9G4, Web functions, which can be implemented at source level. This resource: http://ecos.sourceware.org/ml/ecos-devel/2010- ability also makes sure the minimum footprint of the 03/msg00000.html, Retrieved 2014-11-26 applications that the embedded applications could be smaller and faster. Moreover, eCos is powerful as it provides the standard functionality of real-time embedded operating systems and it supports a variety of embedded architectures. Currently, eCos is fast growing and continues to expand its market in embedded marketplace and also focuses on the latest technologies. There are many registered projects, which are based on eCos, such as AT91SAM9G45 processor and .MX 6 processor [12]. The Russian satellite also uses eCos-based control system. In addition, eCos make contributions to its commercial version – eCosPro. eCosPro integrates USB Device stack and support the eclipse juno. With the continue contribution of developers, eCos could become more popular in the near future, thus users will enjoy more excellent products provided by eCos.

REFERENCES

[1] Red Hat, “Red Hat to contribute copyrights held in the eCos code based to the Free Software Foundation”, in Press. 2004-01-13.