Symbian3/SDK/Source/GUID-A188606F-4A8E-5A85-A241-E15219960EFA.dita
changeset 7 51a74ef9ed63
child 8 ae94777fff8f
equal deleted inserted replaced
6:43e37759235e 7:51a74ef9ed63
       
     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-A188606F-4A8E-5A85-A241-E15219960EFA" xml:lang="en"><title>Loader
       
    13 Overview</title><shortdesc>This topic describes the overview, purpose, key concepts and architecture
       
    14 of loader.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    15 <ul>
       
    16 <li id="GUID-AE825AB3-3799-5A7A-A74D-D6E457A6997E"><p> <xref href="GUID-A188606F-4A8E-5A85-A241-E15219960EFA.dita#GUID-A188606F-4A8E-5A85-A241-E15219960EFA/GUID-E36370EC-CD5E-54AE-AD62-2BA3B70F5379">Purpose</xref>  </p> </li>
       
    17 <li id="GUID-9D2C951C-6092-53BB-BFA9-4D33230721FA"><p> <xref href="GUID-A188606F-4A8E-5A85-A241-E15219960EFA.dita#GUID-A188606F-4A8E-5A85-A241-E15219960EFA/GUID-89A8CABD-6B31-5D10-87F6-922CCFB83186">Key concepts</xref>  </p> </li>
       
    18 <li id="GUID-B21577D8-3B8B-596F-A3B6-6AC2538F6F28"><p> <xref href="GUID-A188606F-4A8E-5A85-A241-E15219960EFA.dita#GUID-A188606F-4A8E-5A85-A241-E15219960EFA/GUID-64154337-D706-5DE1-9319-4FEA6181EFC4">Architectural relationships</xref>  </p> </li>
       
    19 </ul>
       
    20 <section id="GUID-E36370EC-CD5E-54AE-AD62-2BA3B70F5379"><title>Purpose</title> <p>The
       
    21 loader makes EXEs and DLLs ready to run. </p> <p>The build tools compile the
       
    22 source code into an executable file. An executable file is called a binary.
       
    23 The build tools arrange the compiled code into EXEs and DLLs. The source code,
       
    24 header files and other information that defines an executable file is defined
       
    25 in an mmp file. The loader applies relocation information to the code and
       
    26 data sections of EXEs and DLLs. The loader also loads DLLs that are referred
       
    27 to by other EXEs and DLLs. EXEs and DLLs can then run in the process into
       
    28 which they are loaded. </p> </section>
       
    29 <section id="GUID-89A8CABD-6B31-5D10-87F6-922CCFB83186"><title>Key concepts</title> <p><b>The loader server</b> </p> <p>The Symbian platform loader is a server.
       
    30 The loader server has no public client interface. The client interface is
       
    31 internal to Symbian platform. Requests to load an EXE or a DLL are passed
       
    32 to the loader when you do the following: </p> <ul>
       
    33 <li id="GUID-5DFBB7F5-2F30-50C7-9144-3D6D85C0ACA1"><p>start a new process
       
    34 - a call to <xref href="GUID-9DD1EA2B-DC59-315C-8E9C-CE6D9461B695.dita#GUID-9DD1EA2B-DC59-315C-8E9C-CE6D9461B695/GUID-DD214BA3-907E-3C7F-93C6-924A9A115A02"><apiname>RProcess::Create()</apiname></xref>  </p> </li>
       
    35 <li id="GUID-B88FC041-7643-5CA0-9796-A51E64CAA1DF"><p>load a DLL - a call
       
    36 to <xref href="GUID-25327159-83D6-3507-B187-09EA4BB3727F.dita#GUID-25327159-83D6-3507-B187-09EA4BB3727F/GUID-4F1B2717-D34F-32A4-B6E6-03D0533186A3"><apiname>RLibrary::Load()</apiname></xref>  </p> </li>
       
    37 <li id="GUID-A7578989-6BDB-5CEA-B3C3-0B5A08E57166"><p>load a logical device
       
    38 driver - a call to <xref href="GUID-C197C9A7-EA05-3F24-9854-542E984C612D.dita#GUID-C197C9A7-EA05-3F24-9854-542E984C612D/GUID-AE0D51B7-7ADC-3C9F-ACAA-8F6D9EA0AEFA"><apiname>User::LoadLogicalDevice()</apiname></xref>. A logical
       
    39 device driver is a type of DLL. </p> </li>
       
    40 <li id="GUID-34DC54FE-FCEF-5F83-B205-9BA5B7140680"><p>load a physical device
       
    41 driver - a call to <xref href="GUID-C197C9A7-EA05-3F24-9854-542E984C612D.dita#GUID-C197C9A7-EA05-3F24-9854-542E984C612D/GUID-A0F4BF4A-9C58-3E5E-88E1-6D98597DDA18"><apiname>User::LoadPhysicalDevice()</apiname></xref>. A physical
       
    42 device driver is a type of DLL. </p> </li>
       
    43 <li id="GUID-51318E5E-4534-589B-B4BD-92D73F832A6F"><p>load a file system -
       
    44 a call to <xref href="GUID-E263C747-946F-35AA-9F1D-41833BD350FC.dita#GUID-E263C747-946F-35AA-9F1D-41833BD350FC/GUID-51353BE2-9133-39F5-83F3-A5DB88D858CA"><apiname>RFs::AddFileSystem()</apiname></xref>. A file system is a type
       
    45 of DLL. A call to <codeph>RFs::AddFileSystem()</codeph> requires DiskAdmin
       
    46 capability. See <xref href="GUID-99D8A4E8-BC4F-39FF-A3DF-832CF0411629.dita"><apiname>ECapabilityDiskAdmin</apiname></xref>. </p> </li>
       
    47 <li id="GUID-8394C231-341B-5EA6-B9C2-01F75685813D"><p>load a file server extension
       
    48 - call to <xref href="GUID-E263C747-946F-35AA-9F1D-41833BD350FC.dita#GUID-E263C747-946F-35AA-9F1D-41833BD350FC/GUID-D45FD363-EEF9-3F77-8FA1-49270D8E89A0"><apiname>RFs::AddExtension()</apiname></xref>. A file server extension
       
    49 is a type of DLL. This function requires DiskAdmin capability. See <xref href="GUID-99D8A4E8-BC4F-39FF-A3DF-832CF0411629.dita"><apiname>ECapabilityDiskAdmin</apiname></xref>. </p> </li>
       
    50 <li id="GUID-F1889916-80EB-55B6-BEAF-F66164F3838C"><p>load a locale - a call
       
    51 to <xref href="GUID-454ACAB5-1573-323C-820E-AF542B149D2A.dita#GUID-454ACAB5-1573-323C-820E-AF542B149D2A/GUID-9F04584E-DD0B-39CE-8666-88F67F3B83BF"><apiname>TExtendedLocale::LoadLocale()</apiname></xref>. </p> </li>
       
    52 </ul> <p><b>Version
       
    53 numbers</b> </p> <p><b>The
       
    54 reason for version numbers</b> </p> <p>More than one version of an EXE can
       
    55 exist on a device at the same time. More than one version of a DLL can exist
       
    56 on a device at the same time. A device can store versions of an EXE or DLL
       
    57 that are not compatible with an older version of that EXE or DLL. </p> <p>A
       
    58 version number is a set of two numbers. The loader uses these numbers to identify
       
    59 copies of the executable file. The two numbers are called the major version
       
    60 number and the minor version number. The build tools encode the two numbers
       
    61 into the header of the executable file. When a DLL is built, the version numbers
       
    62 are encoded into the import library. </p> <p><b>The
       
    63 structure of version information</b> </p> <p>DLLs are the most common users
       
    64 of versions. You assign new values to the version numbers of a DLL when you
       
    65 change the published API of the DLL. Symbian recommends the following procedure: </p> <ul>
       
    66 <li id="GUID-A3D6B7C6-E48E-5374-8EFE-29EB129FEE04"><p>change the minor version
       
    67 number if you make a change to a DLL that is backward compatible. An example
       
    68 is a new function in the DLL. </p> </li>
       
    69 <li id="GUID-F6813400-1E6A-58B9-8360-7FD364F2153A"><p>change the major version
       
    70 number if you make a change to a DLL that breaks an interface. An example
       
    71 is the removal of a function or a change to the signature of a function. An
       
    72 interface break is disruptive and must be prevented. </p> </li>
       
    73 </ul> <p>The major and minor version numbers are defined in the <filepath>.mmp</filepath> file
       
    74 that defines the source code, header files and other options that apply to
       
    75 the executable file. </p> <p>If you do not specify version numbers, the build
       
    76 tools apply the following default values: </p> <ul>
       
    77 <li id="GUID-CBF4D098-3A83-53E6-9E54-0A9B487D6E22"><p>Major version number
       
    78 : 10 </p> </li>
       
    79 <li id="GUID-46E7516E-988B-5F92-9877-FEE17D3F26A7"><p>Minor version number
       
    80 : 0 </p> </li>
       
    81 </ul> <p>The major version number and the minor version number are stored
       
    82 in the header of an EXE and DLL. The two numbers are stored in a single 32
       
    83 bit value. The high 16 bits hold the major version number. The low 16 bits
       
    84 hold the minor version number. </p> <p>When you build a DLL, the build tools
       
    85 encode the version numbers into the filename of the import library (the <filepath>.lib</filepath> file).
       
    86 The build tools also create an import library that does not have the version
       
    87 numbers encoded as part of the filename.The following example shows how the
       
    88 version numbers are encoded in the filename. The major version number is (decimal)
       
    89 11 and the minor version number is (decimal) 2. The version numbers in the
       
    90 filename are in hexadecimal. </p> <p> <filepath>abcdsrv{000B0002}.lib</filepath>  </p> <p>Notes: </p> <ul>
       
    91 <li id="GUID-7DC90016-5A54-5939-84B1-DDB0B2D4D9F5"><p>The left bracket and
       
    92 the right bracket are part of the name. </p> </li>
       
    93 <li id="GUID-BC291976-EB6D-59D2-8941-64F6ED3AC191"><p>The first four digits
       
    94 after the open bracket are the hexadecimal representation of the major version
       
    95 number. </p> </li>
       
    96 <li id="GUID-51590778-985F-5DCC-9191-E937B1058F51"><p>The second four digits
       
    97 are the hexadecimal representation of the minor version number. </p> </li>
       
    98 </ul> <p>The build tools do not encode the version numbers in the filename
       
    99 of the executable file. </p> <p><b>Loader
       
   100 search rules</b> </p> <p>EXEs and DLLs can exist on more than one drive. There
       
   101 can be more than one version of an EXE and more than one version of a DLL.
       
   102 The loader uses search rules to select the EXE and DLL to load. </p> <p>See <xref href="GUID-D8837969-74D0-5E17-AD42-3F10DD1FD5BF.dita">Loader search rules</xref>  </p> <p><b>Emulator</b> </p> <p>Version numbers are stored in import files for DLLs
       
   103 that run on devices and the emulator. Version numbers change how the loader
       
   104 functions on devices, but not in the emulator. You cannot encode the version
       
   105 numbers in the import library file name on the emulator. </p> <p><b>Tools support</b> </p> <p>Use the build tools to apply version numbers
       
   106 to EXEs and DLLs. You specify version numbers in the <filepath>.mmp</filepath> file
       
   107 that describes the EXE or DLL. </p> <p>See also <xref href="GUID-BBBB5000-90A2-503A-9521-2FC6DEC69DC8.dita">mmp
       
   108 file syntax</xref> and <xref href="GUID-B21141D4-3BFE-59C9-8D5F-147A93BE1C95.dita">Build
       
   109 tools guide</xref>. </p> </section>
       
   110 <section id="GUID-64154337-D706-5DE1-9319-4FEA6181EFC4"><title>Architectural
       
   111 relationships</title> <p>The loader is a server that runs in a separate thread
       
   112 in the file server process. The loader is built as part of the file server. </p> <p>The
       
   113 loader server starts when the file server starts. The file server starts after
       
   114 the kernel is loaded at system start. </p> <p>The loader runs on the user
       
   115 side, but calls the kernel for services that are not available to general
       
   116 applications. Examples of services are process creation and code segment creation.
       
   117 A code segment is an object that represents a piece of code loaded into RAM.
       
   118 A code segment also represents a piece of code that runs directly from ROM.
       
   119 The kernel services that the loader uses are protected. The file server process
       
   120 only is allowed to access these services. </p> <p>The following picture is
       
   121 an example of program flow. In this example, a client calls <xref href="GUID-25327159-83D6-3507-B187-09EA4BB3727F.dita#GUID-25327159-83D6-3507-B187-09EA4BB3727F/GUID-4F1B2717-D34F-32A4-B6E6-03D0533186A3"><apiname>RLibrary::Load()</apiname></xref>,
       
   122 which exists in <filepath>euser.dll</filepath>. Internal functions make client-server
       
   123 calls to the loader server. The loader server code exists in <filepath>efile.exe</filepath>.
       
   124 The loader server uses kernel services. </p> <fig id="GUID-5FCAE81A-19BC-5BE7-89D2-096A87735381">
       
   125 <image href="GUID-2735BDAF-295F-5F1E-8925-8F4212D95CD1_d0e267853_href.png" placement="inline"/>
       
   126 </fig> </section>
       
   127 </conbody></concept>