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

[MiNT] Virtual addressing

Hi all,

   As some of you may (or may not) know, I've been working on virtual
addressing for MiNT.  This gives each process a potentially huge
address space, only limited by the amount of physical RAM in the
system.  This will remove the TT RAM fragmentation on 
machines with an MMU (i.e. 68030 and higher).  It will also be a step
toward having virtual memory.

   Here's what I'm proposing:

1)  On machines with TT RAM, virtual addressing will always be used.
    I don't see this as a problem, as the Afterburners currently use
    a form of it.

2)  ST RAM will -not- be virtually addressed.  There are too many issues
    with DMA.  Mallocs from ST RAM will be essentially unchanged from today.

3)  Virtual addressing will work with memory protection, but memory protection
    is not required for virtual addressing.  With memory protection off, the
    PMMU will still be turned on but all areas will be marked as globally

4)  Memory cost of virtual addressing should be somewhere between 
    no memory protection and today's memory protection.

5)  Due to the potential size of the PMMU table, there will be only one
    PMMU table for the entire system.  Each process will store level 2
    table (pointer level) entries to be swapped in/out whenever the process
    becomes active.  This will replace the current memory protection algorithm
    of duplicating the PMMU tree.  Note that this will slightly slow
    context switches.

6)  The  memory related files (dosmem.c, kmemory.c, memory.c, and mprot0x0.c)
    will be re-arranged:

    dosmem.c/kmemory.c/memory.c - functions common to all 680x0
    dosmemf.c/kmemoryf.c/memoryf.c - flat (i.e. 68000) memory functions
    dosmemp.c/kmemoryp.c/memoryp.c - PMMU (i.e virtual address) memory functions
    mprot.c - memory protection routines
    pmmu030.c - 68030 MMU specific routines
    pmmu040.c - 68040 MMU specific routines (should work for 060, too)
    My goal here is to make the 030 and 040 look alike except at the very
    lowest level.  Since the 030 PMMU can pretty much do anything the 040
    PMMU can do, this shouldn't be a problem.

7)  Consolidate (as much as possible) all memory routines into a table
    of function pointers.  This will hopefully minimize the impact to
    other areas of MiNT.

This will take me a while, so please be patient :).  Comments welcome before
I start to tear things apart.

Michael White (michael@fastlane.net)