Cdl requirements – Comtrol eCos User Manual

Page 348

Advertising
background image

Chapter 11. Porting Guide

CDL Requirements

The CDL needed for any particular architecture HAL depends to a large extent on the needs of that architecture.
This includes issues such as support for different variants, use of FPUs, MMUs and caches. The exact split between
the architecture, variant and platform HALs for various features is also somewhat fluid.

To give a rough idea about how the CDL for an architecture is structured, we will take as an example the I386
CDL.

This first section introduces the CDL package and placed it under the main HAL package. Include files from
this package will be put in the

include/cyg/hal

directory, and definitions from this file will be placed in

in-

clude/pkgconf/hal_i386.h

. The

compile

line specifies the files in the

src

directory that are to be compiled

as part of this package.

cdl_package CYGPKG_HAL_I386 {

display

"i386 architecture"

parent

CYGPKG_HAL

hardware

include_dir

cyg/hal

define_header hal_i386.h

description

"

The i386 architecture HAL package provides generic

support for this processor architecture. It is also

necessary to select a specific target platform HAL

package."

compile

hal_misc.c context.S i386_stub.c hal_syscall.c

Next we need to generate some files using non-standard make rules. The first is

vectors.S

, which is not put into

the library, but linked explicitly with all applications. The second is the generation of the

target.ld

file from

i386.ld

and the startup-selected

.ldi

file. Both of these are essentially boilerplate code that can be copied and

edited.

make {

<

PREFIX

>

/lib/vectors.o :

<

PACKAGE

>

/src/vectors.S

$(CC) -Wp,-MD,vectors.tmp $(INCLUDE_PATH) $(CFLAGS) -c -o $@ $

<

@echo $@ ": \\"

>

$(notdir $@).deps

@tail +2 vectors.tmp

>>

$(notdir $@).deps

@echo

>>

$(notdir $@).deps

@rm vectors.tmp

}

make {

<

PREFIX

>

/lib/target.ld:

<

PACKAGE

>

/src/i386.ld

$(CC) -E -P -Wp,-MD,target.tmp -DEXTRAS=1 -xc $(INCLUDE_PATH) $(CFLAGS) -o $@ $

<

@echo $@ ": \\"

>

$(notdir $@).deps

@tail +2 target.tmp

>>

$(notdir $@).deps

@echo

>>

$(notdir $@).deps

@rm target.tmp

}

244

Advertising