Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: Finally, really, actually, starting off with C

2009-01-07 by Don Kinzer

The gcc compiler generates three distinct sections for RAM-based data 
whose names are .noinit, .bss and .data.  The .noinit section is for 
uninitialized data items.  The .bss section is for zero-initialized 
data items (BSS stands for Block Started by Symbol, a throwback to 
FORTRAN or even earlier days).  The .data section is for data items 
with non-zero initialization values.

After setting up the stack pointer (usually to the end of internal 
RAM), zeroes out the .bss section.  For the .data section, it copies a 
block of data from Flash (containing the initialization data) to the 
RAM section.  It does nothing at all to the .init section.

If needed, there is a means to inject code into various places of the 
startup sequence.  See the discussion of the .initN sections for more 
details.  In particular, see
http://www.nongnu.org/avr-libc/user-manual/mem_sections.html

Don Kinzer
ZBasic Microcontrollers
http://www.zbasic.net

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.