Previous: , Up: Libgloss   [Contents]


1.3 Adding Support for a New Board

This section explains how to add support for a new board to libgloss. In order to add support for a board, you must already have developed a toolchain for the target architecture.

All of the changes you will make will be in the subdirectory named after the architecture used by your board. For example, if you are developing support for a new ColdFire board, you will modify files in the m68k subdirectory, as that subdirectory contains support for all 68K devices, including architecture variants like ColdFire.

In general, you will be adding three components: a crt0.S file (see Crt0), a linker script (see Linker Scripts), and a hardware support library. Each should be prefixed with the name of your board. For example, if you ard adding support for a new Surf board, then you will be adding the assembly surf-crt0.S (which will be assembled into surf-crt0.o), the linker script surf.ld, and other C and assembly files which will be combined into the hardware support library libsurf.a.

You should modify Makefile.in to define new variables corresponding to your board. Although there is some variation between architectures, the general convention is to use the following format:

# The name of the crt0.o file.
SURF_CRT0    = surf-crt0.o
# The name of the linker script.
SURF_SCRIPTS = surf.ld
# The name of the hardware support library.
SURF_BSP     = libsurf.a
# The object files that make up the hardware support library.
SURF_OBJS    = surf-file1.o surf-file2.o 
# The name of the Makefile target to use for installation.
SURF_INSTALL = install-surf

Then, you should create the ${SURF_BSP} and ${SURF_INSTALL} make targets. Add ${SURF_CRT0} to the dependencies for the all target and add ${SURF_INSTALL} to the dependencies for the install target. Now, when libgloss is built and installed, support for your BSP will be installed as well.


Previous: , Up: Libgloss   [Contents]