eCos Product

eCos Net Distribution


RedBoot Product
 
RedBoot Net Distribution


Supported Hardware

Downloading and Installation

Documentation

FAQ

Keeping in Touch

Problems

Licensing

Anonymous CVS

Contributions and Third Party Projects

Red Hat eCos

eCos Porting Guide


Introduction

eCos has been designed to be fairly easy to port to new targets. A target is a specific platform (board) using a given architecture (CPU type). The porting is facilitated by the hierarchical layering of the eCos sources - all architecture and platform specific code is implemented in a HAL (hardware abstraction layer).

By porting the eCos HAL to a new target the core functionality of eCos (infra, kernel, uitron, etc) will be able to run on the target. It may be necessary to add further platform specific code such as serial drivers, display drivers, DSP drivers, etc. to add to get a fully capable system.

This document is intended as a help to the porting process. Due to the nature of a porting job, it is impossible to give a complete description of what has to be done for each and every potential target. This should not be considered a clear-cut recipe - you will probably need to make some implementation decisions, tweak a few things, and just plain have to rely on common sense.

However, what is covered here should be a large part of the process. If you get stuck, you are advised to read the ecos-discuss archive where you may find discussions which apply to the problem at hand. You are also invited to ask questions on the ecos-discuss mailing list to help you resolve problems - but as is always the case with community lists, do not consider it an oracle for any and all questions. Use common sense - if you ask too many questions which could have been answered by reading the documentation, FAQ or source code, you are likely to be ignored.

This document will be continually improved by Red Hat engineers as time allows. Feedback and help with improving the document is sought, so if you have any comments at all, please do not hesitate to post them on ecos-discuss (please prefix the subject with [porting]).

At the moment this document is mostly an outline. Many details to fill in before it becomes truly usable. Many places you'll find a list of keywords / concepts that should be described (please post on ecos-discuss if there are areas you think are not covered).

All pages or sections where the caption ends in [TBD] contain little more than key words and/or random thoughts - there has been no work done as such on the content. The word FIXME may appear in the text to highlight places where information is missing.


Writing a HAL

In order to write an eCos HAL it's a good idea to have at least a passing understanding of how the HAL interacts with the rest of the system.

HAL Details

Directory Layout

Coding Conventions

Exceptions

Interrupts

Diagnostics IO

eCos/ROM Monitor Calling Interface

eCos GDB stubs

eCos Run-time Environment


Platform HAL Porting

This is the type of port that takes the least effort. It basically consists of describing the platform (board) for the HAL: memory layout, early platform initialization, interrupt controllers, and simple serial device driver.

Doing a platform port requires a preexisting architecture and possibly a variant HAL port.

Porting process

Platform Memory Layout

CDL requirements


Variant HAL Porting

A variant port can be a fairly limited job, but can also require quite a lot of work. A variant HAL describes how a specific CPU variant differs from the generic CPU architecture. The variant HAL can re-define cache, MMU, interrupt, and other features which override the default implementation provided by the architecture HAL.

Doing a variant port requires a preexisting architecture HAL port.

Porting process

CDL requirements


Architecture HAL Porting

Porting process

HAL Cache Controls

Linker Script Macros

CDL requirements


RedBoot Porting

RedBoot Porting Process

RedBoot CDL

RedBoot Timer

RedBoot Commands

RedBoot Flash Support

RedBoot Ethernet Support


Writing a Driver

These pages describe how to write eCos device drivers for various pieces of hardware. As with the other documentation, this is a work in progress, and if you do not find the information you were looking for, please consult the sources or send your questions to the mailing list.

Ethernet Driver

Flash Driver

PCI Driver

PCMCIA Driver

Serial Driver

USB Driver

Wallclock Driver

Watchdog Driver


Documentation TODO list

See the list of items that haven't found their way into sections yet.