Re: the memory model being used in elks?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, May 10, 2015 at 10:51:18PM +0100, Alan Cox wrote:
> > Even without MMU overlapping 8086 segments allow the use of this <-Space->
> > for stack or data+bss of other processes. Wonder if/how this is handled
> > in elks (lacking the time to Use-The-Source...)
> 
> Only if you use far pointers which is incredibly expensive, otherwise
> taking the address of a stack based variable breaks.

Not at all. The process has its full 2^16 address space for data, the
stack always at the top, the data+heap at the bottom, no far pointers,
no problem to access stack based variables.

It is up to the kernel to keep track of the sizes of heaps and stacks
of all processes (which it does in any case) and move processes' data
segments in RAM when necessary so that the segments can and do overlap
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.

Rl

--
To unsubscribe from this list: send the line "unsubscribe linux-8086" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel]     [Linux ia64]     [DCCP]     [Linux for ARM]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux