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.
Value | Meaning |
---|---|
-1 | Application space |
0 | System Heap |
1 | Relocatable Module Area (RMA) |
2 | Screen Area |
3 | Sprite Area |
4 | Font Cache |
5 | RAM Filing System |
6 | Free pool |
7 | VRAM rescue |
8 | Kernel buffers |
9 | Reserved for future expansion |
10 | Abort SVC and IRQ stack copy |
11 | Operating system ROM |
12 | SWI dispatch and IRQ workspace |
13 | SVC stack |
14 | IRQ stack |
15 | UND stack |
16 | Level 2 Page Tables |
17 | Operating system page tables (SoftCAM) |
18 | System Initialisation area |
48 | Zero Page |
49 | High CPU vectors |
50 | Utility executables |
51 | ABT stack |
Area -1: Application space
The application space holds the user application. It is documented in the chapter Memory Management and Application Memory.
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.
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.
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 some later 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.
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.
Area 3: Sprite Area
The system sprite area is managed by the Kernel's sprite system. It is documented in the chapter Modules.
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.
The Sprite Area is supported by SpriteUtils when enabled in its configuration.
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.
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.
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.
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.
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.
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.
The VRAM rescue area is supported up to RISC OS 4.3.
Unclear.
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.
Unclear.
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.
The Abort stack copy area is present from RISC OS Select 3 onward.
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.
The OS ROM area is present from RISC OS Select 3 onward.
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.
The SWI dispatch and IRQ workspace area is present from RISC OS Select 3 onward.
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.
The SVC stack area is present from RISC OS Select 3 onward.
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.
The IRQ stack area is present from RISC OS Select 3 onward.
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.
The UND stack area is present from RISC OS Select 3 onward.
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.
The Level 2 Page Tables area is present from RISC OS Select 3 onward.
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.
The OS Page Tables area is present from RISC OS Select 3 onward.
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.
The System Initialisation area is present from RISC OS Select 3 onward.
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.
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.
The High CPU vectors area is supported from 7.08 onward.
Area 50: Utility executables
The Utility executables area is used to store Utility files which are being run by the system. Prior to RISC OS Pyromaniac 7.46, these were always executed from the module area.
The Utility Executables area is supported from 7.46 onward.
Area 51: ABT stack
The ABT stack is used by the Kernel and extension modules for processing of aborts (data aborts and prefetch aborts). 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.
The ABT stack area is supported from 7.61 onward.