Sign in Join
Wiki copytemporary

SymbianOS: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11> **Warning:** The work was too large, the platform changed too fast and now the entire SymbianOS is deprecated, so the port was abandoned
22
33## Roadmap to port FPC to SymbianOS
44
551. ~~Develop a Hello World application on c++ for SymbianOS UIQ 3~~ - Felipe
662. ~~Convert the Build software from perl to our own building system, and make it build the c++ software~~ - Felipe
773. ~~Effectively start to port the Free Pascal Runtime Library~~ - Felipe
884. Convert some c++ symbian applications to check for errors on the port - Felipe - 1 trivial done, more to go
995. Complete the port of Free Pascal Runtime Library
10106. Start developing with UIQ 2 SDK, and make adjustments for everything to work with it
11117. Make sure everything works on the real Phone with UIQ 2 too
1212
1313## Versions Roadmap
1414
1515The first target will be UIQ 3.0 for the Symbian OS on x86 architecture (the emulator).
1616
1717Next will be the UIQ 2 for x86 emulator, and last the UIQ 2 real device.
1818
1919## Compiling Free Pascal for the Emulator
2020
21211 - Download the latest FPC from Subversion. Make sure you also have the latest stable FPC installed.
2222
23232 - Next you will need a assembler compatible with the Code Warrior linker. Currently this is the GNU Assembler. It´s a good coincidence that the emulator uses normal win32 PE executables, but of course it could use any other format, so FPC will expect a cross-assembler with the correct name. Because of this we can simply copy the as.exe file that comes with FPC releases and rename it.
2424
2525Suppose your win32 gnu assembler is located at: C:\Programas\lazarus20\fpc\2.0.4\bin\i386-win32\as.exe
2626
2727You should make a copy of it with this name: C:\Programas\lazarus20\fpc\2.0.4\bin\i386-win32\i386-symbian-as.exe
2828
29293 - Now, open a Windows Command Line session. The following batch script will execute a full compilation of FPC for the emulator. In this particular case lazarus was installed on C:\Programas\lazarus20 and the fpc 2.1 source code is on C:\Programas\fpc21
3030
3131 PATH=C:\Programas\lazarus20\fpc\2.0.4\bin\i386-win32
3232 cd c:\Programas\fpc21
3333 cd compiler
3434 make i386
3535 cd ..
3636 cd rtl
3737 cd symbian
3838 make FPC=C:\Programas\fpc21\compiler\ppc386.exe
3939
40404 - Building the RTL only is not enougth to compile a Symbian OS application. We also need the c++ bindings which connect our RTL to the Symbian libraries.
4141
42424.1 - To build the bindings you will need the helper application called mksymbian. This application is included with the Free Pascal sources on the directory utils/mksymbian
4343
44444.2 - Next compile mksymbian. There is a lazarus project to help building it, but directly calling the compiler from command line works just as well, like this:
4545
46-`fpc mksymbian.pas`
46+```text
47+fpc mksymbian.pas
48+```
4749
48504.3 - Copy the mksymbian executable to the fpc/rtl/symbian/bindings directory, open a console, go to the fpc/rtl/symbian/bindings directory and type this command:
4951
50-`mksymbian bindings`
52+```text
53+mksymbian bindings
54+```
5155
5256The resulting .o file(s) will be located on: C:\Programas\fpc21\rtl\units\i386-symbian
5357
54585 - Next you can go to the session "Building Symbian OS Applications" below, to learn how to use your compiler to generate a Object Pascal software for Symbian.
5559
5660The Symbian OS RTL will be located at: C:\Programas\fpc21\rtl\units\i386-symbian
5761
5862## Compiling Free Pascal for the real device
5963
6064Not yet implemented.
6165
6266## Building Symbian OS Applications
6367
6468### Overview
6569
6670Building an application on Symbian OS requires some learning, because there are several unique things about Symbian which must be utilized even the most simple applications. For example the UIDs, the need to register a application on the Emulator, etc.
6771
6872The UIQ SDK has a very complex build system composed of several ten thousends lines of Perl code, batch files and Makefiles. It induces the software to have a specific directory structure, which is very bad to port existing software, as well as to write cross-platform software. Because cross-platform is a strong point on Free Pascal, we decided to simplify and improve the process when writing our build system for Symbian. We created a external build utility, called mksymbian, written in Pascal that auxiliates the build process.
6973
7074### Guide for building applications for the Emulator
7175
7276You need first to write a .ini file that will contain Symbian OS specific information. Here is a example file called QPasHello.ini
7377
7478 [Main]
7579 EXENAME=QPasHello.exe
7680 Language=Pascal
7781 ProjectType=EXE
7882 SDK=UIQ
7983 SDKVersion=3
8084 Emulator=1
8185
8286 [FPC]
8387 CompilerPath=C:\Programas\fpc21\compiler\ppc386.exe
8488 AssemblerPath=C:\Programas\lazarus215\fpc\2.1.5\bin\i386-win32\as.exe
8589 RTLUnitsDir=C:\Programas\fpc21\rtl\units\i386-symbian\
8690
8791 [UIDs]
8892 UID2=0x100039CE
8993 UID3=0xE1000002
9094
9195 [Files]
9296 mainsource=QPasHello.pas
9397 mainresource=QPasHello_reg.rss
9498
9599 [Objects]
96100 file0=qpashello.o
97101
98102And the respective QPasHello.pas source file:
99103
100104``` pascal
101105{
102106 QPasHello.pas
103107
104108 *****************************************************************************
105109 * *
106110 * This demonstration program is public domain, which means no copyright, *
107111 * but also no warranty! *
108112 * *
109113 * This program is distributed in the hope that it will be useful, *
110114 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
111115 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
112116 * *
113117 *****************************************************************************
114118
115119 This application will create a popup message 'My Hello World' and then quit
116120
117121 The message will last a few seconds.
118122
119123 Author: Felipe Monteiro de Carvalho
120124}
121125program QPasHello;
122126
123127uses symbian;
124128
125129begin
126130 User_InfoPrint('My Hello World');
127131end.
128132```
129133
130134And also the main resource file QPasHello_reg.rss:
131135
132136 // QHelloWorld_reg.rss
133137 #include <AppInfo.rh>
134138 UID2 0x100039CE
135139 UID3 0xE1000002
136140 RESOURCE APP_REGISTRATION_INFO
137141 {
138142 // filename of app binary (minus extension)
139143 app_file = "QPasHello";
140144 }
141145
142146Next use mksymbian to build your application, like this:
143147
144-`mksymbian build QPasHello.ini`
148+```text
149+mksymbian build QPasHello.ini
150+```
145151
146152If something goes wrong, check if mksymbian located your directories correctly:
147153
148-`mksymbian showpath`
154+```text
155+mksymbian showpath
156+```
149157
150158Also make sure to correct the paths according to your system on the ini file.
151159
152160### Using mksymbian
153161
154162The syntax of this tool is:
155163
156164mksymbian \[action\] \[project file\]
157165
158166Action can be one of the following:
159167
160168- build - Compiles a project
161169- bindings - Compiles the pascal bindings for Symbian OS. It supposes that the necessary files are on the location where the command is executed.
162170- showpath - Shows the paths found for the Symbian SDKs and Free Pascal. Utilized to check if the tool was able to find the tools.
163171
164172The project file is a .ini file with many symbian os specific informations about a project, like the UIDs
165173
166174Target can be one of the following:
167175
168176- WinEmulator - Builds for the x86 emulator
169177- ArmDevice - Builds a binary for use on PDAs and Smartphones
170178
171179Note: The tool parameters are not case-sensitive
172180
173181## Screenshots
174182
175183First pascal symbian os UIQ 3 application:
176184
177185![](/wiki-images/0/0a/First_pascal_symbian_app.PNG)
178186
179187## See Also
180188
181189- [[Programming in Symbian OS]]
182190- [[Symbian OS Internals]]
183191
184192## External Links
185193
186194- <http://developer.uiq.com/> - UIQ version 3 and superior developer community, with SDK download, Forum, Documentation and News.
187195- [1](http://www.symbian.com/developer/techlib/v70sdocs/doc_source/reference/cpp/libc/index.html) docs for the POSIX layer
188196- [2](http://www.symbian.com/developer/techlib/v70sdocs/doc_source/devguides/cpp/base/CStandardLibrary/DesignSTDLIB.html) a bit of description for the POSIX layer
189197- [3](http://search.cpan.org/~rgarcia/perl-5.9.4/README.symbian) - Compiling perl for symbian. They mainly use the POSIX libraries...
190198- [4](https://developer.uiq.com/forum/entry.jspa?externalID=31) - List of the UIQ Phones and the UIQ SDK version to use.
191199- [5](https://developer.uiq.com/forum/kbclick.jspa?categoryID=21&externalID=26&searchID=101700) - APIs changed from UIQ 2.1 to UIQ 3
192200- [6](https://developer.uiq.com/forum/kbclick.jspa?categoryID=21&externalID=20&searchID=101700) - How to port my application from UIQ 2.x to UIQ 3
193201
194202---
195203*From the Free Pascal wiki, page "SymbianOS", as it stood on 2021-06-06 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).*
196204Category: Historical
197205Category: Mobile
198206Category: Outdated information
199207Category: Symbian

Back to history