22
Android – Mobile OS Case study 2

Case study 2

  • Upload
    callie

  • View
    26

  • Download
    0

Embed Size (px)

DESCRIPTION

Case study 2. Android – Mobile OS. Sources and extra reading. Silberschatz , Galvin, Gagne. Operating System Concepts Essentials. 8th Edition. ISBN: 978-0-470-88920-6 A. Tanenbaum . Modern Operating Systems. 3rd Edition. ISBN: 0136006639 - PowerPoint PPT Presentation

Citation preview

Page 1: Case study 2

Android – Mobile OS

Case study 2

Page 2: Case study 2

Silberschatz, Galvin, Gagne. Operating System Concepts Essentials. 8th Edition. ISBN: 978-0-470-88920-6

A. Tanenbaum. Modern Operating Systems. 3rd Edition. ISBN: 0136006639  H. Al-Rayes. Studying Main Differences between Android & Linux Operating Systems. Diyala University.

Android Developer Website. http://developer.android.com

Sources and extra reading

Page 3: Case study 2

History of Android Android design principles Android Architecture Memory Management Threads and Scheduling Android File System Security Programming Interface

Topics covered in this session

Page 4: Case study 2

- What is android? Linux 2.6 based operating system for mobile devices.

- Open source and released under Apache Licence (Carriers can modify it before distributing).

- Google acquired android in 2005.- Android 1.0 released 2008.- In 2012 Android 4.2 released- Improvements include support for new devices:

- Cameras- Multi core CPU- Barometer- etc

History of Android

Page 5: Case study 2

Long battery life. Fast boot up. Fast response. Applications (Programming environment?) Security

How do these differ from the needs of a desktop system?

Consider how the above are met by the system design.

Design principles – What is required of a mobile OS?

Page 6: Case study 2

Battery Touch screen Portable (Mobile CPU) More limited memory Fewer devices

Mobile hardware differences

Page 7: Case study 2

Android Architecture

Source: http://developer.android.com/about/versions/index.html

Page 8: Case study 2

Android Architecture

Source: http://developer.android.com/about/versions/index.html

Page 9: Case study 2

Android Architecture

Source: http://developer.android.com/about/versions/index.html

Page 10: Case study 2

Android Architecture

Source: http://developer.android.com/about/versions/index.html

Page 11: Case study 2

Android Architecture

Source: http://developer.android.com/about/versions/index.html

Page 12: Case study 2

Application life cycle

Page 13: Case study 2

Android uses it’s own virtual machine to manage application memory.

Dalvik VM allows multiple instances of VM to be running efficiently in parallel.

Memory management

Page 14: Case study 2

Differences between mobile app cycle and desktop app cycle?

Key principles: Android does not usually kill an app, they keep running even after

you switch, but saves state Task killers? Android kills apps when memory usage too high.

But saves it’s state for quick restart.

Uses Linux’s time sliced scheduling policy based on priority

Process Management

Page 15: Case study 2

Process Priorities

Split into background and foreground.

What happens if UI thread is starved?

Page 16: Case study 2

Flash Hard Disk Drives

Random Access ~0.1ms 5-10ms

File fragment impact No Greatly impacted

Total power ½ to 1/3 of HDD Up to 15+ watts

Reliability Reliable Less reliable due to mechanical parts

Write longevity Limited number of writes. Less of a problem

Capacity <=512GB Up to 4TB

Price $1.5 - 2.0 GB $0.10 - 0.20 GB

Disk I/O

Page 17: Case study 2

What needs storing? Consider a map application (Lat/long).

Swapping to flash affecting life.

Why not use swapping?

Page 18: Case study 2

Supports multiple different file systems (based on Linux Kernel).

Usually yaffs2/vfat/ext4, depending on device manufacturer.

Partitions: /boot (Included android kernel) /system (Android GUI and pre-installed applications). – Read only /recovery (Backup) /data (User data) /cache (Frequently accessed data) /misc (Contains misc system settings in form of on/off switches) /sdcard (SD card)

Android File System

Page 19: Case study 2

Android seeks to be the most secure and usable operating system for mobile platforms by re-purposing traditional operating system security controls to:

Protect user data Protect system resources (including the network) Provide application isolation

To achieve these objectives, Android provides these key security features:

Robust security at the OS level through the Linux kernel Mandatory application sandbox for all applications Secure interprocess communication Application signing Application-defined and user-granted permissions

Security

Page 20: Case study 2

Assigns .unique user ID (UID) to each android application. Uses UNIX style file permissions due to different UIDs Ensures app A doesn’t read app B’s files. Ensures app A doesn’t exhaust B’s memory Ensures app A doesn’t exhaust B’s CPU usage Ensures app A doesn’t exhaust user Bs devices (GPS, BT) Linux kernel enforces security between applications Stops memory corruption errors causing vulnerabilities. Read only system partition

Security Continued

Page 21: Case study 2

Use of restricted APIs require application permissions.

Application Signing. Application packages are signed to identify author and prevent tampering. Some windows 7 system files are signed in a similar way.

Security Continued

Page 22: Case study 2

Each program runs in it’s own VM. Need to understand an activities lifecycle. Make use of Android SDK Applications programmed in Java, with layouts coded in

XML. Packaged as .apk files for delivery through Android

store. Importance of file size + data usage.

Programming for Android