Home > Store

Embedded Software Development with eCos

Register your product to gain access to bonus material or receive a coupon.

Embedded Software Development with eCos


  • Sorry, this book is no longer in print.
Not for Sale


  • Copyright 2003
  • Dimensions: 7" x 9-1/4"
  • Pages: 408
  • Edition: 1st
  • Book
  • ISBN-10: 0-13-035473-2
  • ISBN-13: 978-0-13-035473-0

Embedded Software Development with eCos shows developers and managers the advantages of using eCos -- the Embedded Configurable Operating System from Red Hat - over proprietary or commercial embedded operating systems. As an Open Source solution, eCos provides a low-cost, royalty free option for embedded software development. Anthony Massa shows how eCos, and the eCos development environment, has all of the features and functionality to meet the needs of almost all commercial embedded system requirements. Massa provides an understanding of how to use the open-source licensing and royalty free nature of eCos in order to eliminate high startup and per unit costs associated with many of the proprietary real-time operating systems on the market today. Embedded systems are operating systems that must operate with a very small footprint (usually less than 100KB of space) and must be self-contained. Most companies use either proprietary solutions or expensive commercial solutions. eCos is the first powerful, royalty-free Open Source solution, from Red Hat.



Untitled Document

Download Embedded Software Development with eCos in PDF

Download the source document

Download the figures

CD Contents

Untitled Document

Download the CD-ROM Contents 1 for this title.

Download the CD-ROM Contents 2 for this title.

Sample Content

Online Sample Chapters

An Introduction to the eCos World

Embedded Development: Handling Exceptions and Interrupts in eCos

Table of Contents



1. An Introduction to the eCos World.

Where It All Started-Cygnus Solutions. The Origins of eCos. Architecture Overview. Summary.

2. The Hardware Abstraction Layer.

Overview. Summary.

3. Exceptions and Interrupts.

Exceptions. Interrupts. Summary.

4. Virtual Vectors.

Virtual Vectors. Summary.

5. The Kernel.

The Kernel. Summary.

6. Threads and Synchronization Mechanisms.

Threads. Synchronization Mechanisms. Summary.

7. Other eCos Architecture Components.

Counters, Clocks, Alarms, and Timers. Asserts and Tracing. ISO C and Math Libraries. I/O Control System. Summary.

8. Additional Functionality and Third-Party Contributions.

Compatibility Layers. ROM Monitors. File Systems. PCI Support. USB Support. Networking Support. SNMP Support. The GoAhead Embedded WebServer. Symmetric Multi-Processing Support. Additional Features. Summary.

9. The RedBoot ROM Monitor.

Overview. RedBoot Directory Structure. Installation and Configuration. User Interface and Command Set. Summary.

10. The Host Development Platform.

Overview. Configuring the Windows Host. Summary.

11. The eCos Toolset.

Packages. The Configuration Tool. Other eCos Tools. Building the eCos Tools. Additional Open-Source Tools. Summary.

12. An Example Application Using eCos.

The eCos Build Process. Examples Overview. RedBoot. ECos. Application. The eCos Tests. Simulators. Summary.

13. Porting eCos.

Overview of Porting. A Platform Porting Example. Summary.

Appendix A. Supported Processors and Evaluation Platforms.

Appendix B. eCos License.

eCos License. GNU General Public License.

Appendix C. Cygwin Tools Upgrade Procedure.

Appendix D. Building the GNU Cross-Development Tools.

About the Author.




Whether you're working on an existing project or moving on to a new development, eventually you're going to have to decide on what Real-Time Operating System (RTOS) to use. Numerous questions arise, including how much does it cost to get started, are there royalties associated with using the RTOS, what is the quality of the tools, is source code available, what features are available for the RTOS, and so on. In most situations, the lowest-cost solution in both upfront costs and royalties is the best solution, as long as it works. Eliminating royalties is very important for high-volume products, where every nickel counts.

There are also concerns of previous investments made, both in developer knowledge and financially, for the current solution. Anxiety can occur when considering moving existing code to a new software platform, which can be intimidating depending on the size of the project. Porting a new RTOS to your hardware platform can create more trepidation.

Decisions about whether to develop your own RTOS or use an off-the-shelf solution surface in some cases as well; especially when specific functionality is needed for a specialized hardware platform. In some cases, rolling your own RTOS might be the only solution. However, you can put your development way ahead by leveraging software that is already implemented, tested on numerous platforms and in various situations, and, most importantly, proven because it is successfully running on other shipping products. This eliminates the need for implementing functionality that is readily available.

This book focuses on one solution to these concerns: the Embedded Configurable Operating System (eCos). The open-source and royalty-free nature of eCos allows it to be downloaded, set up, and used, and here's the key: at no cost. When finished with this book, you will have a complete embedded software development environment—all the tools necessary to tackle any project.

Since eCos is open source, you, the developer, are in complete control over your embedded software destiny. Even the tools described in the eCos development system are open source, thereby allowing you to become completely self sufficient—although the eCos development community is out there available to lend help when needed.

Book Layout and Overview

Let's take a look at the layout of the book and get an overview of what is covered and where it is located. This enables you to focus on the specific aspects of eCos that you need to understand.

The layout of the book is intended to build on information covered in earlier chapters. We start with understanding the key components within eCos, then move to additional functionality offered in the system, and finally, get down to using eCos and the development environment.

For developers new to the eCos world, or embedded software altogether, it is helpful to understand the components that make up the eCos system by starting at the beginning. This gives the baseline understanding of the different features provided by eCos. You can then implement these software components in an actual system.

More experienced developers looking for an evaluation of eCos can skip to the later chapters and begin experimenting right away. The format of the development platform installation and examples allow a quick setup of the tools and immediate results. This lets you answer the question, "will eCos work for me?"

Current eCos users can fill in any holes that might be present in their eCos knowledge, by looking at some of the eCos concepts from a different point of view.

Chapter 1, An Introduction to the eCos World, begins with a brief introduction to eCos, which includes a background about the eCos open-source project and the company behind its start. A description of the eCos terminology is detailed as well. This terminology is used throughout the book and in the eCos development community. The beginning of the book is intended to provide developers who are unfamiliar with eCos a means to become acquainted with the eCos open-source project.

Next, we discuss the key components within the eCos system, presenting a closer look under the hood of these major software modules. The key component chapters offer an understanding about how the different software modules work independently and together to provide functionality required by the system.

Chapter 2, The Hardware Abstraction Layer, focuses on the software closest to the hardware that enables higher-level software modules to be unaware of the low-level functioning of the hardware.

In Chapter 3, Exceptions and Interrupts, we detail exceptions and interrupts and show how they are set up and handled in the eCos system. We discuss virtual vectors in Chapter 4, Virtual Vectors, which provide a means to share services between ROM and RAM applications.

The heart of the eCos RTOS, the kernel, is the focus in Chapter 5, The Kernel. The kernel supplies the scheduling functionality and the synchronization mechanisms for the software. Moving on to Chapter 6, Threads and Synchronization Mechanisms, we discuss the basic unit of execution in eCos, the thread, and provide a detailed look at the various synchronization mechanisms supported by eCos.

Chapter 7, Other eCos Architecture Components, continues with our look at the different eCos components by focusing on timing components, asserts and tracing functionality, and the I/O control system.

Chapter 8, Additional Functionality and Third-Party Contributions, includes a broader look at some of the additional features available for eCos developed by the eCos project maintainers and third-party contributors. These include networking support, ROM monitors, file systems, PCI support, USB support, and the GoAhead WebServer.

In Chapter 9, The RedBoot ROM Monitor, we focus on the RedBoot ROM monitor. This standalone program is designed for embedded systems to provide a debugging and bootstrap environment. RedBoot is an eCos-based application and uses the eCos Hardware Abstraction Layer (HAL) for its foundation.

We begin our hands-on experience in Chapter 10, The Host Development Platform, with the installation of the host development tools. We discuss the Cygwin native tools, the GNU cross-development tools, and the eCos development kit. We also cover the installation of a Concurrent Versions System (CVS) client, WinCVS, to enable access to the online eCos source code repository. This gives you the ability to take advantage of any bug fixes or extended functionality contributed to the eCos source code.

In Chapter 11, The eCos Toolset, we delve into the eCos toolset with a detailed look at how the tools operate on the eCos source code, and the layout of the tools. Also included are some other open-source tools to round out and complete our open-source embedded development system. This prepares us for the next step, putting the tools to work to build our application.

Chapter 12, An Example Application Using eCos, lets you put your knowledge to work. The chapter starts with an overview of the eCos build process, followed by a build of the RedBoot ROM monitor. We then do a build of the eCos real-time operating system, and, finally, put it all together by building an application. This chapter provides a baseline on which you can then add additional components to assemble a system to meet your embedded software requirements.

Finally, Chapter 13, Porting eCos, closes with a look at porting eCos onto another hardware platform. This is key to getting your application running on your new target hardware platform, which is typically the main goal in embedded software development.

Development System and Examples

As mentioned previously, in Chapter 10 we go through the process of setting up an eCos development system. This development system includes the native Cygwin tools for Windows, the GNU cross-development tools (binutils, compiler, and debugger), the eCos configuration and management tools, a CVS client, and a lint program.

This system enables you to configure and build the eCos library, which is then linked with an application to run the eCos RTOS. The RedBoot ROM monitor is also built using this system. After following the steps in Chapter 10, a complete open-source embedded software development environment is configured.

We go through examples of building RedBoot, the eCos library, and an application in Chapter 12. Rather than requiring a specific development board to run the examples, a second PC is needed for the target platform. This is a better approach to becoming familiar with the development tools since it's typically pretty easy to find a spare PC lying around.

Although GNU cross-development tools binary files are included on the CD-ROM for the Intel x86 and PowerPC processor architectures, the instructions for configuring and building the GNU cross-development tools for other processor architectures are provided in Appendix D, Building the GNU Cross-Development Tools.

The embedded software development tools are installed, and examples are built, on a Windows development system. However, the necessary files to get an embedded software development system up and running on a Linux system are included on the CD-ROM. Since the eCos configuration tools are able to run on both Linux and Windows, the procedure for building and running the examples applies to both host operating systems.

The CD-ROM accompanying this book contains the files needed to set up the complete embedded software development system for eCos as detailed in Chapter 10. The examples in Chapters 12 and 13 are also contained on the CD-ROM under the examples directory.

A web site is available to download the source code and updates. The site is located online at:


If you find any errors that need correction, feel free to contact me and I will update the source code accordingly.

Some Notes about the Book

All example code in this book is in C or assembly language. eCos also uses the Component Definition Language (CDL), an extension of the existing Tool Command Language (Tcl) scripting language. We cover this in Chapter 11.

In the text where a 32-bit hexadecimal value is shown, the most significant 16 bits and least significant 16 bits are separated by an underscore ("_") (e.g., 0xABCD_EF12) for readability.

Sidebars are also included, which are used to point out important or additional information.

This book includes several Uniform Resource Locator (URL) links showing where additional information can be obtained on the Internet. The most up-to-date links are included in the text; however, we all know that links can have a finite existence.

Item lists throughout the book detail the eCos kernel API functions. These lists contain a field named "Context." This field shows the context from where the specified function can be called. The different contexts are Initialization, Thread, ISR, and DSR. "Any" is used to designate that the function can be called from any of the contexts.

A Brief Take on Open Source Development

There have always been "agnostics" in the debate of open source versus closed source—it sometimes comes down to whether the funding is available to purchase software tools and support. Each has its benefits and shortcomings, so let's take a brief look at some of the pros and cons developers have found when working on both sides of the open-source and closed-source fence. What it ultimately comes down to is, does the product work, and can the schedule and cost budget be met using this solution?

Open source can be a confusing term. In an article written by Daniel Benenstein, he states that open source is free software in the sense of freedom of knowledge exchange. Much more reliance is placed on the individual developer to find problems, correct the problems, and make the solution available to others in the open-source community. This iterative process is the method that creates a more robust and bug-free code base.

Presumably, because the draw of talent is worldwide, the best and brightest developers are working to make the product better. With closed source, a development support team is assembled to work on fixing problems for code they probably did not create. The team assembled might be very talented; however, the pool of talent from which to draw is very small compared to a worldwide talent pool.

Often times, closed-source, or proprietary, software and open-source software work hand in hand to complement each other. Many proprietary products are derived from open-source projects. Proprietary software must be innovative and differentiate itself from the open-source alternative; otherwise, why would people pay for something that they can get for free? Looking at things from this point of view, open source pushes proprietary software to the extreme of innovation.

There are some general advantages and disadvantages to using open-source software. One advantage is that since the source is available if you are not able to get support from the open-source community, you can dive right in and find out exactly what is going on with the code. There is no need to wait for support from an external source, which can reduce debug time drastically.

Another advantage of open-source software is that it is not tied to any one specific company. In the case of proprietary software, if the owning company changes direction, or disappears, then the application developers using that solution are left out in the cold. Open-source software prevents this because developers have full access to the code and can choose the path for their own system software.

Sometimes vendors selling proprietary software are not always the most responsive to all customers using their product. In cases where a project is not destined to produce large volumes, the vendor's response to questions might not be as rapid as needed. The reality is that a company with higher revenue products will get the preferential treatment.

Having the source also gives you the ability to implement your own changes and customize the code exactly the way you need to for your specific application. In addition, only with open-source can the source-level configuration method, as we find in eCos, be used.

Although some proprietary software vendors offer their source code to developers, there is often a fee associated with getting said code.

Security is often looked at as a negative aspect of open-source developments. Because all of the source code is available to everyone, malicious developers can exploit security holes. On the other hand, the community of developers supporting the open-source project work quickly on a fix because it is in their best interest as well. You are not at the mercy of a single source providing a fix to the security problem.

A great source for getting viewpoints from some of the leading figures behind the open-source movement is Open Sources: Voices from the Open Source Revolution.

Finally, I hope you all enjoy this book.

Anthony J. Massa


Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information

To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.


Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.


If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information

Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.


This site is not directed to children under the age of 13.


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information

If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information

Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents

California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure

Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact

Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice

We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020