: Each task has a kernel stack stored in its task entry which is 1024 bytes.
: The user space stack are a bit messy at the moment. When a chunk of memory
: is allocated for a process data segment the stack is placed at the top
: of this area of memory so it grows down towards the top of the heap which
: grows up. This unfortunatly means that each task has to have all the memory
: it ever needs all the time. Solution have been sugested to this but they
: all involve restricting the stacks freedom to grow.
:
There's basically two models that have shown to work on
machines without paging/mmus (8086's). A variable stack segment
and a fixed stack segment. The variable stack segment has to
place the stack at the highest address (FFFF) and grow down, with heap sharing
in between. This requires all the memory to be allocated, but allows maximum
flexibility between stack and heap sizes. Typically UNIX uses this model.
The other is the fixed stack model, which the MS compilers use. This allocates
the stack directly above the end of the data segment, and fixes the stack pointer
at the high end of that. The heap is located above the stack.
The model that ELKS uses allows the stack to grow to the
maximum size the processor architecture allows, doesn't it?
Greg