Memory objects were introduced to share the physical memory between processes allowing to identifying and defining the sets of memory pages or segments of physical memory on non-MMU architectures. When one process maps object into its memory map it occupies some physical pages.

Process address space

Process address spaces is constituted by set of mapped objects. In traditional operating system objects corresponds with operating system objects like files or devices or with anonymous objects representing set of dynamically allocated pages. In Phoenix-RTOS objects are defined by operating system servers and are referenced by oid_t identifiers. Each oid_t consists of server port number and in-server object identifier.

The process address space in the traditional operating system (e.g. BSD) is graphically presented below.

BSD memory subsystem

Memory objects were introduced in Mach operating system. They were quickly derived from it and implemented in UN*X BSD. The Mach and BSD implementations were not optimal because of the way of implementation of copy-on-write strategy used to copy pages when processes are forked.

The structure of memory BSD/Mach memory subsystem in process context is presented below.

The lowest layer is pmap.


Object mapping

The mmap() function maps object into the address space starting from address specified as function argument. Other function arguments define the size of the mapping, the attributes of the finally created memory segment, the object handle and flags determining the function behavior. If fixed mapping is specified in the flags argument mapping tries to map object at specified address. If address range of requested mapping overlaps with existing mapping the function will fail.