CASE STUDY 1: Linux and Android Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Slides:



Advertisements
Similar presentations
Android Application Development A Tutorial Driven Course.
Advertisements

14 Macintosh OS X Internals. © 2005 Pearson Addison-Wesley. All rights reserved The Macintosh Platform 1984 – first affordable GUI Based on Motorola 32-bit.
Chap 2 System Structures.
1 UNIX 1 History of UNIX 2 Overview of UNIX 3 Processes in UNIX 4 Memory management in UNIX 5 The UNIX file system 6 Input/output in UNIX.
1 Case Study 1: UNIX and LINUX Chapter History of unix 10.2 Overview of unix 10.3 Processes in unix 10.4 Memory management in unix 10.5 Input/output.
Chapter 1 Introduction
INTRODUCTION OS/2 was initially designed to extend the capabilities of DOS by IBM and Microsoft Corporations. To create a single industry-standard operating.
2: OS Structures 1 Jerry Breecher OPERATING SYSTEMS STRUCTURES.
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
Operating Systems - Introduction S H Srinivasan
Figure 1.1 Interaction between applications and the operating system.
Cs238 Lecture 3 Operating System Structures Dr. Alan R. Davis.
File System Implementation
Linux Operating System
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Modified from the text book.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Operating System Organization.
Case study 2 Android – Mobile OS.
Emerging Platform#4: Android Bina Ramamurthy.  Android is an Operating system.  Android is an emerging platform for mobile devices.  Initially developed.
Chapter 8 Windows Outline Programming Windows 2000 System structure Processes and threads in Windows 2000 Memory management The Windows 2000 file.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 11 Case Study 2: Windows Vista Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
@2011 Mihail L. Sichitiu1 Android Introduction Platform Overview.
Chapter 6 Operating System Support. This chapter describes how middleware is supported by the operating system facilities at the nodes of a distributed.
CSC 322 Operating Systems Concepts Lecture - 4: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Threads, Thread management & Resource Management.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 14, 2005 Operating System.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3: Operating Systems Computer Science: An Overview Tenth Edition.
Introduction to Operating Systems Chapter 1. cs431 -cotter2 Lecture Objectives Understand the relationship between computing hardware, operating system,
Android for Java Developers Denver Java Users Group Jan 11, Mike
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 1 Introduction Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc.
4061 Session 29 (5/1). Today Review, Looking Ahead DRM Teaching/TAing evaluations.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: Operating-System Structures.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Background: Operating Systems Brad Karp UCL Computer Science CS GZ03 / M th November, 2008.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.
Operating System What is an Operating System? A program that acts as an intermediary between a user of a computer and the computer hardware. An operating.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 10 Case Study 1: LINUX Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
UNIX Unit 1- Architecture of Unix - By Pratima.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
UNIX & Windows NT Name: Jing Bai ID: Date:8/28/00.
CSC414 “Introduction to UNIX/ Linux” Lecture 2. Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage.
Threads, Thread management & Resource Management.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
Chapter 1 Introduction  What is an operating system  History of operating systems  The operating system zoo  Computer hardware review  Operating system.
操作系统原理 OPERATING SYSTEM Chapter 1 Introduction 概 述.
What is a Process ? A program in execution.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 2.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
The Ingredients of Android Applications. A simple application in a process In a classical programming environment, the OS would load the program code.
Android Overview Reference: Embedded Android by Yaghmour.
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved OPERATING SYSTEMS DESIGN.
Introduction to Operating Systems Concepts
Computer System Structures
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Android Runtime – Dalvik VM
Case Study 1: UNIX and LINUX
CASE STUDY 1: Linux and Android
Operating System Structure
Lecture 1 Runtime environments.
CMPE419 Mobile Application Development
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Chapter 2: The Linux System Part 2
Chapter 2: System Structures
Operating Systems: A Modern Perspective, Chapter 3
Android Platform, Android App Basic Components
Outline Operating System Organization Operating System Examples
OPERATING SYSTEMS STRUCTURES
CMPE419 Mobile Application Development
Presentation transcript:

CASE STUDY 1: Linux and Android Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

History of UNIX and Linux UNICS PDP-11 UNIX Portable UNIX Berkeley UNIX Standard UNIX MINIX Linux Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Linux Goals Simplicity, elegance, consistency Power and flexibility Lack of useless redundancy Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Linux Kernel Structure Structure of the Linux kernel Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Interfaces to Linux The layers in a Linux system. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

The Shell Command line interface – Faster – More powerful – Easily extensible First word entered will be a program name – Commands take arguments – Wild card characters used – Filters, pipes used Shell scripts Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Linux Utility Programs A few of the common Linux utility programs required by POSIX. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Processes: Fundamental Concepts Process creation in Linux. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Process Management System Calls in Linux Some system calls relating to processes. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Implementation of Processes and Threads in Linux Process descriptors 1.Scheduling parameters 2.Memory image 3.Signals 4.Machine registers 5.System call state 6.File descriptor table 7.Accounting 8.Kernel stack 9.Miscellaneous Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Implementation of Processes and Threads in Linux The steps in executing the command ls typed to the shell. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Threads in Linux Bits in the sharing flags bitmap. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. Native POSIX Thread Library (NPTL) is a software feature that enables the Linux kernel to efficiently run programs written to use POSIX Threads. New threads are created with the clone() system call.

Threads in Linux Linux does not distinguish between processes or threads Uses tasks to refer to a flow of control within a program.

Scheduling in Linux Three classes of threads for scheduling purposes: 1.Real-time FIFO. 2.Real-time round robin. 3.Timesharing. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Memory Management Fundamental Concepts (a) Process A’s virtual address space. (b) Physical memory. (c) Process B’s virtual address space. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Memory Management Fundamental Concepts Two processes can share a mapped file. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Implementation of I/O in Linux The Linux I/O system showing one file system in detail. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

The Linux Virtual File System File system abstractions supported by the VFS. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Implementation of I/O in Linux Some of the file operations supported for typical character devices. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Linux File System: Fundamental Concepts (1) Some important directories found in most Linux systems. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

I/O in Linux – Networking The uses of sockets for networking Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

File System Calls in Linux Some system calls relating to files. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

File System Calls in Linux The fields returned by the stat system call. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. stat() system call that returns file attributes about an inode.

File System Calls in Linux Some system calls relating to directories. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

NFS Architecture Figure Examples of remote mounted file systems. Directories are shown as squares and files are shown as circles. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

NFS Implementation The NFS layer structure Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Linux Security Fundamental Concepts Some example file protection modes. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Security System Calls in Linux Some system calls relating to security. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Android Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Android – Design Goals 1.Open-source platform for mobile devices 2.Support 3 rd party apps with robust, stable API 3.3 rd party apps compete on level playing field 4.Users need not deeply trust 3 rd party apps 5.Support mobile user interaction 6.Manage app processes for users 7.Encourage apps to interoperate, collaborate 8.Full general-purpose OS Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Android Architecture Overview Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Dalvik Process virtual machine with just-in-time compilation.dex files (Dalvik executables) – Translated from java bytecode Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Android Architecture Android process hierarchy. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Android Runtime (ART) Ahead-of-time (AOT) compilation – Compiles into machine code at installation Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Application Sandboxes Security Runs applications in a sandbox Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Android Architecture (2) Publishing and interacting with system services. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Wake Locks Contrast idle CPU, true sleep 1.Idle state may use more power than true sleep 2.Idle CPU can wake up at any moment if work becomes available 3.Idle CPU does not tell you that you can turn off other hardware not needed in true sleep Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Dalvik Figure Creating a new Dalvik process from zygote. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Binder IPC Binder IPC architecture. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Binder Kernel Module (1) Basic Binder IPC transaction Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Binder Kernel Module (2) Binder cross-process object mapping. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Binder Kernel Module (3) Transferring Binder objects between processes. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Binder User-Space API (1) User-space object-oriented library 1.IBinder is an abstract interface for a Binder object 2.Binder is a concrete Binder object 3.Parcel is a container for reading and writing data that is in a Binder transaction. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Binder User-Space API (2) Three classes now make it fairly easy to write IPC code: Subclass from Binder. 1.Implement onTransact to decode and execute incoming calls. 2.Implement corresponding code to create a Parcel that can be passed to that object’s transact method. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Binder User-Space API (3) Figure Binder user-space API. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Binder Interfaces and AIDL (1) Figure Simple interface described in AIDL. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Binder Interfaces and AIDL (2) Figure Binder interface inheritance hierarchy. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Binder Interfaces and AIDL (3) Figure Full path of an AIDL-based Binder IPC. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Android Applications (1) Figure Basic service manager AIDL interface. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Android Applications (2) Contents of an apk 1.A manifest describing what the application is, what it does, and how to run it 2.Resources needed by the application 3.The code itself 4.Signing information, securely identifying the author Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Android Applications (3) Figure Basic structure of AndroidManifest.xml. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Android Applications (4) Figure Basic structure of AndroidManifest.xml. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Activities (1) Figure Starting an application’s main activity. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Activities (2) Figure Starting the camera application after . Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Activities (3) Figure Removing the process to reclaim RAM for the camera. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Activities (4) Figure Sharing a camera picture through the application. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Activities (5) Figure Returning to the application. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Services (1) A service has two distinct identities: 1.It can be a self-contained long-running background operation. 2.It can serve as a connection point for other applications or the system to perform rich interaction with the application Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Services (2) Figure Starting an application service. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Services (3) Figure Interface for controlling a sync service’s sync interval. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Services (4) Figure Binding to an application service. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Receivers Figure Sending a broadcast to application receivers. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Content Providers Figure Interacting with a content provider. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Security (2) Figure Requesting and using a permission. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Security (3) Figure Accessing data without a permission. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Security (4) Figure Sharing a picture using a content provider. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Security (5) Figure Adding a picture attachment using a content provider. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Starting Processes Figure Steps in launching a new application process. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Process Lifecycle Figure Process importance categories. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Process Dependencies (1) Figure Typical state of process importance Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Process Dependencies (2) Figure Process state after stops using camera Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

End Chapter 10 Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.