ReturnInfinity/BareMetal-OS — Issue #4: bss should be cleared with zeros when loading a program
Author: IanSeyler
Created: 2012-02-04 20:00:25+00:00
State: open

C compilers assume that .bss section is filled with zeros, so cli.asm should clear it after loading the file

For example:
int x[256] = {0}; //this compiles to .bss
int y[256] = {1}; //this compiles to .data

so if i check x[0], this should be 0

PS: modifying linker script's last line to ".bss ALIGN(0x08) : { *(.bss) }" will make bss section start on an address divisible by 8

temporary solution:
gcc-option: -fno-zero-initialized-in-bss