ChorusOS 4.0 Introduction

Memory Region Descriptors

The ChorusOS operating system offers various services which enable an actor to extend its address space dynamically by allocating memory regions. An actor may also shrink its address space by freeing memory regions. An area of memory to be allocated or freed is described to the system through a region descriptor of the following type:

typedef struct {
    VmAddr    startAddr;
    VmSize    size;
    VmFlags   options;
    VmAddr    endAddr;
    void*     opaque1;
    VmFlags   opaque2;
} KnRgnDesc;

The startAddr field defines the starting address of the memory region. The size field defines its length expressed in bytes. The options field enables a low level control on the attributes of the memory region to be allocated. The opaque1 and opaque2 fields should be set to NULL if they are not being used by the application.

The options field is a combination of flags, of which the following are the most important:

On a ChorusOS operating system configured with the Virtual Memory feature, further options are available. The most important one allows control of the swapping policy to be applied to the pages of the created region: