On Thu, Jan 27, 2000 at 11:06:27AM +1100, Erich Schulz wrote:
> Does any one know how to interface relocatable object code written in C,
> to a particular micro ie: how to write CRT0 ?
>
> I wan't to develop and test some code using linux and GCC, and then
> embed it, without an operating system to get the ROM size down.
crt0.o is just another object file; it has an entry point the system
starts executing at, perhaps sets up some system-dependent
structures (which by the sounds of it you won't have to worry about)
and jumps into your code. When you roll your own crt0, compile with
-nostartfiles in your linker flags so as not to link against the
standard gcc crt0.o.
From your point of view, the most important thing crt0 does is provide
an entry point for your program and jump into your main(). Jumping into
main is easy; the entry point you want depends on your ROM loader.
There's not really much else to say about that, it depends on your
ROM etc.
Of course, without an OS under you you'll be compiling without libc
(have a good read of the gcc info page for all the options required ;)
and duplicating a whole lot of OS-like functionality depending on
what your code's doing. Have fun :)
Conrad.
--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text