Sign in Join
Wiki copytemporary

Symbian OS Internals: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: Symbian OS Internals

OldNewLine
1+## Build System Reengineering
2+
3+This section is a documentation on the attempt to re-engineer the UIQ 3 build system to a format more friendly to Free Pascal and cross-platform development in general.
4+
5+### Default SDK Build Process for UIQ 3
6+
7+Two commands are executed when building UIQ 3 software for the emulator. Suppose your UIQ SDK is installed on c:\Symbian\UIQ3SDK and your software C++ source code is on C:\QHelloWorld\src.
8+
9+On C++ you should enter the directory C:\QHelloWorld\group where the build file is located (bld.inf), and type:
10+
11+ bldmake bldfiles
12+ abld build winscw udeb
13+
14+The first command will:
15+
16+- Generate the directory: C:\Symbian\UIQ3SDK\epoc32\BUILD\Programas\SymbianOS\QHelloWorld\group
17+
18+- Fill it with many Makefiles
19+
20+- Create a ABLD.BAT script
21+
22+- Perl files involved: bldmake.pl
23+
24+The second command will:
25+
26+- Generate the directory: C:\Symbian\UIQ3SDK\epoc32\BUILD\Programas\SymbianOS\QHelloWorld\group\QHELLOWORLD\WINSCW
27+
28+- There it will put the source code, a QHELLOWORLD.WINSCW file and a UDEB directory with compiled .o files for the software
29+
30+- It will also create a executable (QHelloWorld.exe) for the software on the directory: C:\Symbian\UIQ3SDK\epoc32\release\winscw\udeb
31+
32+- Perl files involved: abld.pl makmake.pl
33+
34+### Default SDK Build Process for UIQ 2.1
35+
36+The build process for UIQ 2.1 is very similar to UIQ 3, but there are some differences.
37+
38+There commands to build a software are:
39+
40+ cd C:\Programas\UIQ21\UIQExamples\HelloWorld
41+ devices -setdefault @UIQ_21:com.symbian.UI
42+ bldmake bldfiles
43+ makmake HelloWorld.mmp THUMB
44+ abld build thumb urel
45+
46+This will:
47+
48+- Generate the directory: C:\Programas\UIQ21\epoc32\BUILD\PROGRAMAS\UIQ21\UIQEXAMPLES\HELLOWORLD\HELLOWORLD\THUMB\UREL
49+
50+- Fill the directory C:\Programas\UIQ21\epoc32\BUILD\PROGRAMAS\UIQ21\UIQEXAMPLES\HELLOWORLD it with many Makefiles
51+
52+- Create a ABLD.BAT script
53+
54+- Fill the first UREL directory with .o object files and a .in file
55+
56+- The THUMB directory will have a .THUMB a .rsg and a .def library definition file
57+
58+- It will also create a executable (QHelloWorld.app) for the software on the directory: /epoc32/release/thumb/urel
59+
60+- Perl files involved: bldmake.pl abld.pl makmake.pl
61+
62+The main difference is that all applications are actually DLLs on UIQ 2, so we need to use tools like dlltool and .def files.
63+
64+### Modifyed Build Process
65+
66+To aid on this complex build process, a command line tool called "mksymbian" will be created.
67+
68+Default UIQ build process expects that the source be on a rather peculiar directory format. This is unsuitable for cross-platform development. Just imagine if each OS required a different directory tree, cross-platform would be impossible. Instead we will simply require a .ini file specifying the target options.
69+
70+On the folder of the project you should have source code and also one or more project information files. This files should be in INI format, and specifies information for our tool to build the project.
71+
72+To compile a project with it you can do:
73+
74+`mksymbian build myproject.ini`
75+
76+One important task of this build tool is identifying correctly where Symbian SDKs and Free Pascal are installed. You can verify this using the command:
77+
78+`mksymbian showpath`
79+
80+### Registering a application on the UIQ Emulator
81+
82+Each application should provide a non-localizable resource file with information necessary to register it on the emulator (or later on a real phone). This file ends with the .rss extension and should look similar to this example one:
83+
84+ // QHelloWorld_reg.rss
85+ #include <AppInfo.rh>
86+
87+ UID2 KUidAppRegistrationResourceFile
88+ UID3 0x01000001
89+
90+ RESOURCE APP_REGISTRATION_INFO
91+ {
92+ // filename of application binary (minus extension)
93+ app_file = "QHelloWorld";
94+ }
95+
96+During the build process this file will be compiled into a .RCS resource file. On the emulator, all registration files should be located on the directory \private\10003a3f\apps
97+
98+Mksymbian tool will take care of compiling the resource and placing it on the correct position. There next paragraphs on this sections are technical details of how this is done.
99+
100+Looking at the UIQ 3 SDK directory structure you will find 3 directories that match \private\10003a3f:
101+
102+- C:\Programas\UIQ3SDK\epoc32\data\Z\private\10003a3f\apps
103+
104+Here a copy of your RCS resource file will be put
105+
106+- C:\Programas\UIQ3SDK\epoc32\winscw\c\Private\10003a3f
107+
108+This directory contains only some binary files.
109+
110+- C:\Programas\UIQ3SDK\epoc32\release\winscw\udeb\Z\private\10003a3f\apps
111+
112+Here a copy of your RCS resource file will be put, and you can also see RCS files for all other software installed on the emulator.
113+
114+## Comments about the Build system
115+
116+there is also an replacement for the Symbian build system which uses Makefiles: <http://www.koeniglich.de/sdk2unix/symbian_sdk_on_unix.html> -- User:Johanneswi
117+
118+
119+That build system only targets the ARM device, not the Emulator, and isn´t available for UIQ 3. So it doesn´t help much --Sekelsenmat 16:11, 26 October 2006 (CEST)
120+
121+A simpler way would be to concentrate on the POSIX compatible API that Symbian OS has... that would be much faster to do.... And it would not be fixed to UIQ only ...
122+
123+We could probably reuse existing bindings (for example the Unix rtl or something like that...) -- User:Johanneswi
124+
125+## Comments about File formats
126+
127+The emulator does not use the E32 fileformat used by the real devices but makes an normal PE exe that bind against the emulator libraries so thath should be much easier to do than to really build ARM binaries... (I don't have Windows right now so I can't test anything yet...) -- User:Johanneswi
128+
129+
130+Yes, and that´s why the first target will be the emulator =) --Sekelsenmat 16:11, 26 October 2006 (CEST)
131+
132+## Misc info from old SymbianOS Port page
133+
134+1\. Compiler seems to be complete for arm, but THUMB and interworking is something good for symbian.
135+
136+2\. It seems there are some ABI incompatibilities, at least people from symbian irc insist only symbian 9 and greater is ok with arm abi, find out what they are and how to implement them.
137+
138+3\. Everything on symbian is in C++, and fpc cannot connect to C++ object files (yet). The only solution is to create bindings in c and then link fpc to c instead.
139+
140+These tools seems to be helpful in some way:
141+
142+`  smoke, swig, doxygen`
143+
144+And some links to look at in this field:
145+
146+[rvelthuis.de/articles/articles-cppobjs.html](http://rvelthuis.de/articles/articles-cppobjs.html)
147+
148+[qtcsharp.sourceforge.net/background.php](http://qtcsharp.sourceforge.net/background.php)
149+
150+[dot.kde.org](http://dot.kde.org/1095964115/1095969821/1095971862/1095972037/1095972799/1096037901/1096041117/1096057255/)
151+
152+[wiki.kde.org/tiki-index.php?page=Language+Bindings+Talk](http://wiki.kde.org/tiki-index.php?page=Language+Bindings+Talk)
153+
154+[wiki.dotgnu.info/Smoke/Refract](http://wiki.dotgnu.info/Smoke/Refract)
155+
156+4\. Symbian has a very complicated build/make process. How to do that?
157+
158+5\. Symbian has different kinds of applications, some new application modes have to be introduced.
159+
160+6\. Investigate how other languages, not C++, deal with these problems.
161+
162+7\. Neither Symbain OS nor its C++ have exceptions, static data and some strange other things. why? Does it mean we cannot have them on fpc, too? How to deal with this?
163+
164+8\. Someone with good knowledge and background of symbian is defenitely needed here. I just know how to code simple programs on symbian.
165+
166+9\. The source code of gcc might be useful too.
167+
168+Some usefull links:
169+
170+[Symbian programming tutorial, recommended!](http://www.sciabarra.com/symbian-tutorial/?Symbian_C%2B%2B_Programming_Tutorial)
171+
172+[Tutorial](http://symbian.compactbyte.com/)
173+
174+[Pythong for series60](http://www.postneo.com/postwiki/moin.cgi/PythonForSeries60)
175+
176+[SDKS](http://www.newlc.com/-SDKs-)
177+
178+[Symbian OS design faults, interesting](http://www.codeproject.com/ce/Symbian_OS_design_faults.asp)
179+
180+Good books:
181+
182+Wiley, Programming for the Series 60 Platform and Symbian OS (2003)
183+
184+Wiley, Symbian OS Internals Real time Kernel Programming Dec 2005
185+
186+## See Also
187+
188+- [[SymbianOS]]
189+
190+---
191+*From the Free Pascal wiki, page "Symbian OS Internals", as it stood on 2013-04-07 after a change by Jwdietrich, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
192+Category: Symbian

Back to history