|
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-A3449F37-89BB-5208-8FD5-F4DF73F7E71A" xml:lang="en"><title>System |
|
13 Startup Overview</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <section id="GUID-C41A0540-2C28-4CCC-B8AA-8236C68CEB18"><title> Configuring and Controlling a device's boot process </title> <p>Whenever |
|
15 a Symbian device is powered up a number of things have to happen before it |
|
16 is ready to be used. A number of processes and applications have to be started |
|
17 and certain tasks performed. </p> <p>The System Starter and its related components |
|
18 control the startup process. This guide describes what the System Starter |
|
19 does and how it may be configured. Configuration is the responsibility of |
|
20 device manufacturers. A manufacturer may choose to enable operators, third |
|
21 parties and users to extend the startup configuration. </p> <p>There are numerous |
|
22 considerations when configuring device startup. These include: </p> <ul> |
|
23 <li id="GUID-5BA1769D-D1FC-59A4-87F6-30D031443CD9"><p>which processes, tasks |
|
24 and applications are required, </p> </li> |
|
25 <li id="GUID-48D7345B-0D3B-5ADA-A646-A3DAC85FE4F5"><p>the sequence of, and |
|
26 inter-dependencies between, activities, </p> </li> |
|
27 <li id="GUID-9C7A919A-8C67-5DC0-BDD8-D1DC12AE0636"><p>the user experience, </p> </li> |
|
28 <li id="GUID-9F2C5CCC-EAD6-5AD6-8B85-7EB459F385BA"><p>the impact on manufacturing |
|
29 and testing, </p> </li> |
|
30 <li id="GUID-7212D20D-2A6C-51BC-A3B4-23FAF4CA5EC0"><p>operators' customisation |
|
31 requirements, </p> </li> |
|
32 <li id="GUID-1D75BFB9-9E0C-5E60-8473-278D3ABCF7B7"><p>users' customisation |
|
33 requirements, </p> </li> |
|
34 <li id="GUID-41225C9C-047B-59BF-A670-0981A73BF6FC"><p>what to do when something |
|
35 goes wrong </p> <p>and </p> </li> |
|
36 <li id="GUID-5E519AE8-3268-5C2B-A623-2E99229947F8"><p>aftermarket applications </p> </li> |
|
37 </ul> <p><b>Processes and Applications </b> </p> <p>In the interest of readability |
|
38 this document frequently<b> uses the terms application and process interchangeably</b>. |
|
39 Unless specifically stated otherwise you may assume that the term used refers |
|
40 to both. </p> </section> |
|
41 <section id="GUID-528B2FD1-7233-413A-81C8-5064095135AB"><title>Static Startup Configuration</title> <p>The System Starter |
|
42 is automatically invoked as part of the boot process once the file system |
|
43 has been mounted. It works by processing a list of instructions in sequence. |
|
44 The list is referred to as a Static Startup Configuration, or SSC. In practical |
|
45 terms the SSC is defined in a resource file and is built into the ROM. </p> <p>A |
|
46 fundamental feature of the SSC is that it allows the start up procedure to |
|
47 be optimised. Though the commands are processed in sequence their effect is |
|
48 to perform tasks not only in <b>sequence</b> (wait for the application or |
|
49 process to initialise before continuing) but also in <b>parallel</b> (do not |
|
50 wait for initialisation) and <b>at the optimum time</b> (wait until conditions |
|
51 are right). </p> <p>For further information on the contents of an SSC see: </p> <ul> |
|
52 <li id="GUID-1F8911D9-F92B-5A4F-8548-942842A7ED2A"><p><xref href="GUID-57F38146-1DA3-5657-ADF4-76DF740363C5.dita">Static |
|
53 Startup Configuration</xref> </p> </li> |
|
54 </ul> <p>Though an SSC cannot be changed, a number of SSCs may be included |
|
55 in a ROM. This allows a device to be started with one of a number of different |
|
56 configurations, i.e. to be booted into different <b>modes</b>. </p> <ul> |
|
57 <li id="GUID-92E0E027-8A4F-55A5-AC48-4252164E2E77"><p>The mode determines |
|
58 which SSC the System Starter uses to start the system. Symbian has defined |
|
59 (and reserved) a number of Startup Modes (for test and reference purposes): |
|
60 Full, Emulator, Emergency, Battery charge & Test. Device manufacturers |
|
61 may use their own startup modes and reserve their own unique range of values |
|
62 by sending an email to the Device Services package mailing list (<xref href="mailto:td-os_base_services-dev@lists.symbian.org" scope="external">td-os_base_services-dev@lists.symbian.org</xref>) |
|
63 specifying: </p> <ol id="GUID-E4D9A3AB-4BD5-5E5E-8B70-8E6435842F06"> |
|
64 <li id="GUID-9F4658CA-4DCE-5E88-91FC-AE0F3CA65997"><p>the device manufacturer |
|
65 name </p> </li> |
|
66 <li id="GUID-AA1CC293-099A-5534-BA71-3EEE6691BE53"><p>the number of start-up |
|
67 mode ranges required (each range has 32 values)</p> </li> |
|
68 </ol> </li> |
|
69 </ul> <p>SSC files are named <filepath>SCCForStartupModeN.rss</filepath> where |
|
70 N is the number of the mode. The method of selecting the mode, and therefore |
|
71 the SSC file, for each startup is defined by the licensee. </p> <p>The degree |
|
72 to which an SSC can control and optimise the boot process is further enhanced |
|
73 by the concepts of <b>Startup States</b> and <b>Staged Startup</b>. </p> <p><b> Startup States</b> </p> <p>An SSC is divided into a series of states which |
|
74 follow each other sequentially. Those described here are defined by Symbian. |
|
75 Licencees may add or insert further states by defining them and including |
|
76 them in an SSC. The Symbian defined states have a certain significance: </p> <ul> |
|
77 <li id="GUID-4C3113C7-CFAF-59AE-A271-51424F6B2478"><p> <b>The Critical Static |
|
78 State:</b> This is when the essential ROM based components are started. Nothing |
|
79 started in this state relies on anything outside the ROM. </p> </li> |
|
80 <li id="GUID-56754FF8-08A4-56BE-A4C2-A8F2A25AE738"><p> <b> The Critical Dynamic |
|
81 State:</b> This is when essential non-ROM based components and components |
|
82 which use non-ROM based files are started. </p> </li> |
|
83 <li id="GUID-804244EC-006E-5216-B286-D9FC6B9495EA"><p> <b> The Non-critical |
|
84 State:</b> Components started here are not essential for the basic functionality |
|
85 of the device. i.e. the phone will be 'up and running' before these components |
|
86 are started. </p> </li> |
|
87 </ul> <p><b>Staged |
|
88 Startup</b> </p> <p>A further level of startup control and configuration can |
|
89 be achieved using Staged Startup. This technique enables components to perform |
|
90 their initialisation procedure as separate stages - essential earlier, non-essential |
|
91 later. This enables further reduction of the effective boot time. </p> <p>Applications |
|
92 must be <b>Staged Startup Aware (SSA)</b> to take advantage of the staged |
|
93 startup facilities. They must register with the Starter so that they can receive |
|
94 state-change notifications. An SSA application may perform a <b>stage</b> of |
|
95 its startup during each SSC <b>state</b>. </p> <p>Staged startup subdivides |
|
96 each state into five ordered domains: Kernel, Base, OS Services, Application |
|
97 Services and UI Framework (these correspond to the <xref href="GUID-98E4DFEE-D7FA-581B-A56C-89797890D418.dita">Symbian |
|
98 OS System Model</xref>). Each SSA component associates itself with a domain |
|
99 according to its location in the System Model. Within each state the domains |
|
100 are processed sequentially. This allows application dependency to be accommodated |
|
101 without individual applications having to manage these dependencies. </p> </section> |
|
102 <section id="GUID-F58AE201-31BF-4E36-96B6-50D61A53B9CA"><title>Dynamic Startup Configuration (DSC) </title> <p>All of the |
|
103 components included in the Static Startup Configuration are present for the |
|
104 life of the device. Components installed after the ROM has been built, or |
|
105 after the device has been shipped, may also be started during boot by being |
|
106 added to a Dynamic Startup Configuration (DSC). </p> <p>One or more DSCs may |
|
107 be included at various points in an SSC. </p> <p>A run-time API allows entries |
|
108 to be added to and deleted from a DSC. This means that aftermarket applications, |
|
109 updates and patches can be inserted automatically on installation, over the |
|
110 air by a Network Operator, or by the user. </p> <ul> |
|
111 <li id="GUID-84D36270-880B-56F4-BBD9-5C80F9DA1BEF"><p><xref href="GUID-E3941FAF-988E-5FB3-8E62-84E192E41EA1.dita">How |
|
112 to use the DSC API</xref> </p> </li> |
|
113 </ul> </section> |
|
114 <section id="GUID-D6D28700-0BAD-4F88-8CE9-2E0330233468"><title>Specifying action on failure </title> <p>Though system startup |
|
115 is an automatic process, things can go wrong. In some cases the device can |
|
116 continue to function if a component fails to start, in others it cannot. Applications |
|
117 can fail to start or fail after they have started for a variety of reasons. |
|
118 Symbian OS provides mechanisms for detecting and handling failure. </p> <p>When |
|
119 an application is started using an SSC or a DSC several parameters must be |
|
120 specified in its resource. These include: </p> <ul> |
|
121 <li id="GUID-4DC8B8DA-FA50-57E9-B1FD-B60991C927C1"><p>a startup method (<codeph>EFireAndForget</codeph>, <codeph>EWaitForStart</codeph>, <codeph>EDeferredWaitForStart</codeph>) </p> </li> |
|
122 <li id="GUID-8236B8FB-CDD9-544A-91FA-F53231EDEDAF"><p>the number of retries |
|
123 (attempts to start the application) </p> </li> |
|
124 <li id="GUID-A9EA3792-BA99-59C8-8AE1-40A34CFAC095"><p>a timeout period (after |
|
125 which an EWaitForStart startup will be considered to have failed) </p> </li> |
|
126 <li id="GUID-F9CEA642-4140-5430-9092-C5B70BE9B691"><p>a restart action (<codeph>EIgnoreProcessFailure</codeph>, <codeph>ERestartOS</codeph>, <codeph>ERestartOSWithMode</codeph> - the action to be taken in the event of failure |
|
127 to rendezvous or failure while running normally.) </p> </li> |
|
128 <li id="GUID-F737C84D-3BAB-5256-858E-4D9EF9C0AB19"><p>a restart mode (the |
|
129 phone might restart in a 'Safe Mode', for instance) </p> </li> |
|
130 <li id="GUID-2030D3D4-D1C6-5E80-B75E-F8F656CA5168"><p>whether to initiate |
|
131 monitoring after the component has made its rendezvous. </p> </li> |
|
132 </ul> <p>If, after the <b>timeout period</b> the application has not made |
|
133 its rendezvous, the OS can make further attempts to start it. If, after the <b>number |
|
134 of retries</b> specified, it has not succeeded it will take the specified <b>restart |
|
135 action</b>. If the restart action is <codeph>ERestartOS</codeph> or <codeph>ERestartOSWithMode</codeph> it |
|
136 will shut down the device and restart it (in the second case in the <b>restart |
|
137 mode</b> specified). If <b>monitoring</b> is enabled the System Monitor will |
|
138 continue to monitor the process after a successful rendezvous and, if it stops |
|
139 unexpectedly at any time, will re-use the same configuration information and |
|
140 act accordingly. </p> <ul> |
|
141 <li id="GUID-64BFBF8C-3279-5DE5-9350-19DB7FD5D481"><p><xref href="GUID-4E195F2A-78AE-5664-A115-AD65BF457AB1.dita">How |
|
142 to use the System Monitor</xref> </p> </li> |
|
143 </ul> <p>Note that processes or threads declared 'System Critical' use an |
|
144 aternative monitoring mechanism, which pre-dates the System Monitor, to restart |
|
145 the OS when they fail (see <xref href="GUID-B0E661BC-4058-3256-B9C3-5A4FD52F6DE5.dita#GUID-B0E661BC-4058-3256-B9C3-5A4FD52F6DE5/GUID-AF3E8BE4-FE65-3CCE-8B5A-6C4585BEA2EC"><apiname>RThread::SetCritical()</apiname></xref>). The |
|
146 System Monitor offers two significant advantages: the ability to restart the |
|
147 process without restarting the OS and the option of restarting in a specified |
|
148 mode. </p> </section> |
|
149 </conbody></concept> |