Pyromaniac

Pyromaniac PRM: System Dynamic Areas

Pyromaniac PRM: System Dynamic Areas

RISC OS PyromaniacSystem Dynamic Areas

Introduction and Overview

RISC OS manages memory through named regions known as Dynamic Areas. These Dynamic Areas have been extended with each iteration of RISC OS to remove anonymous (unnamed, or implicit areas) under the control of the dynamic area system.

This chapter documents the current system dynamic areas, and their usage under different RISC OS versions.

Technical details

The following table describes the currently allocated Dynamic Areas for the Operating System.

ValueMeaning
-1Application space
0System Heap
1Relocatable Module Area (RMA)
2Screen Area
3Sprite Area
4Font Cache
5RAM Filing System
6Free pool
7VRAM rescue
8Kernel buffers
9Reserved for future expansion
10Abort SVC and IRQ stack copy
11Operating system ROM
12SWI dispatch and IRQ workspace
13SVC stack
14IRQ stack
15UND stack
16Level 2 Page Tables
17Operating system page tables (SoftCAM)
18System Initialisation area
48Zero Page
49High CPU vectors

Area -1: Application space

The application space holds the user application. It is documented in the chapter Memory Management and Application Memory.

Support

The Application Space Dynamic Area is supported by all versions of RISC OS from 3.5 onward.

Area 0: System Heap

The system heap is a private area used by the Operating System for allocation of structures vital to the system's operation. It is documented in the chapter Memory Management. The system heap is managed through OS_Heap. The area includes, but it not restricted to :

  • Timer information
  • Dynamic area information
  • Module information
  • Dispatch hashes and tables

Prior to RISC OS Select 3, the system heap was used for system variable management and as FileSwitch workspace. This has been changed to remove such collusion. System variables (and the entire system variable system) is now managed by the SystemVars module. FileSwitch now uses a private dynamic area for its memory allocation.

Support

The System Heap Dynamic Area is supported by all versions of RISC OS.

Area 1: Relocatable Module Area (RMA)

The RMA contains module code and data which have been loaded during the running of the system. Small memory blocks are allocated here for modules to use. Larger blocks should be placed in dedicated dynamic areas. It is documented in the chapter Modules. The RMA is managed through OS_Heap.

Support

The RMA is supported by all versions of RISC OS.

Area 2: Screen Area

The screen area was an area managed by the Kernel to hold the video memory used by the display and off screen buffers. In modern versions of RISC OS the screen memory is managed by the driver for the video system. On versions of Select, a fake screen area is managed with this area number by the LegacyScreen module. This allows applications which rely on the existence of the area to continue functioning.

Support

RISC OS Select: The Screen Dynamic Area is supported by all versions of RISC OS up to Select 3. The LegacyScreen module provides this dynamic area from Select 3 onward.

RISC OS 5: The Screen Dynamic Area is supported by all versions of RISC OS.

RISC OS Pyromaniac: The Screen Dynamic Area is not supported.

Area 3: Sprite Area

The system sprite area is managed by the Kernel's sprite system. It is documented in the chapter Modules.

Support

RISC OS Select: The Sprite Area is supported in the Kernel by all versions of RISC OS up to Select 3. The SpriteUtils module provides this dynamic area from Select 3 onward.

RISC OS 5: The Sprite Area is supported by all versions of RISC OS.

RISC OS Pyromaniac: The Sprite Area is not supported.

Area 4: Font Cache

The Font cache was originally managed by the Kernel on behalf of the FontManager. In modern versions of RISC OS, the Font cache is managed by the FontManager module.

Support

RISC OS Select: The Font Cache Area is supported in the Kernel by all versions of RISC OS up to Select 2. The FontManager module provides this dynamic area from Select 2 onward.

RISC OS 5: The Font Cache Area is supported by all versions of RISC OS.

RISC OS Pyromaniac: The Font Cache Area is not supported.

Area 5: RAM Filing System

The RAM filing system was originally managed by the Kernel on behalf of RAMFS. In modern versions of RISC OS, the memory is managed by the RAMFS module.

Support

RISC OS Select: The RAM Disc Dynamic Area is supported in the Kernel by all versions of RISC OS up to Select 3. The RAMFS module provides this dynamic area from Select 3 onward.

RISC OS 5: The RAM Disc Dynamic Area is supported by all versions of RISC OS.

RISC OS Pyromaniac: The RAM Disc Dynamic Area is not supported.

Area 6: Free pool

The Free Pool is a historic artifact of the memory management system on RISC OS. Together with the application space, these two areas are the primary pools of memory. Resizing the application space is not possible, and changes to the memory available must be made by changing the size of the free pool. Reducing the size of the free pool increases the memory available to applications and vice-versa.

Support

RISC OS 5 and Select: The Free pool is supported by all versions of RISC OS from 3.5 onward.

RISC OS Pyromaniac: The Free pool is not supported.

Area 7: VRAM rescue

The VRAM rescue area was introduced to allow recovery from poor memory speed of the VRAM. On some systems the VRAM used for screen memory was available for use as regular memory, but in that configuration it was not as fast as regular memory - because it was shared with the screen. The VRAM rescue area is a Kernel managed region which is used to move pages around in such cases.

Support

RISC OS Select: The VRAM rescue area is supported up to RISC OS 4.3.

RISC OS 5: Unclear.

RISC OS Pyromaniac: The VRAM rescue area is not supported.

Area 8: Kernel buffers

The Kernel buffers area is a dedicated area used by the Kernel to manage larger blocks of memory which are required by the system. It can be considered a dedicated extension of the memory previously used by the System Heap. By being a separate area, contention for memory regions and interrupt behaviour can be controlled independent of the main system heap.

Support

RISC OS Select: The Kernel buffers area is present from RISC OS 4.0 onward.

RISC OS 5: Unclear.

RISC OS Pyromaniac: The Kernel buffers area is not supported.

Area 9: Reserved for future expansion

This area is reserved for future expansion.

Area 10: Abort SVC and IRQ stack copy

The Abort SVC and IRQ stack copy area is used by the Kernel to take a copy of the SVC and IRQ stacks when an abort occurs. This information is available to Privileged Backtrace Structure (PBTS) tools, such as BTSDump. The dynamic area contains a copy of the entire SVC stack, followed by the entire IRQ stack, during the processing of an abort within a privileged mode. The registers and other parameters at the time of the abort can be obtained from the PBTS chain. The area is read only in USR mode, and should only be read by diagnostic tools.

Support

RISC OS Select: The Abort stack copy area is present from RISC OS Select 3 onward.

RISC OS 5: The Abort stack copy area is not supported by RISC OS 5.

RISC OS Pyromaniac: The Abort stack copy area is not supported.

Area 11: Operating system ROM

The ROM is mapped into a named region of memory. In earlier versions of RISC OS it was necessary to 'know' where the ROM lived in memory, as this was an anonymous area of memory. Modern versions of RISC OS map this region as a dynamic area so that it is not special and can be located in a standard manner.

Support

RISC OS Select: The OS ROM area is present from RISC OS Select 3 onward.

RISC OS 5: The OS ROM area is not supported by RISC OS 5.

RISC OS Pyromaniac: The OS ROM area is supported by all versions of RISC OS Pyromaniac.

Area 12: SWI dispatch and IRQ workspace

The SWI dispatch and IRQ workspace area is used by the Kernel to manage the core SWI and IRQ handling. In earlier versions of RISC OS, this was an anonymous area, and clients would need to know about its location in a given system. Modern versions of RISC OS map this as a dynamic area so that it is not special and can be located in a standard manner.

This is the region which has previously been described as 'Cursor/System/Sound' within the Task Manager display.

Support

RISC OS Select: The SWI dispatch and IRQ workspace area is present from RISC OS Select 3 onward.

RISC OS 5: The SWI dispatch and IRQ workspace area is not supported by RISC OS 5.

RISC OS Pyromaniac: The SWI dispatch and IRQ workspace area is not supported.

Area 13: SVC stack

The SVC stack is used by the Kernel and extension modules. In earlier versions of RISC OS, this was an anonymous area, and clients would need to know about its location in a given system, or infer it from documented properties (it is guaranteed to be based at a megabyte boundary). Modern versions of RISC OS map this as a dynamic area so that it is not special and can be located in a standard manner.

Support

RISC OS Select: The SVC stack area is present from RISC OS Select 3 onward.

RISC OS 5: The SVC stack area is not supported by RISC OS 5.

RISC OS Pyromaniac: The SVC stack area is supported by all versions.

Area 14: IRQ stack

The IRQ stack is used by the Kernel and extension modules for interrupt handling. In earlier versions of RISC OS, this was an anonymous area, and clients would need to know about its location in a given system, or infer it from documented properties (it is guaranteed to be based at a megabyte boundary). Modern versions of RISC OS map this as a dynamic area so that it is not special and can be located in a standard manner.

Support

RISC OS Select: The IRQ stack area is present from RISC OS Select 3 onward.

RISC OS 5: The IRQ stack area is not supported by RISC OS 5.

RISC OS Pyromaniac: The IRQ stack area is supported from 7.16 onward.

Area 15: UND stack

The UND stack is used by the Kernel and extension modules for processing of undefined instructions. This is primarily used by the FPEmulator module. In earlier versions of RISC OS, this was an anonymous area, and clients would need to know about its location in a given system. Modern versions of RISC OS map this as a dynamic area so that it is not special and can be located in a standard manner.

Support

RISC OS Select: The UND stack area is present from RISC OS Select 3 onward.

RISC OS 5: The UND stack area is not supported by RISC OS 5.

RISC OS Pyromaniac: The UND stack area is supported from 7.08 onward.

Area 16: Level 2 Page Tables

The level 2 page table area provides an explicit description of the location of the page tables. The address of the level 1 page tables can be inferred from the address of the ROM within the level 2 page tables. Because the ROM is mapped using Level 1 page table entries of 1M each, the space which would have been occupied by its Level 2 page table entries is 'spare'. This is where the Level 1 Page Table entries are mapped. Its size will appear to be 0 because it is sparsely managed by the Kernel.

In earlier versions of RISC OS, this was an anonymous area, and clients would need to know about its location in a given system. Modern versions of RISC OS map this as a dynamic area so that it is not special and can be located in a standard manner.

Support

RISC OS Select: The Level 2 Page Tables area is present from RISC OS Select 3 onward.

RISC OS 5: The Level 2 Page Tables area is not supported by RISC OS 5.

RISC OS Pyromaniac: The Level 2 Page Tables area is not supported.

Area 17: Operating system page tables (SoftCAM)

The Kernel manages its view of the page tables in this dynamic area. This is a mapping of the page tables from logical to physical address, and a list of pages which can be mapped or unmapped.

Support

RISC OS Select: The OS Page Tables area is present from RISC OS Select 3 onward.

RISC OS 5: The OS Page Tables area is not supported by RISC OS 5.

RISC OS Pyromaniac: The OS Page Tables area is not supported.

Area 18: System Initialisation area

The System Initialisation area is used by RISC OS Select on to communicate between the System Initialisation system (which provides minimal system information and control) and the Kernel.

Support

RISC OS Select: The System Initialisation area is present from RISC OS Select 3 onward.

RISC OS 5: The System Initialisation area is not supported by RISC OS 5.

RISC OS Pyromaniac: The System Initialisation area is not supported.

Area 48: Zero Page

The Zero Page dynamic area describes the memory region between &0 and &8000. In earlier versions of RISC OS, this was an anonymous area. Modern versions of RISC OS map this as a dynamic area so that it is not special and can be located in a standard manner.

Support

RISC OS Select: The Zero Page area is not supported by RISC OS Select.

RISC OS 5: The Zero Page area is not supported by RISC OS 5.

RISC OS Pyromaniac: The Zero Page area is supported from 7.08 onward.

Area 49: High CPU vectors

The High CPU vectors area describes the location of the CPU exception vectors. These were not used in earlier versions of RISC OS, so this area was not mapped.

Support

RISC OS Select: The High CPU vectors area is not supported by RISC OS Select.

RISC OS 5: The High CPU vectors area is not supported by RISC OS 5.

RISC OS Pyromaniac: The High CPU vectors area is supported from 7.08 onward.