Sie sind auf Seite 1von 22

POCKET PC COMPILER

MINI PROJECT REPORT

MASTER OF COMPUTER APPLICATIONS

BY
AMIT KUMAR SINHA

Under the Guidance of


Dr. V.K. GOVINDAN

DEPARTMENT OF COMPUTER ENGINEERING

NATIONAL INSTITUTE OF TECHNOLOGY CALICUT


NIT CAMPUS P.O, KOZHIKODE 673601, KERALA

1
National Institute of Technology Calicut

Department of Computer Engineering

CERTIFICATE

This is to certify that the work reported in this project report entitled ‘POCKET PC
COMPILER’ is a bonafide record of the work done by AMIT KUMAR SINHA
(Y2M001), a student in the Department of Computer Engineering, National Institute
of Technology Calicut .

Head of the Department: Project Guide:

Dr.V.K.Govindan Dr.V.K.Govindan
Professor & HOD Professor & HOD
Dept. of Computer Engineering Dept. of Computer Engineering
NIT, Calicut NIT, Calicut

2
ACKNOWLEDGEMENT

I am deeply indebted to my project guide Dr. V. K. Govindan, Head of the Department,


Department of Computer Engineering, National Institute of Technology, Calicut, for his
encouraging support and guidance through out my project work.

I express my heartiest thanks to Dr. Vineeth Kumar Paleri, Asst. Professor, Department
of Computer Engineering, National Institute of Technology, Calicut, for the co-operation
rendered by him during the period of my project work.

I would also like to thank Dr. Priya Chandran, Asst. Professor, Department of
Computer Engineering, National Institute of Technology, Calicut, for her valuable
suggestions.

Last but not the least, I would like to sincerely thank all my friends , for their moral
support, valuable suggestions and help during the course of this work.

AMIT KUMAR SINHA

3
ABSTRACT
The study of the feasibility analysis of the implementation of a Compiler in Pocket
PC with considering various constraints, if possible implementation of it. Analysis
mainly focuses on the running the system rather than starting it from the scratch.
The project work shows that it is possible to develop compiler for the concerned
device.

4
Table of Contents

1. Introduction………………………………………………………6

1.1 Problem Definition……………………………………………………………6

2. System Overview………………………………………………….7

3. Design Consideration……………………………………………..8

3.a Assumption and Dependencies……………………………………….8

3.b General constraints……………………………………………………..10

3.c Goal and Guidelines……………………………………………………..12

3.d Development Methods …………………………………………………..13

4. Architectural Strategies…………………………………………....16

5. System Architecture

5.1 Sequence Diagram ………………………………………………………..19

6. Conclusions ……………………………………………………………………..21

7. Policies and Tactic’s……………………………................................21

8. References ………………………………………………………22

5
Introduction

Today’s the market is being captured by small devices like PDA,


Pocket PC, Mobiles and different handheld devices. Still we don’t have the
programming facilities in our smart devices. What is the reason behind it may be
due to architectural constraints due to memory size or due to less effort to
develop such an application. We do have so many compilers available. What is
the compatibility of others with the undertaken project compiler and other
related issues we will take into account? This project emphasis on these areas
and with the considered development a step forward to make a compiler for
Pocket PC.

Problem Definition:

The study of the feasibility analysis of the implementation of a


Compiler in Pocket PC with considering various constraints, if possible
implementation of it. Analysis mainly focuses on the running the system rather than
starting it from the scratch.

6
System Overview

“Pocket PC Compiler” as any other application running in the


Pocket PC or with the help of Cross Compiler must compile the corresponding
Source program and generate a machine object code according as the Processor
installed in the Pocket PC set. Here we are free to use any source language as well as
implementation language as we will first develop the compiler into PC and after
compiling it with the emulator the object code corresponding to it will be installed
into the memory area of Pocket PC.

Up to yet there is no facility exits that gives end user to compile his
programs on the Pocket PC itself for the considered model of Pocket PC. Compaq
ipaq provides a UNIX type shell through which compilation of any program like
written in C is possible

7
Design Considerations

Before going to detail description of the system


implementation all the constraints and assumptions are written below.

Assumptions and Dependencies

Related software or hardware

First of all due to varieties of Pocket PC we must be


confined to a particular set. Here in my implementation I have considered
Toshiba e740

Operating System: Microsoft Mobile Software for Pocket PC

2003 Premium Edition

Processor: Intel PXA263, 400 MHz

Installed RAM: 128 MB SDRAM

ROM installed (max): 32 MB

Wireless connectivity: Integrated, Wi-Fi (IEEE 802.11b)

Audio input: Microphone

Audio output: Speaker(s)

Expansion slot(s): total (free) 1 (1 ) x SD Memory

8
Card, 1 ( 1 ) x CompactFlash Card - type 2

For design process we may consider any integrated development environment


according as the easiness and availability of the software.

Microsoft eMbedded visual Tools 3.0----IDE for mobile application

Microsoft eMbedded Visual C++ 3.0 --offers native code C++ compiler for
Windows mobile based developments

Visual Studio .NET 2003---Smart device programming feature

Sybase Pocket PowerBuilder ---4GL Integrated Development Environment


(IDE). Supports Microsoft Pocket PC

SQL Anywhere Studio----Power full data base server supports Window CE


environment.

SuperWaba-- Java based development tools

Due to different vendors offering different types of Pocket PC architecture still


Microsoft Current Pocket PC hardware partners expected to continue their
support with Pocket PC 2002 include Casio Computer Corp., Cesscom, Compal
Electronics Inc., Compaq Computer Corp., Hewlett-Packard Co., HTC, HTW,
Intermec Technologies Corp., Legend, Mitsubishi Electric Corp., Sagem, Symbol
Technologies and Toshiba Corp.

9
General Constraints
These are some general constraints imposed
before developing the aforementioned system.

Hardware or software environment:

The Toshiba e800 contains Intel XScale architecture is


compliant with the ARM Version 5TE ISA instruction set, excluding the floating-
point instruction set. So the machine code generated must follow the above
instruction set.

End-user environment:

End use will have some editor in which the program will
be written and with the help of the compiler he/she will be able to compile his/her
programs.

Availability or volatility of resources.

As far as if the system is installed in to CompactFlash


Card it will be available always but if it is in RAM then after the discharge of the
battery the object code of the compiler will also be lost.

10
Standards compliance:

There must be linker and loade r to relocate it in the memory


if it is not programmed it into ROM. Window CE provides bootstrap loader but
there is no shell in the Toshiba Pocket PC on which this application can run like
UNIX system.

Interface/protocol requirements:

Some Pocket PC supports MIPS architecture and some ARM


instruction set but the compiler may be design independent of these entire if
appropriate Interface is being used. Pocket PC 2003 (Window CE .NET 4.xOS)
contains the Compact Framework saved in ROM and is supported by Visual
Studio.NET 2003 SDK. Eliminate the problem of developers having to learn
different API’s for each different device.

Memory and other capacity limitations:

We won’t have ha rd disk in Pocket PCbut the system


must have ROM.Only 32 processes can run in this operating system .RAM is
divided into two areas Program memory and Program execution space.

11
Other means of addressing quality goals:

We can directly think of designing the system with the


help of assembly language programming in the Pocket PC itself without using
any IDE and also it would be tougher to implement as there is no shell to run
this type of application. All the modules in the OS are application specific. There
is no direct interaction with the kernel.

Goals and Guidelines

Feasibility study of the Pocket PC Compiler and


with considering all constraints like time available, architectural constraints of the
hardware and IDE availability trying to develop a compiler for a simple and user
friendly language. The project provides a report on the various issues which would
be gone thoro ughly before going to actual development.

12
Development Methods

For the development of the compiler we use bootstrapping


methodology. With the help of existing compiler of the implementation language for
the concerned compiler we will get the first compiler which will give the target
program code and using this compiler again to compile the concerned compiler. We
will get our desired compiler which can run on the specified processor.

C ARM C ARM

C P
C P We don’t
want this
P
Compiler

C ARM C ARM
ARM
C
C ARM
P We want this
compiler which
can be ported to
the Pocket PC with
ActiveSync

For developing a compiler for the specified target program we have to mainly
manipulate the code gene ration part of two phase compiler, and according as the
instruction set of the processor we have to generate the assembly code. The
generated code of the compiler with the aforementioned technique can be ported
into the ROM of the Pocket PC.

13
Reusable software:

So any existing compiler can be used for the feasibility analysis.

For the easiness and simplicity I have taken my own Compiler which was written
for the SIL language and the machine code was for the SIM machine in the starting.
But bootstrapping C source language compiler is required.

Intermediate
Code
Intermediate Code
Source
Front End Code
Program
Optimizer

Code
Be simple to check it easily like generator
SIL (SL) and C (IL)

Target Program
ARM Instructions Set

Implementation language

14
Interface Used:

We can use Windows CE .NET compiler drivers to compile


specified source files into an object file. We can also compile and link specified
source files, object files, and libraries into an executable file or a dynamic-link
library (DLL). The compilers produce Common Object File Format (COFF) object
files. The linkers produce executable files or dynamic-link libraries (DLLs). The
compiler programs compile each source file and, unless otherwise specified, create
an object file for each compile. The compilers automatically include the options
listed at the command line (CL), in the CL environment variable, and any specified
response files. The compiler-driver programs automatically invoke the linker after
compiling, unless we specify otherwise. The compiler provides the names of the
object files and libraries to the linker. The linker uses options listed in the LINK
environment variable together with any linker options provided on the command
line. If conflicts occur, options from the command line override those in the LINK
environment variable .

Execution:

In a Window CE system, ROM –based programs can be


designated as Execute in place (XIP). That is they are executed directly from the
ROM instead of being loaded into program RAM and then execute. The fact that
the code is executed directly from ROM means that the program code doesn’t take
up valuable program RAM. Also since the program doesn’t have to be copied into
RAM before it’s launched, it takes less time to start an application.

15
Architectural Strategies

C may be taken as the Source language and also for the


implementation language as the Visual Studio .Net Support the language. .NET
Compact Framework may be used for the development of the above application.
Perl can also be considered for implementation language as it is more power full for
generating regular expressions. Microsoft eMbedded C++ is also a nice Tool for
developing application for Pocket PC as it provide Emulator for that. ActiveSync
supplies following features for Windows CE based devices:

• Backing up and restoring device data


• Installing and removing Pocket PC applications

ActiveSync supports the interactions between desktop computers and


Windows CE based devices through add-ins called Service Providers which
runs within the ActiveSync framework.

16
System Architecture

System Architecture is depicted with the help of


UML sequence diagram and Language processing system below

UML Sequence Diagram for different compilation phases:

First the initial environment is set up. Next the parseProgram method of C_Parser is
called which returns the root of the AST(Abstract Syntax tree) that was constructed
during this step.On the root node of the AST (an object of type CompilationUnitNode
), Main () invokes the typeCheck method. Each node propagates the typeCheck call
down the AST according to its own type checking logic. If no error occurred during
the type checking phase, Main () calls the translate method on the root node of the
AST which triggers the generation. Again, each node propagates the translate call
down the AST if required by its translation rules.

17
Language Processing System:

Skeletal source program

preprocessor

Source program

Compiler

Target assembly program

Assembler

Relocatable machine code

Loader/linker-editor
Library
,relocatable
object files
Absolute machine code

18
Main () C_Parser Compilation Unit
Node

execute
Parser
Source
and build
define initEnv Up AST

ParseProgram
create

type

Type Check
is propagated
down the
AST
translate

19
Imlementaion:

Reusing my existing compiler I have changed the code generation par


but as it doesn’t support various features so I have also started the work on SmallC
Compiler. As I couldn’t get any ARM emulator or Pocket PC emulator the
generated code couldn’t be tested. Due to different mode of operation as well as
different format of instruction makes the code generator part tougher. But RISC
processors provide fully 32-bit instruction set that makes the advantage.

If we will use any IDE then there would be less effort required to
develop the concerned application. GCC compiler also gives some CPU settings
facilities for the ARM processors. We can check the developed system to correctly
know the design path of the system.

20
Conclusions:

Feasibility analysis shows that implementation of a compiler in Pocket


PC can be continued because:

a) There is enough memory space for the existence of this application.


b) As far as the Operating system is concerned it provides some modules and
DLL which can be used to execute the executable of the compiler.
c) As it is possible to compile other application in the Pocket PC and also
“Hello” program is possible to compile it is advisable to use Visual
Studio.NET 2003 to make the executable file for the compiler.
d) There are some Compilers which are based on the instruction set of ARM
core.
e) Development of the Compiler can started wit h reuse based engineering and
with the help of core ARM emulator it can be checked. But this project is a
long term project so need more work force to develop
f) It would be a great advantage for the end use if this system is being
developed.

Policies and Tactics

Aforementioned system is designed for the academic


purpose and only the student and the faculty members of this institute are the
members to check and upgrade the system. Any part of this document and
system reuse or producing in any form is illegal.

21
References:

[1] AHO A.V. And R. Sethi[2003] “Compiler Principles, Techniques and Tools” Pearson
Education.
[2] Beck L. Leland. “System Software An introduction to System Programming” Pearson
Education Asia.
[3] Ian sommerville. “ Software Engineering “ Pearson Education.

[4] http://support.intel.com/design/Pentium4/components/

[5] http://www.codeproject.com/ce/

[6] http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/dnnetcomp/html/netcfppctoce.asp

22

Das könnte Ihnen auch gefallen