To link and run C or C++
programs, you need to define a small module (usually written in assembler
as '
crt0.s') that makes sure the
hardware is initialized for C conventions before calling
main.
There are some examples of
crt0.s code (along with examples of system call stub code) available
in the source code for GNUPro Toolkit.
Look
in the following path.
installdir
refers to your installation directory, by default '
/usr/cygnus'.
For example, look in '
.../sys/h8300hms'
for Hitachi H8/300 bare boards, or in '
.../sys/sparclite' for
the Fujitsu SPARClite board.
More example
ffb
s are in the
following directory.
At a minimum, your
crt0.s
module must do the following processes.
A more complete
crt0.s
module might also do the following processes.