|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D" xml:lang="en"><title>Base |
|
13 Starter Technology</title><shortdesc>This topic describes the purpose of the Base Starter, and which |
|
14 parts of it can be customised by phone developers.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
15 <p>The purpose of the Base Starter is to: </p> |
|
16 <ul> |
|
17 <li id="GUID-D6418767-A7E8-5C3F-A12D-57B038D6DDEA"><p>Define a handset's local |
|
18 drives </p> </li> |
|
19 <li id="GUID-2611D5AC-D6FD-5957-A359-11D5A7200B2F"><p>Define what file systems |
|
20 (<filepath>.FSY</filepath>) and file extensions (<filepath>.FXT</filepath>) |
|
21 are to be mounted on those drives </p> </li> |
|
22 <li id="GUID-96772B04-8CC5-5248-A015-48809163B6EA"><p>Associate drive letters |
|
23 with drives </p> </li> |
|
24 <li id="GUID-36BFBCDC-0A12-53E0-8DF6-97606089A996"><p>Modify drive start-up |
|
25 behaviour </p> </li> |
|
26 <li id="GUID-C8914C2A-4FEA-5367-9C8C-5BD1B8926416"><p>Enable <xref href="GUID-89BCF9A5-ABBD-5523-BA76-FDB00B806A30.dita">fair |
|
27 scheduling and file caching</xref> on a drive by drive basis. </p> </li> |
|
28 </ul> |
|
29 <p>Handset manufacturers need to customise the Base Starter as part of the |
|
30 process of porting Symbian OS to a new device. <xref href="GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D.dita#GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D/GUID-BF793E4E-8303-5C94-A297-52C5AD781B6B">Mapping |
|
31 local drives</xref> is the most important part of this process, but <xref href="GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D.dita#GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D/GUID-89ED1556-60A5-5030-8946-7156656B7771">customisation |
|
32 using TFSStartup</xref> is also possible. </p> |
|
33 <p>Note that there are some <xref href="GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D.dita#GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D/GUID-AC49186C-F69B-5D5B-8515-3CF8CD91EAF4">activities |
|
34 that the Base Starter does not do</xref> </p> |
|
35 <section id="GUID-BF793E4E-8303-5C94-A297-52C5AD781B6B"><title>Mapping local |
|
36 drives</title> <p>There are two ways to do this: </p> <ul> |
|
37 <li id="GUID-F9A1D807-DFF0-563E-B792-0C7AE29F16CA"><p> <xref href="GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D.dita#GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D/GUID-2B95B775-1BD1-5256-86D3-CD3FA12447B9">Create local drive mapping files</xref> </p> </li> |
|
38 <li id="GUID-23B391A9-70B1-54F6-A891-422B5C6274DE"><p> <xref href="GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D.dita#GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D/GUID-A195BD51-80C7-5D87-ABA2-8878CC509B84">Use automatic local drive mapping</xref>. </p> </li> |
|
39 </ul> <p id="GUID-2B95B775-1BD1-5256-86D3-CD3FA12447B9"><b>Create local drive mapping |
|
40 files</b> </p> <p>A local drive mapping file is an ASCII text file that explicitly |
|
41 defines the drive letter, file system, and file extension to be associated |
|
42 with a drive. The file contains a set of records, one for each drive, that |
|
43 specifies this information. Records are also referred to as drive mappings. </p> <p>The |
|
44 file is created as part of your hardware variant's source tree, but is copied |
|
45 into a standard location in your ROM filing system when you build the ROM. </p> <p>A |
|
46 drive mapping file has a formal structure; the main rules are: </p> <ul> |
|
47 <li id="GUID-2F5C4942-D39B-5F80-8E31-CAB8E7411554"><p>the file can contain |
|
48 a maximum of 16 different drive mappings </p> </li> |
|
49 <li id="GUID-BA8CB9C2-F3D7-5A06-9385-6FE7B3472B6C"><p>each drive mapping is |
|
50 represented by a separate record; each record occupies one line; each line |
|
51 is separated by the new line character <codeph>\n</codeph> </p> </li> |
|
52 <li id="GUID-D1A6514F-3A2C-5B2E-818B-9933CA98BC1F"><p>information is represented |
|
53 by items separated by at least one blank character </p> </li> |
|
54 <li id="GUID-A6F6AD8B-361F-5DAC-8151-467164281CBD"><p>comments can occupy |
|
55 a whole line or can be added onto the end of a record (i.e. at the end of |
|
56 line). They are marked by a <codeph>#</codeph> character that must precede |
|
57 the start of the comment text. </p> </li> |
|
58 </ul> <p>A record, or drive mapping, has the following items, each separated |
|
59 by at least one blank character. Each item must appear in the order described: </p> <codeblock id="GUID-EC69C9D7-C7C3-5687-AB75-2157ABF012D5" xml:space="preserve"><drive_letter> <drive_number> <file_system_filename> <file_system> <file_extension_filename> <flags></codeblock> <table id="GUID-D09A4483-1819-56A5-96C5-167D59C79E45"> |
|
60 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
61 <tbody> |
|
62 <row> |
|
63 <entry><p> <codeph> <drive_letter></codeph> </p> </entry> |
|
64 <entry><p>A single character between <codeph>A</codeph> and <codeph>Z</codeph> followed |
|
65 by a colon. </p> </entry> |
|
66 </row> |
|
67 <row> |
|
68 <entry><p> <codeph> <drive_number></codeph> </p> </entry> |
|
69 <entry><p>The local drive number associated with the drive letter . </p> </entry> |
|
70 </row> |
|
71 <row> |
|
72 <entry><p> <codeph><file_system_filename></codeph> </p> </entry> |
|
73 <entry><p>The filename of the file system that is to be mounted on the drive. |
|
74 This should be the filename without the <filepath>.FSY</filepath> extension. |
|
75 If it is necessary to omit a file system file name for any reason, then this |
|
76 item should contain the null character: <codeph>0</codeph>. </p> </entry> |
|
77 </row> |
|
78 <row> |
|
79 <entry><p> <codeph> <file_system></codeph> </p> </entry> |
|
80 <entry><p>The name of the file system as implemented by <codeph><file_system_filename></codeph>. </p> <p>If |
|
81 the file system name is the same as the file name, as represented by the <codeph><file_system_filename></codeph> item, |
|
82 then supply the null character <codeph>0</codeph>. [Internally, the file system |
|
83 name is sometimes referred to as the object name.] </p> <p>Symbian OS supplies |
|
84 the following file systems: </p> <ul> |
|
85 <li id="GUID-BB05125F-DEAA-5881-8B5D-27CF2735598E"><p> <codeph> FAT</codeph> </p> </li> |
|
86 <li id="GUID-F9CAA425-F382-5131-A2CE-A8813EC2844C"><p> <codeph> ROFS</codeph> - |
|
87 read/only file system </p> </li> |
|
88 <li id="GUID-1C9ED727-60A6-5835-B10B-BC5DF0C11763"><p> <codeph>LFFS</codeph> - |
|
89 logging flash file system </p> </li> |
|
90 <li id="GUID-B175831B-3633-5B56-AD5A-76218DFA6032"><p> <codeph> COMP</codeph> - |
|
91 composite file system (but see the description of the <codeph>FS_COMPOSITE</codeph> flag |
|
92 below) </p> </li> |
|
93 </ul> <p>Handset manufacturers may supply other file systems. </p> </entry> |
|
94 </row> |
|
95 <row> |
|
96 <entry><p> <codeph> <file_extension_filename></codeph> </p> </entry> |
|
97 <entry><p>The filename of the file extension that is to be mounted on the |
|
98 drive. This should be the filename without the <filepath>.FXT</filepath> extension. |
|
99 If it is necessary to omit a file extension file name for any reason, then |
|
100 this item should contain the null character: <codeph>0</codeph>. </p> </entry> |
|
101 </row> |
|
102 <row> |
|
103 <entry><p> <codeph><flags></codeph> </p> </entry> |
|
104 <entry><p>A set of <i>mount</i> flags that modify the start-up behaviour of |
|
105 the local drive. More than one flag can be specified, each separated by a |
|
106 comma, with no intervening blank characters. If no flags apply, then the null |
|
107 character: <codeph>0</codeph> must be coded. </p> <p><table id="GUID-E1FCA3ED-EF56-5C3E-9596-CBBD7DF53AE1"> |
|
108 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
109 <tbody> |
|
110 <row> |
|
111 <entry><p> <codeph>FS_FORMAT_ALWAYS</codeph> </p> </entry> |
|
112 <entry><p>Formats the drive as soon as it has been mounted. </p> </entry> |
|
113 </row> |
|
114 <row> |
|
115 <entry><p> <codeph>FS_FORMAT_COLD</codeph> </p> </entry> |
|
116 <entry><p>Formats the drive as soon as it has been mounted if the device is |
|
117 performing a cold boot. This is generally required for internal RAM drives. </p> </entry> |
|
118 </row> |
|
119 <row> |
|
120 <entry><p> <codeph> FS_FORMAT_CORRUPT </codeph> </p> </entry> |
|
121 <entry><p>Formats the drive, if it is found to be corrupt when mounted. </p> </entry> |
|
122 </row> |
|
123 <row> |
|
124 <entry><p> <codeph> FS_DISMNT_CORRUPT</codeph> </p> </entry> |
|
125 <entry><p>Dismounts the drive, if it is found to be corrupt when mounted. |
|
126 The local drive mapping remains unaltered and the associated file system file |
|
127 is not unloaded. </p> </entry> |
|
128 </row> |
|
129 <row> |
|
130 <entry><p> <codeph> FS_SWAP_CORRUPT-<drv></codeph> </p> </entry> |
|
131 <entry><p>Dismounts the drive, if it is found to be corrupt when mounted, |
|
132 and swaps the mappings for this drive with the alternative drive <codeph><drv></codeph>, |
|
133 and remounts both. </p> <p>The alternative drive <codeph><drv></codeph> must |
|
134 be specified, and must follow a '<codeph>-</codeph>' character, which follows |
|
135 the <codeph>FS_SWAP_CORRUPT</codeph> symbol. </p> <p>For example, to swap |
|
136 with drive <filepath>Y:</filepath>, specify: </p> <codeblock id="GUID-9CC3B772-73D6-5F12-959A-54090AEE7EB1" xml:space="preserve">FS_SWAP_CORRUPT-Y</codeblock> <p>This |
|
137 option is commonly used when handling corrupt flash user-data drives on <filepath>C:</filepath>. |
|
138 The corrupt drive is mapped to another drive letter – allowing data to be |
|
139 extracted from it. The <filepath>C:</filepath> drive is replaced by a RAM |
|
140 disk – providing a temporary work disk for the OS, while the main one is restored. |
|
141 Note that a mapping file must not specify more than one drive for swapping, |
|
142 i.e. there can only be one occurrence of <codeph>FS_SWAP_CORRUPT</codeph> flag |
|
143 per mapping file. </p> <p>Both drives involved in the swap must be internal |
|
144 drives. </p> </entry> |
|
145 </row> |
|
146 <row> |
|
147 <entry><p> <codeph>FS_SYNC_DRIVE</codeph> </p> </entry> |
|
148 <entry><p>Mounts this drive as a synchronous drive. This means that requests |
|
149 are handled in the main file server thread rather than in a dedicated drive |
|
150 thread. This option is normally only specified for internal RAM drives. </p> </entry> |
|
151 </row> |
|
152 <row> |
|
153 <entry><p> <codeph> FS_SCANDRIVE</codeph> </p> </entry> |
|
154 <entry><p>Runs <filepath>Scandrive</filepath>, once mounted, but only if the |
|
155 rugged file system is enabled. </p> </entry> |
|
156 </row> |
|
157 <row> |
|
158 <entry><p> <codeph>FS_COMPOSITE</codeph> </p> </entry> |
|
159 <entry><p>Marks the drive as contributing to the composite file system. The |
|
160 composite file system allows multiple local drives to be overlaid with each |
|
161 other, and with the core OS ROM image, and to make them appear as one drive. </p> <p>Files |
|
162 in one drive can add to, replace, or hide (i.e. logically remove) files in |
|
163 another drive </p> <p>There are number of rules: </p> <ul> |
|
164 <li id="GUID-73C84D80-12E4-5EB2-9661-6F802696F4E8"><p>the drive letter must |
|
165 always be Z: </p> </li> |
|
166 <li id="GUID-B8BA7BF4-5451-5B14-80F7-44E37DB08B23"><p>if the file system is |
|
167 omitted, i.e. both <codeph><file_system_filename></codeph> and <codeph><file_system></codeph> are |
|
168 set to '0', then the the ROFS file system is assumed, and this can be the <i>only</i> drive |
|
169 marked with <codeph>FS_COMPOSITE</codeph> in a mapping file. </p> </li> |
|
170 <li id="GUID-E64061B1-C789-57D4-BDD2-32548AC9A97B"><p>if the file system is |
|
171 explicitly specified, i.e. <codeph><file_system_filename></codeph> and <codeph><file_system></codeph> are |
|
172 set, then more than one drive can be marked with <codeph>FS_COMPOSITE</codeph>. |
|
173 However, adding a drive that uses a file system other than ROFS is <i>strongly |
|
174 discouraged</i> for performance reasons. </p> </li> |
|
175 <li id="GUID-2B4F9A89-9907-5417-91B3-94E02F212E42"><p>the order of the records |
|
176 is important, as this defines the search order when Symbian OS is working |
|
177 out which files will contribute to the final ROM. The core OS ROM file system |
|
178 (containing the kernel, kernel extensions, media drivers, the file server, |
|
179 file systems and the Base Starter executable) is searched first, followed |
|
180 by the last drive in the mapping file marked with <codeph>FS_COMPOSITE</codeph>, |
|
181 followed by the next last drive marked with <codeph>FS_COMPOSITE</codeph> etc. </p> </li> |
|
182 </ul> <p>Note: the use of <codeph>COMP</codeph> as a <codeph><file_system></codeph> seems |
|
183 to contradict the use of this flag. <codeph>COMP</codeph> was used to specify |
|
184 a composite file system that allowed a <i>single</i> drive to be combined |
|
185 with the ROM file system. For compatibility purposes, and to ensure consistency |
|
186 of syntax, you can still specify <codeph>COMP</codeph> with <codeph>FS_COMPOSITE</codeph> on |
|
187 a drive mapping, but you cannot have any other drive mappings marked as <codeph>FS_COMPOSITE</codeph>. |
|
188 If you specify <codeph>COMP</codeph>, then the underlying file system associated |
|
189 with that drive is assumed to be <codeph>ROFS</codeph>. </p> <p>See <xref href="GUID-E55EE9B5-AC5B-5C67-A23C-DDB3F40D174A.dita">Mounting multiple ROM images |
|
190 as a single ROM drive</xref> for more detail. </p> </entry> |
|
191 </row> |
|
192 <row> |
|
193 <entry><p> <codeph> FS_NO_MOUNT</codeph> </p> </entry> |
|
194 <entry><p>Loads the file specified file system and the specified file extension, |
|
195 and maps the drive as specified, but does not mount the drive. This is often |
|
196 used in conjunction with <codeph>FS_SWAP_CORRUPT</codeph>. It allows the configuration |
|
197 for the alternative drive involved in a swap to be specified – but for the |
|
198 drive not to be mounted and accessible in normal operation. If the drive is |
|
199 involved in a swap with another, then the <codeph>FS_NO_MOUNT</codeph> state |
|
200 is ignored and the drive is mounted normally. </p> </entry> |
|
201 </row> |
|
202 <row> |
|
203 <entry><p> <codeph>FS_ALLOW_REM_ACC</codeph> </p> </entry> |
|
204 <entry><p>This is reserved for future use. </p> </entry> |
|
205 </row> |
|
206 <row> |
|
207 <entry><p> <codeph> FS_NOT_RUGGED</codeph> </p> </entry> |
|
208 <entry><p>Marks the mount as not rugged. Mounting the drive without the rugged |
|
209 file system means that <codeph>FS_SCANDRIVE</codeph> is not supported. If <codeph>FS_SCANDRIVE</codeph> is |
|
210 also defined, it is ignored. </p> </entry> |
|
211 </row> |
|
212 <row> |
|
213 <entry><p> <codeph> FS_SYSTEM_DRIVE</codeph> </p> </entry> |
|
214 <entry><p>Assigns this drive as the system drive. Applications store user |
|
215 data on the system drive, and call <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>RFs::GetSystemDriveChar()</apiname></xref> to |
|
216 discover the drive letter. </p> <p>A mapping file can only specify one drive |
|
217 as the system drive. </p> <p>See <xref href="GUID-629AB2C9-BEDD-5166-8B09-F8DFF7527C03.dita">the |
|
218 system drive</xref>. </p> </entry> |
|
219 </row> |
|
220 </tbody> |
|
221 </tgroup> |
|
222 </table> </p> </entry> |
|
223 </row> |
|
224 </tbody> |
|
225 </tgroup> |
|
226 </table> <p id="GUID-A195BD51-80C7-5D87-ABA2-8878CC509B84"><b>Use automatic local drive |
|
227 mapping</b> </p> <p>If no drive mapping file exists or is unavailable, the |
|
228 Base Starter decides which file system to mount on each local drive by interrogating |
|
229 the capabilities of those drives. This is known as auto-detection. </p> <p>Internally, |
|
230 the Base Starter holds a table containing entries for every known supported |
|
231 local drive configuration. This table is known as the auto-configuration table. |
|
232 The information supplied by each entry in the table resembles that supplied |
|
233 by a <xref href="GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D.dita#GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D/GUID-2B95B775-1BD1-5256-86D3-CD3FA12447B9">local |
|
234 drive mapping file</xref>, and contains the following information: </p> <ul> |
|
235 <li id="GUID-0713E2D9-B47F-552D-B4BB-D2B587534F86"><p>The filename of the |
|
236 file system for this configuration (the <filepath>.FSY</filepath>). The filename |
|
237 corresponds to the <codeph><file_system_filename></codeph> item in a drive |
|
238 mapping file entry. </p> </li> |
|
239 <li id="GUID-A27734C1-04DC-5741-8C9F-E28DAAC12E9B"><p>The object name of the |
|
240 file system for this configuration. The object name corresponds to the <codeph> <file_system></codeph> item |
|
241 in a drive mapping file entry. </p> </li> |
|
242 <li id="GUID-1B40A8A4-C883-5385-8255-023DAA42FD24"><p>The filename of the |
|
243 file server extension for this configuration, if applicable. The filename |
|
244 corresponds to the <codeph> <file_system></codeph> item |
|
245 in a drive mapping file entry. </p> </li> |
|
246 <li id="GUID-D50A002B-A6F5-5CE0-95A8-5327F5D43F2E"><p>The set of mount flags; |
|
247 these correspond to the <codeph><flags></codeph> items in a drive mapping |
|
248 file entry. There is one exception - <codeph>FS_SWAP_CORRUPT</codeph> is not |
|
249 supported, because it is impossible to auto-detect which drive is to be swapped. </p> </li> |
|
250 <li id="GUID-1F79E6A1-FEC3-57A7-8C50-DDC7296610C5"><p>A file system identification |
|
251 function that is used to decide whether the designated file system is really |
|
252 suitable for this drive. Each function is an internal part of the generic |
|
253 Base Starter code. </p> </li> |
|
254 </ul> <p>The Base Starter uses the following default mapping of drive letters |
|
255 to drive numbers: </p> <table id="GUID-861EC91F-CB71-5E7F-A58F-F14A890C2EC1"> |
|
256 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
257 <tbody> |
|
258 <row> |
|
259 <entry><p> <b> Local drive number</b> </p> </entry> |
|
260 <entry><p> <b> Drive letter</b> </p> </entry> |
|
261 </row> |
|
262 <row> |
|
263 <entry><p> <codeph>0</codeph> </p> </entry> |
|
264 <entry><p>C</p> </entry> |
|
265 </row> |
|
266 <row> |
|
267 <entry><p> <codeph>1</codeph> </p> </entry> |
|
268 <entry><p>D</p> </entry> |
|
269 </row> |
|
270 <row> |
|
271 <entry><p> <codeph>2</codeph> </p> </entry> |
|
272 <entry><p>E</p> </entry> |
|
273 </row> |
|
274 <row> |
|
275 <entry><p> <codeph>3</codeph> </p> </entry> |
|
276 <entry><p>F</p> </entry> |
|
277 </row> |
|
278 <row> |
|
279 <entry><p> <codeph>4</codeph> </p> </entry> |
|
280 <entry><p>G</p> </entry> |
|
281 </row> |
|
282 <row> |
|
283 <entry><p> <codeph>5</codeph> </p> </entry> |
|
284 <entry><p>H</p> </entry> |
|
285 </row> |
|
286 <row> |
|
287 <entry><p> <codeph>6</codeph> </p> </entry> |
|
288 <entry><p>I</p> </entry> |
|
289 </row> |
|
290 <row> |
|
291 <entry><p> <codeph>7</codeph> </p> </entry> |
|
292 <entry><p>J</p> </entry> |
|
293 </row> |
|
294 <row> |
|
295 <entry><p> <codeph>8</codeph> </p> </entry> |
|
296 <entry><p>K</p> </entry> |
|
297 </row> |
|
298 <row> |
|
299 <entry><p> <codeph>9</codeph> </p> </entry> |
|
300 <entry><p>L</p> </entry> |
|
301 </row> |
|
302 <row> |
|
303 <entry><p> <codeph>10</codeph> </p> </entry> |
|
304 <entry><p>M</p> </entry> |
|
305 </row> |
|
306 <row> |
|
307 <entry><p> <codeph>11</codeph> </p> </entry> |
|
308 <entry><p>N</p> </entry> |
|
309 </row> |
|
310 <row> |
|
311 <entry><p> <codeph>12</codeph> </p> </entry> |
|
312 <entry><p>O</p> </entry> |
|
313 </row> |
|
314 <row> |
|
315 <entry><p> <codeph>13</codeph> </p> </entry> |
|
316 <entry><p>P</p> </entry> |
|
317 </row> |
|
318 <row> |
|
319 <entry><p> <codeph>14</codeph> </p> </entry> |
|
320 <entry><p>Q</p> </entry> |
|
321 </row> |
|
322 <row> |
|
323 <entry><p> <codeph>15</codeph> </p> </entry> |
|
324 <entry><p>R</p> </entry> |
|
325 </row> |
|
326 </tbody> |
|
327 </tgroup> |
|
328 </table> </section> |
|
329 <section id="GUID-89ED1556-60A5-5030-8946-7156656B7771"><title>Customisation |
|
330 using TFSStartup</title> <p>Most of the functionality provided by the Base |
|
331 Starter is provided by the class <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>TFSStartup</apiname></xref>. |
|
332 This contains a number of virtual functions with default Symbian implementations. |
|
333 A handset manufacturer can create a customised version of the Base Starter, |
|
334 which overrides these functions. </p> <ul> |
|
335 <li id="GUID-49B2FC6B-E0BF-548C-9537-FE02B420EE7A"><p> <xref href="GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D.dita#GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D/GUID-9B842CF3-D1A2-5BC7-8979-42EC7CD9A523">Disabling drive auto-detection</xref> </p> </li> |
|
336 <li id="GUID-90090D6E-2788-590C-8595-4E4423E51F5B"><p> <xref href="GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D.dita#GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D/GUID-4AB5A9C6-6D33-58E9-A372-033C1595DB9E">Customising for multiple hardware states</xref> </p> </li> |
|
337 <li id="GUID-1D7344CC-0876-5973-8E57-E2619E4D8B32"><p> <xref href="GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D.dita#GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D/GUID-7098B073-430F-5CA6-91C6-BCF267B33BF3">Overriding the default drive mapping</xref> </p> </li> |
|
338 <li id="GUID-9399A990-84B2-553B-900A-DBBD7EC8C04F"><p> <xref href="GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D.dita#GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D/GUID-904D8CCE-9E16-5A60-B141-9C838B1B8B44">Customising mount flags</xref> </p> </li> |
|
339 <li id="GUID-ED7B2E26-4147-553C-9DCF-06143EEEF2ED"><p> <xref href="GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D.dita#GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D/GUID-905BFBD9-AD40-5E11-AFED-F791389F1450">Customising the drive initialisation sequence</xref> </p> </li> |
|
340 <li id="GUID-4C6122EB-9898-5874-AB65-900F739DC611"><p> <xref href="GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D.dita#GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D/GUID-B93875C5-1B35-5993-89C4-B2CA5F502450">Customising Loadlocale</xref> </p> </li> |
|
341 <li id="GUID-95C61E12-EE0B-57B8-B5FA-EB476471D93C"><p> <xref href="GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D.dita#GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D/GUID-0B60FAF0-5D2F-5A0F-984C-DFB35BC09ED2">Customising the restart mode</xref> </p> </li> |
|
342 <li id="GUID-1A1EDBF0-92B4-5369-9077-210842CA13C6"><p> <xref href="GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D.dita#GUID-8BA1EEC2-78A3-54CC-95D9-81BF2659963D/GUID-4E9AFD2A-57DE-528A-8F41-C79EBE44B2A0">Customising other behaviour</xref> </p> </li> |
|
343 </ul> <p id="GUID-9B842CF3-D1A2-5BC7-8979-42EC7CD9A523"><b>Disabling drive auto-detection</b> </p> <p>The |
|
344 most common customisation is to use the supplied version of the Base Starter |
|
345 and to create one or more local drive mapping files . In this case, savings |
|
346 in code space can be made by removing the code that deals with auto-detection. |
|
347 This is achieved by adding the following line to the <filepath>MMP</filepath> file |
|
348 describing the Base Starter, and then rebuilding it. </p> <codeblock id="GUID-4D382A63-638C-5AF2-9535-88C7E3AB0869" xml:space="preserve">MACRO AUTODETECT_DISABLE</codeblock> <p id="GUID-4AB5A9C6-6D33-58E9-A372-033C1595DB9E"><b>Customising for multiple |
|
349 hardware states</b> </p> <p>If the state of your hardware varies, and it requires |
|
350 different mapping files for different states, then it is still possible to |
|
351 use the local drive mapping scheme. Examples of hardware state variations |
|
352 might be differences in the state of a switch or jumper setting, or the presence |
|
353 or absence of a hardware feature. In this situation, the ROM can be built |
|
354 with more than one mapping file. A custom version of the Base Starter provides |
|
355 its own version of the virtual function <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>TFSStartUp::LocalDriveMappingFileName()</apiname></xref>; |
|
356 this checks the appropriate settings, and returns the name of the appropriate |
|
357 local drive mapping file. The returned name is the full path name. </p> <p id="GUID-7098B073-430F-5CA6-91C6-BCF267B33BF3"><b>Overriding the default drive |
|
358 mapping</b> </p> <p>To override the default mapping of drive letters to drive |
|
359 numbers on a drive by drive basis, a custom version of the Base Starter provides |
|
360 its own version of the virtual function <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>TFSStartUp::DefaultLocalDrive()</apiname></xref>. </p> <p>To |
|
361 override the auto-configuration table used by the automatic local drive mapping |
|
362 scheme, for example to add support for a new <filepath>.FSY</filepath>, a |
|
363 custom version of the Base Starter provides its own version of the virtual |
|
364 function <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>TFSStartUp::GetNextStandardFSInfoEntry()</apiname></xref>. </p> <p id="GUID-904D8CCE-9E16-5A60-B141-9C838B1B8B44"><b>Customising mount flags</b> </p> <p>Whether |
|
365 you use the automatic local drive mapping scheme or an explicit local drive |
|
366 mapping file, you can provide support for additional mount flags. A custom |
|
367 version of the Base Starter provides its own version of the virtual functions: </p> <ul> |
|
368 <li id="GUID-8F1D6582-946C-5D25-AEE7-95563233BDDF"><p> <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>TFSStartUp::ParseCustomMountFlags()</apiname></xref> </p> </li> |
|
369 <li id="GUID-C65F29D7-8BFD-5B84-B184-57C734F3D5EF"><p> <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>TFSStartUp::HandleCustomMountFlags()</apiname></xref> </p> </li> |
|
370 </ul> <p id="GUID-905BFBD9-AD40-5E11-AFED-F791389F1450"><b>Customising the drive initialisation |
|
371 sequence</b> </p> <p>To override the entire local drive initialisation sequence |
|
372 provided by the generic version of the Base Starter, a custom version of the |
|
373 Base Starter provides its own version of the virtual function <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>TFSStartUp::LocalDriveInit()</apiname></xref>. </p> <p id="GUID-B93875C5-1B35-5993-89C4-B2CA5F502450"><b>Customising Loadlocale</b> </p> <p> <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>User::UTCOffset()</apiname></xref> is called within the <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>LoadLocale()</apiname></xref> function. Customise <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>TFSStartup::LoadLocale()</apiname></xref> so |
|
374 that the offset behaviour is correct for your time zone. </p> <p>Setting the <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>User::UTCOffset()</apiname></xref> is required within EStart |
|
375 to provide backward compatibility and because it provides the system time |
|
376 to components before the timezone/locale services are initialised. </p> <p>See <xref href="GUID-15E048BA-E158-508D-9DB4-C9DF9A546090.dita">setting the universal time |
|
377 offset</xref>. </p> <p id="GUID-0B60FAF0-5D2F-5A0F-984C-DFB35BC09ED2"><b>Customising the restart |
|
378 mode</b> </p> <p> <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>TFSStartup::GetStartupMode()</apiname></xref> and <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>TFSStartup::GetStartupModeFromFile()</apiname></xref> must be |
|
379 implemented to get the restart mode at start-up. </p> <p>Symbian OS does not |
|
380 define any meaning to restart mode values. It is for the use of the device |
|
381 manufacturer. </p> <p>The restart mode is defined by the HAL attribute <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>EPersistStartupM</apiname></xref>. This is a <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>TAttribute</apiname></xref> enum |
|
382 value defined in class <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>HALData</apiname></xref> in <filepath>..\hal\inc\hal_data.h</filepath>. </p> <p>To |
|
383 use this attribute, define it in your variant’s <filepath>config.hcf</filepath> file |
|
384 and set an initial value in your variant’s <filepath>values.hda</filepath> file. |
|
385 The template port defines the attribute as settable using the following definition |
|
386 in the <filepath>config.hcf</filepath> file. </p> <codeblock id="GUID-DCB65835-DB05-5092-B4D0-5ABA551773F8" xml:space="preserve">EPersistStartupModeKernel : set = ProcessPersistStartupMode</codeblock> <p>The value can be changed using <codeph>HAL::Set()</codeph>. <codeph>ProcessPersistStartupMode</codeph> is |
|
387 the name of a function internal to Symbian OS. If you choose to make the attribute |
|
388 settable, you must use this definition. </p> <p>Calls to <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>HAL::Get()</apiname></xref> are |
|
389 routed to the function <codeph>Template::VariantHal()</codeph> in your variant's <filepath>variant.cpp</filepath> file, |
|
390 and handled by the <codeph>EVariantHalGetPersistedStartupMode</codeph> case. </p> <p>Calls |
|
391 to <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>HAL::Set()</apiname></xref> are routed to the function <codeph>Template::VariantHal()</codeph> in |
|
392 your variant's <filepath>variant.cpp</filepath> file, and handled by the <codeph>EVariantHalPersistStartupMode</codeph> case. </p> <p>You |
|
393 need to do the following: </p> <ul> |
|
394 <li id="GUID-1B0499AB-4320-598D-B4FD-89B610C8CC2D"><p>If you choose to make |
|
395 the custom startup mode settable (in Symbian OS terminology, the attribute |
|
396 is said to be derived), you need to implement <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>TFSStartup::GetStartupMode()</apiname></xref>. |
|
397 Derived attributes are saved when the system is closed down. The function <codeph>GetStartupMode()</codeph> is |
|
398 called before the file server starts. </p> </li> |
|
399 <li id="GUID-EB91080D-1321-52B1-9EEA-718B02413928"><p>If you choose to make |
|
400 the custom startup mode non-settable (in Symbian OS terminology, the attribute |
|
401 is said to be non-derived), you need to implement <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>TFSStartup::GetStartupModeFromFile()</apiname></xref>. |
|
402 Non-derived attributes are read from file, and this function is called after |
|
403 the file server has started. </p> </li> |
|
404 <li id="GUID-8C418384-C30C-59E2-9E2A-542701C4D0DF"><p>You need to provide |
|
405 an implementation for your <codeph>Template::VariantHal()</codeph> function |
|
406 in your <filepath>variant.cpp</filepath> file. </p> </li> |
|
407 </ul> <p>The example below is the OMAP H4 variant implementation of <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>GetStartupModeFromFile()</apiname></xref> and <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>GetStartupMode()</apiname></xref> found |
|
408 in <filepath>...\dev1\omap_hrp\h4estart\estartmain.cpp</filepath>. </p> <codeblock id="GUID-8BD6A664-7A7E-580E-AD33-46C7B6AB4FB5" xml:space="preserve">TInt TH4FSStartup::GetStartupModeFromFile() |
|
409 { |
|
410 if (iStartupMode != EStartupModeUndefined) |
|
411 { |
|
412 TInt r = ReadAndReset(); |
|
413 return r; |
|
414 } |
|
415 return KErrNone; |
|
416 } |
|
417 |
|
418 TInt TH4FSStartup::GetStartupMode() |
|
419 { |
|
420 TInt r = ReadAndReset(); |
|
421 return r; |
|
422 } |
|
423 |
|
424 TInt TH4FSStartup::ReadAndReset() |
|
425 { |
|
426 TInt value; |
|
427 TInt r = HAL::Get(HALData::EPersistStartupModeKernel, value); |
|
428 if (r == KErrNone) |
|
429 { |
|
430 iStartupMode = value; |
|
431 } |
|
432 r = HAL::Set(HALData::EPersistStartupModeKernel, EStartupModeUndefined); |
|
433 return r; |
|
434 }</codeblock> <p>See <xref href="GUID-2D977A02-5928-5441-8AE7-42A722F2A4B8.dita#GUID-2D977A02-5928-5441-8AE7-42A722F2A4B8/GUID-4DA41221-40B9-5BC7-B2C6-7C6EB4522508">User-Side |
|
435 Hardware Abstraction</xref>. </p> <p id="GUID-4E9AFD2A-57DE-528A-8F41-C79EBE44B2A0"><b>Customising other behaviour</b> </p> <p>You |
|
436 can change other default behaviour. For example, to add additional functionality |
|
437 related to File Server initialisation, or the initialisation of other base |
|
438 related components, then the following virtual functions can also be customised. |
|
439 Follow the links to the individual functions for more detail: </p> <ul> |
|
440 <li id="GUID-DF81E0C5-3404-50BA-B91D-D57CA5B0C08C"><p> <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>TFSStartup::Init()</apiname></xref> </p> </li> |
|
441 <li id="GUID-3D245F97-00D2-561E-A752-2ACC2EFBEC92"><p> <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>TFSStartup::Run()</apiname></xref> </p> </li> |
|
442 <li id="GUID-F700923A-3E2C-5BE0-8EBB-911C7A8C1D56"><p> <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>TFSStartup::InitialiseHAL()</apiname></xref> </p> </li> |
|
443 <li id="GUID-D60B9ADD-EB13-5FB1-A632-488383D89289"><p> <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>TFSStartup::StartSystem()</apiname></xref> </p> </li> |
|
444 <li id="GUID-93DD7CF9-77BA-56E2-8BB6-617EC6CF3865"><p> <xref href="GUID-7A6C0343-7B98-3429-9162-4C0357594230.dita"><apiname>TFSStartup::Close()</apiname></xref> </p> </li> |
|
445 </ul> </section> |
|
446 <section id="GUID-AC49186C-F69B-5D5B-8515-3CF8CD91EAF4"><title>Activities |
|
447 that the Base Starter does not do</title> <p>The Base Starter is responsible |
|
448 for mapping local drives to drive letters and for loading the appropriate |
|
449 file systems on local drives. It does <i>not</i> install media drivers, and |
|
450 is not responsible for deciding which local drive a media driver will register |
|
451 with. This is done by the individual media drivers and peripheral controllers |
|
452 when they are initialised. </p> <p>See <xref href="GUID-A70A01D2-467E-5BA8-A01D-6182558F3F52.dita#GUID-A70A01D2-467E-5BA8-A01D-6182558F3F52/GUID-4A8DEEAB-32C4-5431-8226-5623E2BD9098">Registering |
|
453 the media driver</xref> for information about how to register a media driver. </p> <p>See |
|
454 also <xref href="GUID-5C223AD5-4676-58B4-B3A5-066F6B69AA4D.dita#GUID-5C223AD5-4676-58B4-B3A5-066F6B69AA4D/GUID-868866C8-E90C-5291-8732-BB4E86D6B43E">Local |
|
455 Media Subsystem</xref>. </p> </section> |
|
456 </conbody></concept> |