Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
wiki1230: Memmgr_source_guide (Version 1)

Quick Guide to the Memory Manager Source#



Where is the source?#


What are the good bits?#

Functional Area Related Files
virtual memory manager services/system/memmgr/vmm*.*
physical memory manager services/system/memmgr/pmm*.*
memory manager data type implementations services/system/memmgr/mm*.*
memory manager process services/system/memmgr/memmgr*.*
CPU-specific implementation details services/system/memmgr/<CPU>/*


Overview#

fixme: do we want this section? Do we want an overview of the architecture here, or do we just want a link to Brian's document?

While the OS is written in C, the memory manager is designed and implemented using object-oriented concepts. There is a global variable called memmgr that defines an object. The type of the object is struct memmgr_entry. This structure defines a few data fields and a whole bunch of functions.

Throughout the code we make a lot of references to the memmgr variable. For example, when we need to change address spaces we call memmgr.aspace().

But what's behind the memmgr variable? It could be any of a couple of different memory manager implementations. In practice, it's always the virtual memory manager (implemented in services/system/memmgr/vmm*.*) but it's possible that it could be the physical memory manager (services/system/memmgr/pmm*.*) or the runtime-executive memory manager (services/system/ker/emm*.* and services/system/ker/smm*.*).

When the system initializes, one of those memory managers is assigned to the memmgr variable. As I said, in practice it's always the virtual memory manager but the others are possible.

For a more detailed look at the design of the memory manager, refer to fixme: link to Brian's memory manager document