Phony Programming (Series 60 Symbian Phones)

Similar documents
Phony Programming (Series 60 Symbian Phones)

Phony Programming (Series 60 Symbian Phones)

Phony Programming (Series 60 Symbian Phones) What s so special about phones?

More Python on Series 60

Mobile Phone Programming

Operating System Services. User Services. System Operation Services. User Operating System Interface - CLI. A View of Operating System Services

An overview of mobile and embedded platforms

The Slide does not contain all the information and cannot be treated as a study material for Operating System. Please refer the text book for exams.

Chapter 1: Introduction to Computers and Java

8/23/2014. Chapter Topics. Introduction. Java History. Why Program? Java Applications and Applets. Chapter 1: Introduction to Computers and Java

CHAPTER 2: SYSTEM STRUCTURES. By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edit9on

Open Source Software in mobile devices. Timofey Turenko Nokia Research Center, Office of CTO

Mobile Opportunities for the Open Source Community

Chapter 2. Operating-System Structures

Chapter 2: Operating-System Structures

Copyright

Operating Systems (2INC0) 2018/19. Introduction (01) Dr. Tanir Ozcelebi. Courtesy of Prof. Dr. Johan Lukkien. System Architecture and Networking Group

Chapter 2: Operating-System Structures

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edition

Topics. Operating System I. What is an Operating System? Let s Get Started! What is an Operating System? OS History.

Last 2 Classes: Introduction to Operating Systems & C++ tutorial. Today: OS and Computer Architecture

Chapter 2: Operating-System Structures

Embedded Systems. Octav Chipara. Thursday, September 13, 12

Chapter 2 Operating-System Structures

Four Components of a Computer System

Chapter 2: Operating-System Structures

CHAPTER 1 Introduction to Computers and Java

IJRDTM Kailash ISBN No Vol.17 Issue

Introduction to System Programming

Chapter 2: Operating-System Structures

15 Sharing Main Memory Segmentation and Paging

16 Sharing Main Memory Segmentation and Paging

Chapter 2: Operating-System Structures. Chapter 2: Operating-System Structures. Objectives. Operating System Services

Lecture 1 Introduction Pervasive & Mobile Computing MIT 6.883

REAL TIME OPERATING SYSTEM PROGRAMMING-I: VxWorks

A Survey on Virtualization Technologies

Introducing the Haiku Operating System

Operating Systems. Operating System Structure. Lecture 2 Michael O Boyle

Basic Concepts & OS History

Operating-System Structures

Chapter 2: Operating-System Structures. Operating System Concepts Essentials 8 th Edition

Topics. Operating System. What is an Operating System? Let s Get Started! What is an Operating System? Where in the Book are we?

Chapter 2: Operating-System

What are some common categories of system calls? What are common ways of structuring an OS? What are the principles behind OS design and

RTOS Real T i Time me Operating System System Concepts Part 2

Android System Development Training 4-day session

Android Sdk Tutorial For Windows 7 64 Bit Full Version

Debugging Applications in Pervasive Computing

CMSC131. Hardware and Software. Hardware

CMSC131. Hardware and Software

Contents Slide Set 9. Final Notes on Textbook Chapter 7. Outline of Slide Set 9. More about skipped sections in Chapter 7. Outline of Slide Set 9

Chapter 2: System Structures

CHAPTER 2 BASIC OPERATING SYSTEM CONCEPT MANAGEMENT

AC OB S. Multi-threaded FW framework (OS) for embedded ARM systems Torsten Jaekel, June 2014

Real-time for Windows NT

Chapter 2: System Structures

Memory management OS

Copyright

Real-Time Programming

Hardware OS & OS- Application interface

Objectives. Chapter 2: Operating-System Structures. 2.1 Operating System Services

Firepoint: Porting Application to Mobile Platforms

Introduction to Virtual Machines. Michael Jantz

AUTOBEST: A United AUTOSAR-OS And ARINC 653 Kernel. Alexander Züpke, Marc Bommert, Daniel Lohmann

Hardware. Hardware is the physical components that you knock on, that you can touch. (Monitor, processor chip, CD-ROM drive set.)

File System Structure. Kevin Webb Swarthmore College March 29, 2018

From last time. What is the maximum size of a file in bytes? What is the maximum total size of directories and files in a single disk partition?

Operating-System Structures

Operating System: Chap2 OS Structure. National Tsing-Hua University 2016, Fall Semester

Palm Platform Hardware Intro to the Palm OS and application programming

Operating Systems CMPSCI 377 Spring Mark Corner University of Massachusetts Amherst

Spring It takes a really bad school to ruin a good student and a really fantastic school to rescue a bad student. Dennis J.

Slide Set 8. for ENCM 369 Winter 2018 Section 01. Steve Norman, PhD, PEng

Installing and configuring an Android device emulator. EntwicklerCamp 2012

Mobile Phone Programming

Mobile Graphics Ecosystem. Tom Olson OpenGL ES working group chair

Intro Python Material

Tutorial on Basic Android Setup

CSE 4/521 Introduction to Operating Systems

ECE 471 Embedded Systems Lecture 12

CS 177 Recitation. Week 1 Intro to Java

CIS Operating Systems Memory Management Cache. Professor Qiang Zeng Fall 2017

Android App Development

Architectural Support for Operating Systems

Cost of Your Programs

Copyright

ARM Simulation using C++ and Multithreading

Lecture 1 Introduction to Android. App Development for Mobile Devices. App Development for Mobile Devices. Announcement.

Multi-level Translation. CS 537 Lecture 9 Paging. Example two-level page table. Multi-level Translation Analysis

ECE 471 Embedded Systems Lecture 12

Chapter 8 Operating Systems and Utility Programs

Migrating to Cortex-M3 Microcontrollers: an RTOS Perspective

Introduction to the Raspberry Pi AND LINUX FOR DUMMIES

Chapter 2: Operating-System Structures. Operating System Concepts 8 th Edition

CSE 421/521 Final Exam

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edit9on

Programming & Computers

Operating System Services

CIS Operating Systems Memory Management Cache and Demand Paging. Professor Qiang Zeng Spring 2018

Transcription:

Phony Programming (Series 60 Symbian Phones) Larry Rudolph MIT 6.883 & SMA 5508 March 6, 2006 1

What s so special about phones? Ignorant Operator really ignorant operator Scarce Resources Size -- Screen and keyboard area Reboot -- these are rare events Power -- slow processor, small memory, small disk Heat -- To keep this low, must constrain above Price -- Different than PC, since each feature costs the same, due to volumes Brand loyalty -- hardly any, mistakes are costly It s new and exciting!

What s so special about phony programming? Inherently very little --- Practically very much History originally: phones were h/w appliances past: s/w - h/w co-design reduced costs near past: new features all s/w near future: 3rd party software In computer world, two approaches Intel: H/W, Microsoft: O/S, separate h/w from s/w Apple: H/W & S/W, easier to integrate, high costs $ Companies have no history of being open!!

Current Choices Most phones have two ASICs Modem/Telephone service Embedded processor and extra features Palm-Based: Slow to integrate Pocket-PC: Appears to be aggressive Can they maintain two OS s (Windows & WinCE)? Linux: (actually, Linux+Java) Still hidden from user Motorola phones ipaq 6315 has GSM/SIM Symbian: Mostly on Nokia and Sony/Ericsson IDC Predicts: Pa:10%, Po:27%, Li:4%, Sy:53%

Palm Phones

Pocket PC Phones

Linux Based Phones

Symbian Phones

Symbian Epoc OS Originally developed for the Psion handheld computer competition with Palm single user, small memory, instant-on, no network EPOC operating system Symbian independent company partly owned by Nokia, Sony (no one controls them) EPOC and Symbian names became intermixed Nearly all documentation and tools are for commercial developers high start-up cost

Larry s Deja Vu Despite the fact that Programmable Mobile Phones are new artifacts the OS and programming repeat mistakes Designs that make sense for disconnected, single use devices, remain as devices become connected and multi-use and multi-tasked. Inertia is a powerful force

Programming Languages Series 60 Phones C++ for Symbian not so easy Java highly sandboxed. Python access to all the phones functions no access to file system, phone, and more not the choice language for virus writers nearly ready for public release will have interface to all Symbian API s

Symbian OS Basics Kernel: Protected Mode; Controls H/W Server: Manages one or more resources no UI (user interface) yes API (application program interface) may be device driver or kernel service Application: A program with a UI Each application is a process; own virtual address If interacts with server, can be called a client Engine: part of app. manipulates its data not UI

Processes & Threads Three boundaries DLL or module: cheap to cross Privilege: medium to cross Process: expensive to cross Processes, Threads, Context Switches Process: has its own address space (256 MB) Thread: Unit of execution within a process Preemptively scheduled; 2MB nonshared ==> 128 thds/pro Executables exe: single entry point dynamic link library (DLL): multiple entries Shared (OS) vs Polymorphic (app)

RAM Memory Parts

Memory RAM: partitioned into 4k pages kernel, process, DLL, MMU tables, Video, C: Thread memory: Shared:Heap, Nonshared:Stack DLL -- no writable static data (yes for exe s) requires multiple copies of instantiated dll Files (does this remind you of something) C: RAM -- r/w file system. Zero d on cold boot restored from ROM on cold boot Z: ROM -- can be reflashed (not easy) D: Memory Card 512 byte blocks written atomically; VFAT format

Event Handling Efficient handling major OS design native OS server is single event-handling thread Symbian organized as Event-driven Active Objects: non-preemptive event handling and client-server structure

Response to key-press

Active Objects Each active object has virtual member function called RunL() gets called when event happens events have associated priority Active Objects execute non-preemptively RunL() should execute for short time no need for mutex, semaphores, critical sections fewer context-switches Compute-intensive threads: Simulate using pseudoevents split task into pieces, generate low-prio event

Java Programming Lots of examples at www.forum.nokia.com great for games and network connectivity Compile on server Install on phone via: bluetooth connection mms message (email) upload from web server On phone, java applet must be opened to install before being run.

C++ Programming The real stuff but documentation is difficult Everything depends on the SDK Software Development Kit runs under Windows The processor on phone is ARM (same as ipaq) Must do cross-compilation compile with different libraries and assembly instructions There is an Emulator -- but it is really a simulator e.g. it executes x86 code not arm code emulator is needed for debugging so must compile either for ARM or x86

C++ Programming Tutorials: C++ for Java programmers http://www.cs.brown.edu/courses/cs123/javatoc.shtml There are many others on-line Easier to go from java to c++ (java has less weirdness)

Symbian Layers

Symbian 60 Phone Programming in Python Larry Rudolph MIT 6.883 & SMA 5508 March 2006 26

Installing stuff a package or installation file in symbian: application_name.sis Get it onto the phone push via bluetooth (or send message) Open up message and install if there is flash memory, install it there

Hello World import appuifw appuifw.note(u Hello World,u info ) import appuifw # the application user interface fw(?) u Hello World, # u for a unicode string. All GUI # strings are unicode. Others can be u info # specifies the type of note

Get User Input import appuifw planet = appuifw.query(u Which planet?,u text ) appuifw.note(u Hello +planet, u info ) query() pops up a dialog with prompt string and input type other types can be number date code the + concatenates the two unicode strings

Get More User Input import appuifw planets = [ u Mars, u Earth, u Venus ] prompt = u Enter your home planet index = appuifw.menu(planets, prompt) appuifw.note(u Hello +planets[index], u info ) The menu method pops up the list of items in first param It returns with an index into the list of menu items Note that the prompt param must also be a unicode string

Our own interface: sma.py There are a bunch of annoyances in the current UI Let s put wrappers around basic calls We should go back and do this for location 32

Hiding the unicode # this is file sma.py # wrappers to appuifw, e32, and bluetooth def note( str, type = info ): appuifw.note( unicode(str), type ) def query( str, type = text ): return appuifw.query( unicode(str), type ) def menu( list, prompt = select one ): ulist = [ unicode(u) : for u in list ] return appuifw.menu( ulist, unicode( prompt ) )

Using sma.py import sma planets = [ Mars, Earth, Venus ] prompt = Enter your home planet index = sma.menu(planets, prompt) sma.note( Hello +planets[index] )

No more slides It is easier to go through the python reference document, rather than reproducing it all here...