|
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-AF245763-EB25-49BC-90DC-0BD5F2D22AA5" xml:lang="en"><title>Specific |
|
13 Build Information</title><shortdesc>This document discusses the details of the build procedure which |
|
14 are specific to device drivers.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
15 <section id="GUID-093E4B03-8B84-4088-BEC9-9F6E09594E6D"> <title>Building |
|
16 device drivers</title> <p>Building a device driver is similar to building |
|
17 any other component in Symbian platform. This section discusses the details |
|
18 that are specific to drivers, and assumes that you are familiar with the Symbian |
|
19 platform build tools. </p> <p>Device drivers can be built either by using |
|
20 console commands (<filepath>bldmake</filepath> and <filepath>abld</filepath>) |
|
21 or by using an IDE. Any project can be built for multiple platforms. Generally, |
|
22 it is either ARM for the hardware target or WINSCW for the emulator target. |
|
23 For hardware target builds, the build can be for ARMV5, ARMV6, and Thumb, |
|
24 while for emulator builds, the platform is WINSCW. The compilers used for |
|
25 ARM are the ARM RVCT compiler or, in earlier versions of the platform, |
|
26 a version of the GNU GCC compiler. For the emulator, the compiler is the Carbide.c++ |
|
27 or Metrowerks CodeWarrior compiler. </p> <p>The <filepath>.mmp</filepath> file |
|
28 (project file) specifies the source files to build and the platform for which |
|
29 the target binary will be built. </p> </section> |
|
30 <section id="GUID-E42B5D1E-5244-4A30-AA83-FB7331EE1934"><title>Variant specific target </title> <p>When a target is specified |
|
31 using the keyword <codeph>VariantTarget()</codeph>, the build tools generate |
|
32 a unique name for the binary by adding the variant name. This allows separate |
|
33 binaries to be created for each variant, and prevents the current binary being |
|
34 overwritten. </p> <p>For example, if the target to be built is <filepath>d_expio_ldd.ldd</filepath>, |
|
35 then <filepath>VariantTarget(d_expio_ldd,ldd)</filepath> would be specified |
|
36 in the <filepath>.mmp</filepath> file. If the project is then built for the <codeph>h4hrp</codeph> variant, |
|
37 the final target binary built is called <filepath>_h4hrp_d_expio_ldd.ldd</filepath>. </p></section> |
|
38 <section id="GUID-F78A81DF-5482-4D63-934D-33AB078B831C"><title>ROM image build</title> <p>To include a driver in a ROM image, |
|
39 the driver's files must be included in the corresponding obey files (<filepath>.oby</filepath>). |
|
40 In the base subsystem, the binaries are specified in <filepath>.iby</filepath> files, |
|
41 and the <filepath>.iby</filepath> files are then included in <filepath>.oby</filepath> files. </p> <p>For |
|
42 example, to include a driver in the H4 text shell ROM image, it should be |
|
43 included in <filepath>kernel.iby</filepath>. This file is located in <filepath>base\omap_hrp\h4\rom\</filepath>, |
|
44 and exported to <filepath>epoc32\rom\h4hrp</filepath>. Similarly for the TechView |
|
45 ROM build, the relevant file is <filepath>base_h4hrp.iby</filepath> file, |
|
46 which is located in <filepath>base\omap_hrp_h4\rom\</filepath>, and exported |
|
47 to <filepath>epoc32\rom\include</filepath>. An example from an <filepath>.iby</filepath> file |
|
48 is shown below: </p> <codeblock id="GUID-2A6C74C8-050F-555C-8E50-C92169A513B2" xml:space="preserve">// .iby file |
|
49 |
|
50 /** |
|
51 ##KMAIN## gets the path for e32 |
|
52 ##BUILD## gets the build – udeb/urel according to build |
|
53 ##VARIANT gets the target from corresponding variant |
|
54 */ |
|
55 |
|
56 device[VARID]=\EPOC32\RELEASE\##KMAIN##\##BUILD##\d_expio_ldd.ldd sys\bin\d_expio_ldd.ldd |
|
57 |
|
58 device[VARID]=\EPOC32\RELEASE\##KMAIN##\##BUILD##\_##VARIANT##_d_expio_pdd.pdd sys\bin\d_expio_pdd.pdd</codeblock> <p>On |
|
59 building the test .inf files, test <filepath>.iby</filepath> files will be |
|
60 generated. This includes the newly added binaries in the <filepath>.iby</filepath> file. </p> <p>After |
|
61 building the drivers, a ROM can be built. Device driver and base developers |
|
62 generally build text shell ROM images for development and testing. These can |
|
63 be built using the <filepath>rom</filepath> tool (from <filepath>base\e32\rombuild</filepath>). |
|
64 By default, the ROM image is generated in that directory. An alternate path |
|
65 can also be specified. </p> <p>For example, for the H4HRP variant, a text |
|
66 shell ROM image is built using: </p> <p><userinput>rom –v=h4hrp –I=armv5 udeb</userinput> </p> <p>This |
|
67 builds a ROM called <filepath>H4HRPARMV5D.IMG</filepath>, which can then be |
|
68 downloaded to target hardware and tested. </p> <p>To include base test programs |
|
69 in a ROM image, the option <codeph>–type</codeph> can be used. For example: </p> <p><userinput>rom |
|
70 –v=h4hrp –I=armv5 udeb –type=e32tests</userinput> </p> <p>This includes the |
|
71 tests from <filepath>base\e32test</filepath>. The tool uses as input a generated |
|
72 or precompiled <filepath>oby</filepath> file, which includes all the generated |
|
73 test <filepath>.iby</filepath> files. </p></section> |
|
74 </conbody></concept> |