Skip to content

Memory Management

EtchedPixels edited this page Feb 4, 2017 · 4 revisions

Fuzix divides memory management models as follows

##Flat

A system with a single flat address space and no hardware memory management or segment registers. Currently this is supported by keeping one process in memory and swapping others. Work is in progress to support a 'soft' MMU for 32bit flat machines where it makes sense to use copying to fake fork() behaviour. Works very well today for small amounts of memory. With large amounts of memory the swap model stops making sense but these machines would be expected to use SoftMMU.

##Fixed Common And Bank

Systems that have a section of the address space fixed and the rest is switchable as a single chunk between multiple memory banks. This is very common on Z80 systems, particularly CP/M ones. The switchable chunk needs to be at least 32K to make effective use of it. Systems with a single 16K banked window do not work out well. Works very well today.

##16K Banks

Systems with 16bit address space divided into four 16K chunks each of which can be independently mapped. 8K banks can also be supported as pairs in order to handle the 8K MMU page size often found on 6809 systems. Works well but swap is not yet supported.

##8K Banks

Support for 8K banking to make proper use of the 8K MMU on some 6809 systems, as well as to support other 8K platforms. Currently only works if you don't need a common space mapped. WIP to fix that.

Under Development

##Soft MMU

A variant of the flat memory space where the kernel tries to create new processes at free virtual addresses but fork, swapping and lack of linear space is handled by swapping banks of memory on task switch - somewhat akin to how Minix worked. This works OK because most of the time processes fork and then execve() and also provides a rather more sensible swap and paging model with larger amounts of RAM.

##Base/Limit

Base/Limit pairs or segmentation. The processor has a linear address space but programs can be relocated by setting up base and optionally limit registers describing the accessible region. The 8086 segment model is a variant on this but not quite the same.

##Small Paged

Systems with a 16bit or similar virtual address space mapped onto a larger physical address space via a simple lookup table.

##Simple MMU

The proposed Atari ST MMU that never happened. A stunningly simple MMU that needs a certain amount of careful software support but can be implemented in relatively few gates.

Yet To Start

##MPU

Memory protection unit. Memory can be protected but there is no virtual to physical remapping. This is a variant on soft MMU but has some important differences.

##Large Paged

Classic 32bit virtual address space with page tables. May never be relevant to FUZIX anyway.

##8086 Segment Interleave

Programs are allocated a 64K data segment with a hole in the middle. The memory allocator interleaves the holes with other allocations. This is how various early Unix platforms handled the 8086.