heap and stack collision
Posted: Fri Apr 04, 2008 2:59 pm
Hi,
I just compiled a program for my OS using newlib and a simple libgloss.. but when I try to run my program on my os I get the error:
Heap and stack collision
Now I'm excited that it actually printed something in my os, but what is the problem? Is this something with my linker script? Or maybe my sbrk function? Here's my linker script
As you can see I don't provide for a stack but my kernel setups up a stack for every user mode program.. so any ideas?
Thanks in advance.
I just compiled a program for my OS using newlib and a simple libgloss.. but when I try to run my program on my os I get the error:
Heap and stack collision
Now I'm excited that it actually printed something in my os, but what is the problem? Is this something with my linker script? Or maybe my sbrk function? Here's my linker script
Code: Select all
OUTPUT_FORMAT("binary")
ENTRY(start)
phys = 0x00;
SECTIONS
{
.text phys : AT(phys) {
code = .;
*(.text)
*(.rodata)
}
.data : AT(phys + (data - code))
{
data = .;
*(.data)
}
.bss : AT(phys + (bss - code))
{
bss = .;
*(.bss)
}
end = .;
_end = .;
}
Thanks in advance.