I am writing a simple multi-tasking OS... I want to move the kernel heap as close to the beginning as possible... to get as much page frame as I can
from my experiment with linker script so far
Code: Select all
.data :
{
data = .; _data = .; __data = .;
*(.data)
*(.rodata)
. = ALIGN(4096);
}
.bss:
{
bss = .; _bss = .; __bss = .;
*(.bss)
. = ALIGN(4096);
}
the linker script above does *not* make .data or .bss start from the first byte of a page, it
just means that the entire section will end at the a page boundary...
linker can select the starting address at some value past the page boundary...
I declare the value in my C code as extern, the linker will do the rest.