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

Re: [MiNT] VM



Adam Klobukowski wrote:

> 
> Reqest Further Comments
> 

Start writing a virtual store mansger (VSM) that has many options of control over the
mapping of logical to physical memory.

Such a VSM should be able to cope with all the memory constraints that you mentioned.

The first thing the VSM (which is the first thing to be loaded) will do is create a page
tree that describes all the physical memeory that MiNT needs.
The part of MiNT's logical address space that doesnt need to match physical memory
will be allocated when needed by the VSM anywhere in physical (or secondary) memory.

This gives MiNT a logical address space of the full bit width. The VSM then loads MiNT.

All application code is loaded and run in the heap of MiNTs logical address space
as if there was no virtual memory at all.

The trick:
The page tree of the application is duplicated in the page tree of MiNT such that
all logical memory remains contiguous, both for MiNT and for the application as it
appears in MiNTs heap.

Mmemory requests of applications are implemented as just increasing the logical address
space of the application. This means that application memory must move up and down in
MiNTs heap. But that only requires manipulation of the tree, not moving of physical memory.

All adjustments to the page tree layout are done by the VSM.
The VSM doesnt need to know about processes, just page trees, pages and a page pool.

To make it clear how this can be achieved:
The 68K page tree design makes it possible to have a single physical page in different
page trees at different logical positions. A property that opens powerfull perspectives of
implementing shared memory, code or libraries in a very flexible way.

Advantage of this model:
It should be possible to leave MiNT almost completely unchanged. With the exception that
MiNTs memory allocation routines can be replaced by a simple Malloc like call to the VSM.

The biggest advantage is that the appearance of all memory to MiNT is simple and
straightforward. Which might have a beneficial effect on overall performence.
All complexity sits in the VSM, carefully kept out of MiNTs sight.

Example: Loading a application simply means request the memory from the VSM.
the memory appears as a single block in which MiNT can load the program code and data in
simple moves. At any time the memory can be described by MiNT as a single vector:
{startaddress,size}.

The concept also makes it possible to reserve memory for processes that have problems
with logical memory. (or things that need ST ram for some reason ;-)

This is only a very global overview. There might be practical problems.
Or I might be completely wrong, because I overlook something.

(Oh well, if it isnt possible, I think it should have been. :-)

-- 
Groeten; Regards.
Henk Robbers.    mailto:h.robbers@chello.nl
                   http://members.ams.chello.nl/h.robbers/Home.html
A free multitasking GEM for MiNT: XaAES   (heavily under construction);
                                              http://xaaes.atari.org
Interactive disassembler:         TT-Digger;  http://digger.atari.org
Experimental text editor:         AHCX