Custom RTEMS port

Chris Ziomkowski czim at newsguy.com
Mon Aug 6 02:55:58 UTC 2001


I am attempting to port RTEMS to the opencores openrisc Or1k
architecture, and am running into some difficulties, which I'm hoping
someone can help me out with.

First, I've managed to port the OS libraries, and I'm now trying to
get the test suite examples to compile. The Makefile structure for
this project is incredibly complex, and there doesn't appear to be
any documentation on exactly what needs to be changed and
where.

Issue #1:

The most immediate issue is the following: I am trying to get the
simple hello.exe test program to compile and link. This is the program
contained in the directory:

$top/c/src/tests/samples/hello

The issue appears to be that the $(make-exe) command is not linking
in the RTEMS libraries, thus I'm getting alot of undefined symbols.
When I run make, I get the following error:

/usr3/home/chris/or1k/or32-rtems/bin/ld   -L ../../../../../../
bender/lib -N -e _start -T../../../../../../bender/lib/linkcmds
-o o-optimize/hello.exe ../../../../../../bender/lib/start.o  o
-optimize/init.o ../../../../../../bender/lib/no-dpmem.rel ../.
./../../../../bender/lib/no-event.rel ../../../../../../bender/
lib/no-msg.rel ../../../../../../bender/lib/no-mp.rel ../../../
../../../bender/lib/no-part.rel ../../../../../../bender/lib/no
-signal.rel ../../../../../../bender/lib/no-timer.rel ../../../
../../../bender/lib/no-rtmon.rel --start-group      --end-group
../../../../../../bender/lib/start.o(.text+0x64):../../../../..
/../../../../c/src/lib/libbsp/or1k/bender/start/start.S: undefi
ned reference to `boot_card'
...

followed by alot more undefined references. One of the
things clearly not linked in this command line, is an RTEMS
library file, such as librtemsall.a. (Which does define these
symbols.)

My $(make-exe) (defined in $top/make/custom/bender.cfg)
has the following entry:

define make-exe
        $(LD) $(LDFLAGS) -N -e _start \
            -T$(PROJECT_RELEASE)/lib/linkcmds\
            -o $(basename $@).exe \
            $(START_FILE) $(LINK_OBJS) --start-group $(LINK_LIBS)
--end-group
        $(NM) -n $(basename $@).exe > $(basename $@).num
        $(SIZE) $(basename $@).exe
endef

So what appears to missing is the definition of $(LINK_LIBS).
However I can't find where to set $(LINK_LIBS)!

I copied this definition from the no_bsp config file, and in fact
all the .cfg files seem to use this macro. Can someone explain
to me how this macro gets filled in, or what additional information
I need to provide to help someone give me some assistance?

Thanks.

Issue #2:

The size of the binaries that are generated (based on the size of
the libraries after they have been stripped) are really really large.
More than 1 MB! Can someone tell me what the final size of the
binary should be for an equivalent architecture like the SPARC
or the PowerPC?

A 1MB OS seems excessive. For something that big I might as
well run embedded Linux. Can someone give me some guidance
on how to configure my build so I get a small OS on the order
of 100K? I guess I don't really need everything. Just the
necessities for multitasking, threads and networking stacks.

Is 100K a reasonable size for the RTEMS kernel?



Thanks for any assistance from the community. I look forward
to working with all of you to get this port to a new architecture
complete.

Chris Ziomkowski
czim at newsguy.com







More information about the users mailing list