Contiguous memory allocation and swap
OZ has a smart feature that allow application to have up to 40K contiguous memory. Applications requesting such memory are called bad application, popdown are said ugly.
On reset, OZ reserve space for this purpose. It is called the swap area.
Iām actually writing a new low level API to allow access to the swap. The underlying idea is to provide large memory area for elf binaries. Existing implementation looks for a contiguous memory area available in RAM. New implementation shuffles swap area to a mosaic of 256 bytes pages. It has many advantages.
memory is pushed to the limit in low memory condition
no more relocation is required, memory offset is always available from $2000 to $FFFF.
elf binary loading (PHT) is unlimited and thus more compliant to elf rules, a good example is a C compiled binary with CODE, DATA and BSS sections anywhere in the Z80 address range
OS_Swap is the new API with 2 reason call : SW_AL to allocate a contiguous memory area, SW_FR to free allocations and restore previous state. Swap area has been extended to 56K (1 more 16K bank).
Anyway, Iām not sure if those technical details are interesting anyone, letās see the feedback.
Ā