ChorusOS 4.0 Porting Guide

Appendix B Porting the Debug Agent

This appendix explains how to port the debug agent to a new board.

Source Files

There are two binary files in the ChorusOS operating system bootable image that you must consider when porting the debug agent:

The interface between dbgAgent and dbgBsp is described in include/chorus/bki/dbgBsp.h.

dbgAgent

The debug agent source code can be found in the common/src/dbg and family/src/dbg directory trees. As this code is platform independent, you should not need to modify it.

dbgBsp

The source code for generic serial device drivers can be found in the drv/src/dbg subtree. There are two files per driver: Bsp.h and a file defining the interface to platform specific functions. This interface is device driver dependent.

The dbgBsp platform-specific source code can be found in the /src/dbg directory tree.

A serial line device driver is platform independent. It depends only on a chip used for serial I/O. A serial line device driver calls a small number of platform dependent functions in order to access device registers. If a generic driver already exists for your platform, you only need to modify these functions. If no generic device driver exists for a chip on your platform, create one using the generic serial line device driver interface described in drv/src/dbg/dbgUart.h.

Example

This section describes a dbgBsp for the PowerPC Genesis-2 board. The source files for this example are in powerpc/genesis2/src/dbg. There are three files in this directory:

dbgBsp.c:

ns16550Bsp.c:

Imakefile: