Re: the memory model being used in elks?

Alan Cox <[email protected]> Mon, 11 May 2015 10:27:08 +0100
Newsgroups org.kernel.vger.linux-8086
Message-ID <[email protected]>
> but not the data. Then the RAM area inside the unused address space in
> the middle of the segment is not wasted.
> 
> process1:      |data+heap>                            <stack|
> process2:                     |--data+heap-->                    <--stack--|
>                |<-------------------- 64K ----------------->|
>                               |<-------------------- 64K ----------------->|
> 
> As many can overlap as it fits, with some extra margins for the stacks.
> The same works of course for combined code+data+heap too.

Very clever! You stil then need to know the stack sizes and automatically
trap and move which means you need to call a helper on function entry
or alloca, but that's not difficult.

It doesn't work in protected mode, which ELKS supports but for real mode
that would work beautifully.

The ELKS format basically turns the traditional arrangement around with a
predefined stack size rather than heap size, and stack at bottom, so the
heap can then expand upwards without mess.



Alan