avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Where is the Startup Code source.


From: Joerg Wunsch
Subject: Re: [avr-gcc-list] Where is the Startup Code source.
Date: Thu, 2 Nov 2006 21:39:28 +0100 (MET)

Claude Sylvain <address@hidden> wrote:

> Is it possible to get this source code from some place ?

Of course, as WinAVR is only compiling and shipping opensource
packages, so obviously, there must be source code available.

In this case, you can get it from the avr-libc distribution:

http://download.savannah.gnu.org/releases/avr-libc/

Alternatively, you could go to the project's web pages, and browse the
CVS:

http://cvs.savannah.nongnu.org/viewcvs/?root=avr-libc

The run-time startup code is located in the subdirectory crt1.

> Everybody knows that it can be usefull to make a custom Startup Code
> for doing special initialization.

It's not commonly required to customize it, much less than you
obviously believe.  The GCC/avr-libc system is rather flexible, so
most people can do what they need without directly manipulating that
code.  Out of several thousands of avr-libc users, I can't remember
very many people who really had to modify that code in order to get
their customization done.

> So, how come the Startup Code source is not included in the WinAVR
> distribution ?

Previous WinAVR releases have indeed been accompanied by a full source
code release, but I believe it wasn't very popular, so Eric instead
replaced that by a list of pointers where to get the respective source
code.  I bet you could have found the above URLs there as well. ;-)

Remember that the stack pointer is currently initialized twice: once
in the startup code, and another time at the beginning of main().  The
latter is rather historical baggage, and might go away in a future
release.  (For new AVRs, it's actually initialed three times: the
hardware itself initializes the SP to the top of internal RAM now.)
Thus, the officially supported interface to relocate the stack is to
redefine the symbol __stack on the linker command-line to a different
value.  This will affect both places, the run-time code as well as the
beginning of main(), as they both use that symbol.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]