This question is a follow up of my previous question
http://stackoverflow.com/questions/3572610/stack-growth-direction
I would like to know whether stack is created by a compiler or OS/architecture ? Also how does OS knows about these compiler specific things ? For ex: C++ allows variables to create data on stack and heap while java allows only heap.
Also if stack is created on heap as mentioned in the post how can system know about it because the system knows only about stack pointer and base pointer.