ChorusOS 5.0 Board Support Package Developer's Guide

dbgBsp

The dbgBsp consists of two main parts (see Figure 6-1) that interface with some critical devices that enable boot and debugging facilities. The first part is a device independent (but driver dependent) interface adaptation layer that links the debug agent and the debug criticial devices.

Figure 6-1 Debug Agent Showing Debug Critical Drivers

Graphic

The second part is made up of the device drivers that are used to manage the chips that the dbgBsp requires to be able to provide its services. This part is device (chip) dependent and implements the device independent interfaces that are defined in the upper layer.

For all boards that the ChorusOS operating system is supported on, the devices that must be implemented are the same: UART and WDT. However, the chips required by these devices are different.

The device-dependent (but chip-independent) definition files can be found in the source_dir/nucleus/bsp/src/dbg directory. There is a header file per device that defines the interfaces: dbgWdt.h and dbgUart.h.

The instanciation of this interface (or the stubs) can be found in the same directory. The naming convention for these files is: device.c and deviceBsp.h. The header file defines the functions from the device driver that can be used to implement the dbgBsp services. The C source file implements these services using the device driver calls that are defined in the header file. For example epfpld.c is a simple dbgBsp service that uses the epfpld device driver.

The Imakefile of this directory only lists the object files for independent compilation, and the headers that will be exported.

The second part of the dbgBsp is platform dependent. In this part the dbgBsp is first described in the Imakefile in terms of "what device drivers are used for this platform". This is where is it stated that for the SPARC CP1500, the dbgBsp relies on ns16550 UART driver and an epfpld WDT driver. This Imakefile can be found in the source_dir/nucleus/bsp/family/my_board/src/dbg directory. In this directory, you will also find the source for the implementation of the device driver interface defined in the deviceBsp.h file.

When porting to a new board you will need to write both the serial device drivers and the WDT device driver.

Example

This section describes a dbgBsp for the UltraSPARC CP1500 board. The source files for this example are in the source_dir/nucleus/bsp/usparc/cpxxxx/src/dbg directory. There are three files in this directory:

dbgBsp.c:

ns16550Bsp.c:

epfpldBsp.c:

Imakefile: