Yahoo Groups archive

AVR-Chat

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

Message

RE: [AVR-Chat] Re: Finally, really, actually, starting off with C

2009-01-07 by subscriptions@aeolusdevelopment.com

Don Kinzer Wrote
>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.

Just so David knows.  This is a fairly standard approach.  The details
differ from implementation to implementation but most of them end up
looking something like this. I have known implementations to zero all
memory before initializing anything with a non-zero initializer but that is
not very common. 

>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.

This, on the other hand, is peculiar to gcc.  Some compilers offer a
similar hook but it is by no means universal.

Robert

--------------------------------------------------------------------
mail2web.com – What can On Demand Business Solutions do for you?
http://link.mail2web.com/Business/SharePoint

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.