Getting Started with Ecos
Total Page:16
File Type:pdf, Size:1020Kb
Getting Started with eCos Toshiba TX39 edition March 2000 Copyright © 1998, 1999, 2000, Red Hat Inc Copying terms The contents of this manual are subject to the Red Hat eCos Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.redhat.com/ Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. The Original Code is eCos - Embedded Configurable Operating System, released September 30, 1998. The Initial Developer of the Original Code is Red Hat. Portions created by Red Hat are Copyright©) 1998, 1999, 2000 Red Hat, Inc. All Rights Reserved. Trademarks Java, Sun, and Solaris are trademarks and registered trademarks of Sun Microsystems, Inc. SPARC is a registered trademark of SPARC International, Inc. UNIX is a trademark of The Open Group. Microsoft, Windows NT, Windows 95, Windows 98 and Windows 2000 are registered trademarks of Microsoft Corporation. Linux is a registered trademark of Linus Torvalds. Intel is a registered trademark of Intel Corporation. eCos is a trademark of Red Hat, Inc. Red Hat is a registered trademark of Red Hat, Inc. 300-400-1010049-03 2 I Getting Started with eCos eCos Contents Getting Started with eCos ...................................................................1 Copying terms .................................................................................2 Trademarks .....................................................................................2 Foreword ..................................................................................................7 Documentation Roadmap .....................................................................11 Getting Started with eCos ....................................................................11 eCos User’s Guide................................................................................11 eCos Reference Manual .......................................................................12 Part I: Release Notes....................................................13 Notation and Conventions.....................................................................14 GDB and GCC Command Notation.....................................................14 Directory and File System Conventions...............................................14 Overview of the Release ........................................................................16 Hardware Abstraction ..........................................................................16 Embedded Kernel.................................................................................17 Configurability .....................................................................................17 µITRON and Other Operating Systems ...............................................18 ISO C Library.......................................................................................18 Serial Device Drivers ...........................................................................19 ROM Monitor Image............................................................................19 Tests and Examples..............................................................................19 GNU Tools and their Documentation ..................................................20 eCos Documentation ............................................................................20 Package Contents...................................................................................21 eCos Net Release..................................................................................21 eCos Getting Started with eCos I 3 eCos Developers’ Kit ...........................................................................21 System Requirements............................................................................23 Required ...............................................................................................23 Recommended......................................................................................24 Reporting Problems...............................................................................25 How to Report Problems ......................................................................25 Part II: Installation Guide...........................................29 Software Installation .............................................................................30 Software Installation on Windows .......................................................30 Software Installation on UNIX ............................................................31 Target Setup...........................................................................................34 Connecting To A Target Via Serial......................................................34 Connecting To A Target Via Ethernet .................................................35 Connecting To A Simulator Target......................................................35 Connecting To A Synthetic Target.......................................................36 TX39 Hardware Setup..........................................................................36 TX39 Architectural Simulator Setup....................................................36 i386/Linux Synthetic Target Setup .................................................37 Running Applications on the Target....................................................39 Part III: Programming Tutorial .................................41 Programming with eCos .......................................................................42 Configuring and Building eCos from Source......................................45 eCos Start-up Configurations ...............................................................45 Using the Configuration Tool on Windows .........................................46 Using ecosconfig on UNIX ..................................................................52 Architectural Notes ..............................................................................57 Test Suites...............................................................................................58 Using the Configuration Tool ..............................................................59 Using the command line.......................................................................59 Testing Filters.......................................................................................60 Building and Running Sample Applications.......................................61 eCos Hello World.................................................................................61 A Sample Program with Two Threads.................................................62 4 I Getting Started with eCos eCos More Features — Clocks and Alarm Handlers ..................................66 A Sample Program with Alarms ..........................................................66 Appendixes....................................................................71 Appendix 1: Real-time characterization..............................................72 Sample numbers:..................................................................................72 Appendix 2: eCos Licensing.................................................................75 RED HAT ECOS PUBLIC LICENSE Version 1.1 ...........................................................................................75 Appendix 3: The eCos Copyright Assignment Form, Revision 1.1...82 Index .......................................................................................88 eCos Getting Started with eCos I 5 6 I Getting Started with eCos eCos What’s New in 1.3.1? Foreword Welcome to the 1.3.1 release of Red Hat eCos(TM) - the Embedded Configurable Operating System. What’s New in 1.3.1? In this, the third major public release of eCos, we have added a wealth of new features, enhancements, and have further extended the target platform coverage. The configuration system has been completely revised and updated. Major new elements include: I Package management that supports the extension of eCos functionality via third party add-on packages. I A standardized configuration save file format that is human readable and editable, and compatible between both GUI and command line configuration tools. I Enhanced web based help and component documentation system integrated into the GUI configuration tool. I The Component Definition Language (CDL) has been radically revised and has now been implemented as a TCL extension for maximum flexibility. CDL is now fully documented in the Component Writers Guide. I Template support for straightforward control of multiple configuration elements, which can be used to provide easy access to standard eCos configurations such as a debug stub boot ROM. I Best of all, the source of the new configuration tools and underlying libCDL technology has been open sourced under the GNU Public License (GPL). A companion beta version of the eCos TCP/IP stack has been released in conjunction with 1.3.1. The stack is derived from the OpenBSD source base and provides UDP, TCP, ICMP and BOOTP protocol support on an IPv4 standards base. Device driver support for Cirrus Logic EP72xx evaluation boards and Motorola MBX is included. The stack, ethernet core support, and device drivers are all distributed as configurable eCos packages. eCos Getting Started with eCos I 7 eCos in a