ChorusOS 4.0 Porting Guide

The boot Directory

This is the directory where the source files for the boot program reside. There are at least two files in this directory:


Example A-11 New BSP: Imakefile

C__SRCS = boot.c

AS_SRCS =

OBJS = $(C__SRCS:.c=.o) $(AS_SRCS:.s=.o)
BspProgTarget(boot.r, start, $(OBJS), $(BSP_LIBS))

DistProgram(boot.r, $(MYBSP_DIST_BIN)$(REL_DIR))

Depend($(C__SRCS) $(AS_SRCS))

The BspProgTarget macro is used to produce the boot.r relocatable binary file. The final link will be done by the mkimage tool. The first argument is the name of the binary ( with the standard file extension .r for 'relocatable'). The second argument is the entry-point, the third is the list of objects and the fourth is the list of libraries used in the link process.

The DistProgram macro copies the file given by the first argument to the directory specified by the second argument. Therefore, in the example above, the boot.r binary file will be copied in to the $BSP_DIR/bin/mybsp/boot directory.


Example A-12 New BSP: boot.c

void
start()
{
    /* Code for your BSP boot */
}

This file needs to be adapted to cater for your BSP.