OBY Tutorial

Describes the new demand paging keywords available to the OBY. file.

Introduction

The new keywords that are available in the OBY file are used to specify whether an object is paged, and if so what kind of demand paging it supports.

With the addition of writable data paging, the list of paging modifiers is shown below:

Procedure

With the addition of writable data paging, the list of paging modifiers is shown below:

Keyword

Behaviour on Symbian platform

paged

Enables code and data paging

unpaged

Disables code and data paging

pagedcode

Enables code paging

unpagedcode

Disables code paging

pageddata

Enables data paging

unpageddata

Disables data paging

These modifiers appear in OBY files at the end of statements relating to user-side ROM objects i.e. 'file=', 'dll=', 'data=' and 'secondary='statements). For example:

file=ABI_DIR\DEBUG_DIR\MyLibrary.dll \sys\bin\MyLibrary.dll unpaged

The data paging keywords only make sense when applied to executable binary files.

For an executable file, the use of one of the above keywords in the oby file will override the paging settings in the mmp file. However this will not be true, if the pagingoverride, codepagingoverride or datapagingoverride keywords are used in the MMP file, in the case of nopaging or alwayspage .

Executing the buildrom command builds with no errors or warnings.

OBY file example

An example of an OBY file that uses the new demand paging keywords is given below:

// 
// MyDPConfig.oby 
//
// The section below, is used to specify if XIP ROM paging is implemented.  
#if !defined PAGED_ROM 
#define PAGED_ROM 
#endif
 
// The sections below, is used to specify if code paging is implemented.
#if !defined USE_CODE_PAGING 
// Comment out the next line if code paging is wanted 
#define USE_CODE_PAGING 
#endif
 
#if !defined CODE_PAGING_FROM_ROFS 
// Comment out the next line if code paging from primary rofs is wanted 
#define CODE_PAGING_FROM_ROFS 
#endif 

// The section below, is used to configure the writable data paging and to specify what the 
// default paging behaviour is to be. 
ROM_IMAGE[0] { 
pagedrom 
compress 
//                 Min   Max   Young/Old 
//                 Live  Live  Page 
//                 Pages Pages Ratio 
demandpagingconfig 256   512   3 
pagingoverride defaultpaged

// This section specifies what the default paging behaviour is to be for code paging. 
#if defined USE_CODE_PAGING && !defined USE_DATA_PAGING 
codepagingpolicy defaultpaged 
#endif 

#if defined USE_DATA_PAGING 
#if defined USE_CODE_PAGING 
codepagingpolicy defaultpaged 
#endif 

datapagingpolicy defaultpaged 
#endif 
}

#if defined CODE_PAGING_FROM_ROFS || defined USE_DATA_PAGING 
ROM_IMAGE[1] { 
pagingoverride defaultpaged 
}
#endif 

// Now specify the files to be used
file=ABI_DIR\DEBUG_DIR\MyLibrary.dll \sys\bin\MyLibrary.dll unpaged