Virtual Memory Map in Symbian OS

The basic map of virtual memory usage in Symbian OS is shown in Figure 3.2.2

In Figure 3.2, the two memory areas of interest are the home area and the run area. The home area is where the data chunks for a process are kept when the process has been launched but is not the currently active process. The home area is a protected region of memory-only kernellevel code can read and write it. When a thread is scheduled to execute, the data chunks associated with its process are moved (remapped via the MMU) from the home area of virtual memory to the area known as the run area, and thread execution starts.

You can think of the run area as a sort of stage for processes, and the home area as the backstage area. When a process is ready to perform, it goes on stage - that is, its data chunks are moved to the run area, and the process executes.

Why aren't the process data chunks simply left in the home area when the process executes? The reason is that the process code always expects its data to reside in the same place. This is because the linker places data

Home Area

ROM, MMU Page Table, Hardware

Run Area

CPU Use

Oxffffffff

0x80000000

0x3fffffff

0x00400000 0x00000000

Figure 3.2 Virtual Memory Map

2 Note that different memory organizations are best suited to different CPU architectures. Symbian OS describes these organizations as memory models and allows the device creator to select the most appropriate model for their chosen hardware. Currently the most common organization is the moving memory model that is appropriate for ARM v5 CPU architectures, the moving memory model is considered in this book and what is described in this section. The multiple memory model is likely to be used on an ARMv6 CPU architecture, and is not covered in this book.

address references (when code references a static variable, for example) in the code image at build time. Thus, the process code expects its data in the single place specified by the linker (i.e., the run area) - no matter what instance of the program is running. There are also other reasons for having movable chunks like this, including moving in the memory map in order to give it space to grow.

Note, however, that code chunks are never moved to the run area. This is because, unlike data chunks, you do not have separate copies of code for each process instance and the code can be run from its location in the home area.

Remapping the data of a running process to a common virtual address area is not unique to Symbian OS. Many other multitasking operating systems do this as well - although the memory map and switching details are different.

0 0

Post a comment

  • Receive news updates via email from this site