Adaptation/GUID-16423056-C435-5C4D-BE3D-4A15F95F7F68.dita
author Graeme Price <GRAEME.PRICE@NOKIA.COM>
Fri, 15 Oct 2010 14:32:18 +0100
changeset 15 307f4279f433
permissions -rw-r--r--
Initial contribution of the Adaptation Documentation.

<?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-16423056-C435-5C4D-BE3D-4A15F95F7F68" xml:lang="en"><title>Configuration
Tutorial </title><shortdesc>Describes the steps required in producing a ROM that will work
with Writable Data Paging (WDP). </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
<context id="GUID-77EC86D2-A74E-574C-868E-4304668A3863"><p>Writable Data Paging
(WDP) allows allocated memory that is to be written e.g. stacks and heaps
to be paged in and out of the RAM pool. </p> </context>
<steps id="GUID-F19DB5BA-CC38-5C2D-A337-12F4EB85F9E3">
<step id="GUID-DE8E7A0E-DB35-58B5-A5AA-85A2BFC7301C"><cmd/>
<info>It is recommended to enable WDP kerneltrace warnings if the build is
being migrated to a data paged system. </info>
<info>This is done by setting trace bit number 60 of the kernel trace flags. </info>
<info>The UDEB version of the build has to be used in order for tracing messages
to be available. </info>
<info>Once the demand paging build is stable, then the REL version of the
build can be used. </info>
</step>
<step id="GUID-D5F19B3A-3520-576A-8D59-7E1BF29AB97B"><cmd/>
<info>Set the paging policy for pages of the core ROM image. This is done
by using the datapagingpolicy and pagingpolicy keywords in the 'ROM_IMAGE[0]
{}' block. </info>
</step>
<step id="GUID-C1DF8A12-8CB4-5E71-8247-7B8F29EE66D5"><cmd/>
<info>Next, the data paging for ROFS images is enabled by using datapagingoverride
and pagingoverride keywords for each ROFS partition that contains executables
that should use data paging. This is done by adding the keywords into each
relevant 'ROM_IMAGE[&lt;partion&gt;] {}' block. </info>
</step>
<step id="GUID-A13FBB84-3885-5A49-9BA9-698F65CBF1BF"><cmd/>
<info>In order for a ROM to support data paging, it has to have a media driver
that supports data paging. </info>
</step>
</steps>
<result id="GUID-9565A808-C86C-57CF-931E-2684A382D5E2"><p>The output of this
tutorial will be a configuration that allows the ROM build to use demand paging. </p> <p> <note> This
tutorial only describes how to configure the general paging behaviour.</note> </p> </result>
<example id="GUID-9A892A74-0823-57D7-A146-BC8E14508B99"><title>Example OBY
configuration file</title> <p>Below is a typical OBY file that uses data paging,
XIP ROM and code paging: </p> <codeblock id="GUID-1A753A2E-3846-51BC-AF30-06A53785589C" xml:space="preserve">// MyDPConfig.oby 
// 
// The section below is used to specify if XIP ROM paging is to be implemented.
#if !defined PAGED_ROM 
#define PAGED_ROM 
#endif 

// The section below is used when code paging is to be 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 RAM pages for writable data paging.
ROM_IMAGE[0] { 
pagedrom 
compress 
//                 Min   Max   Young/Old 
//                 Live  Live  Page 
//                 Pages Pages Ratio 
demandpagingconfig 256         512            3 
pagingoverride defaultpaged 

// The section below specifies if the default paging policy is to used.
#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 
</codeblock> <p>The OBY file that determined the start of the primary ROFS
partition, for example base.iby, would then be adjusted thus: </p> <codeblock id="GUID-7C438B69-DEB8-5598-A338-9707FA23F758" xml:space="preserve">
#if defined(_NAND) || defined(_NAND2) 
#if !defined PAGED_ROM || defined CODE_PAGING_FROM_ROFS || defined USE_DATA_PAGING 
REM Start of ROFS image 
ROM_IMAGE[1] { 
#endif 
#endif </codeblock> <p> <note> Make sure to include media drivers that can
support writable data paging.</note>  </p> </example>
<postreq id="GUID-DFC44549-2B7B-5D4F-9686-7E7BEA7E430A"><p>This tutorial only
covers the configuration of the general demand paging parameters. To see how
to make individual executables pageable see (<xref href="GUID-16423056-C435-5C4D-BE3D-4A15F95F7F68.dita#GUID-16423056-C435-5C4D-BE3D-4A15F95F7F68/GUID-9A892A74-0823-57D7-A146-BC8E14508B99">the
mmp configuration tutorial</xref>). </p> <p>The next step is to <xref href="GUID-6B9041F7-79A6-5CCA-9B4D-B8EF377FD378.dita">build
the writable data paging ROM</xref>  </p> </postreq>
</taskbody><related-links>
<link href="GUID-6B9041F7-79A6-5CCA-9B4D-B8EF377FD378.dita"><linktext>Building
ROM tutorial</linktext></link>
</related-links></task>