Symbian3/PDK/Source/GUID-4862EA2E-6BFE-5E11-B527-7EBA94BB0EA2-GENID-1-10-1-15-1-1-7-1-1-5-1-8-1-11-1-7-1-4-1-13-1.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Tue, 30 Mar 2010 11:56:28 +0100
changeset 5 f345bda72bc4
permissions -rw-r--r--
Week 12 contribution of PDK documentation_content. See release notes for details. Fixes Bug 2054, Bug 1583, Bug 381, Bug 390, Bug 463, Bug 1897, Bug 344, Bug 1319, Bug 394, Bug 1520, Bug 1522, Bug 1892"

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE task
  PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="GUID-4862EA2E-6BFE-5E11-B527-7EBA94BB0EA2-GENID-1-10-1-15-1-1-7-1-1-5-1-8-1-11-1-7-1-4-1-13-1" xml:lang="en"><title>OBY
Tutorial </title><shortdesc>Describes the new demand paging keywords available to the OBY.
file. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
<context id="GUID-E46B9321-49E9-545D-B38B-CF2BB7AD8E19-GENID-1-10-1-15-1-1-7-1-1-5-1-8-1-11-1-7-1-4-1-13-1-3-1"><p><b>Introduction</b></p><p>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. </p><p> 
        With the addition of writable data paging, the list of paging modifiers
is shown below:   </p><p><b>Procedure</b></p><p>          With the addition
of writable data paging, the list of paging modifiers is shown below:   </p><table id="GUID-1DB56A5D-823B-4E26-80A3-C1362B309773-GENID-1-10-1-15-1-1-7-1-1-5-1-8-1-11-1-7-1-4-1-13-1-3-1-6">
<tgroup cols="2"><colspec colname="col1"/><colspec colname="col2"/>
<tbody>
<row>
<entry><p><b>Keyword</b></p></entry>
<entry><p><b>Behaviour on Symbian platform</b></p></entry>
</row>
<row>
<entry><p>paged</p></entry>
<entry><p> Enables code and data paging  </p></entry>
</row>
<row>
<entry><p>unpaged</p></entry>
<entry><p> Disables code and data paging</p></entry>
</row>
<row>
<entry><p>pagedcode</p></entry>
<entry><p> Enables code paging</p></entry>
</row>
<row>
<entry><p> unpagedcode</p></entry>
<entry><p>Disables code paging</p></entry>
</row>
<row>
<entry><p>pageddata</p></entry>
<entry><p>Enables data paging</p></entry>
</row>
<row>
<entry><p>unpageddata</p></entry>
<entry><p> Disables data paging</p></entry>
</row>
</tbody>
</tgroup>
</table><p> These modifiers appear in OBY files at the end of statements relating
to user-side ROM objects i.e. <codeph>'file=', 'dll=', 'data=' and 'secondary='</codeph>statements).
For example:  </p><codeblock xml:space="preserve">file=ABI_DIR\DEBUG_DIR\MyLibrary.dll \sys\bin\MyLibrary.dll unpaged</codeblock><p>The
data paging keywords only make sense when applied to executable binary files.
  </p><p>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 <xref href="target=GUID-4862EA2E-6BFE-5E11-B527-7EBA94BB0EA2.dita">pagingoverride</xref>, <codeph>codepagingoverride</codeph> or <codeph>datapagingoverride</codeph> keywords are used in the MMP file, in the case
of <xref href="target=GUID-4862EA2E-6BFE-5E11-B527-7EBA94BB0EA2.dita">nopaging</xref> 
or <xref href="target=GUID-4862EA2E-6BFE-5E11-B527-7EBA94BB0EA2.dita">alwayspage</xref> .</p> </context>
<result id="GUID-EA5E0DDD-4354-5DD4-89D2-462A0B0E8A81-GENID-1-10-1-15-1-1-7-1-1-5-1-8-1-11-1-7-1-4-1-13-1-3-2"><p>Executing the buildrom
command builds with no errors or warnings. </p> </result>
<example id="GUID-ED6203BD-3890-5F27-8BAA-AFE3B0FAA518-GENID-1-10-1-15-1-1-7-1-1-5-1-8-1-11-1-7-1-4-1-13-1-3-3"><title>OBY file example</title> <p>An
example of an OBY file that uses the new demand paging keywords is given below: </p> <codeblock id="GUID-84F82A9B-8F29-5A58-A9C3-7DEB19D5B9ED-GENID-1-10-1-15-1-1-7-1-1-5-1-8-1-11-1-7-1-4-1-13-1-3-3-3" xml:space="preserve">// 
// 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 &amp;&amp; !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
</codeblock> </example>
<postreq id="GUID-6B9041F7-79A6-5CCA-9B4D-B8EF377FD378-GENID-1-10-1-15-1-1-7-1-1-5-1-8-1-11-1-7-1-4-1-13-1-3-4"><p>The next step is
to <xref href="GUID-6B9041F7-79A6-5CCA-9B4D-B8EF377FD378-GENID-1-10-1-15-1-1-7-1-1-5-1-8-1-11-1-7-1-4-1-13-1-3-4.dita">Build the writable
data paging ROM</xref>  </p> </postreq>
</taskbody></task>