Top Banner
CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak www.cs.sjsu.edu/~mak
33

CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

Dec 29, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

CS 149: Operating SystemsMay 12 Class Meeting

Department of Computer ScienceSan Jose State University

Spring 2015Instructor: Ron Mak

www.cs.sjsu.edu/~mak

Page 2: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

2Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Android

Designed by Google to run on mobile devices. NASA uses Android for its “cube sats”.

Based on the Linux kernel and facilities. Much written in Java.

Combines open-source code withclosed-source third-party applications. Supports a wide variety of

proprietary cloud services. Google Play online store for Android apps.

Page 3: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

3Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Android Design Goals

Open-source platform for mobile devices Support 3rd party apps with robust, stable API 3rd party apps compete on level playing field Users need not deeply trust 3rd party apps Support mobile user interaction Manage app processes for users Encourage apps to interoperate, collaborate Full general-purpose OS

Page 4: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

4Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Android Architecture

Modern Operating Systems, 4th ed.Andrew Tanenbaum and Herbert BosPearson, 2014ISBN: 978-0133591620

Page 5: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

5Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Android Architecture, cont'd

The init process starts Android daemons. Focused on low-level functions such as

managing file systems and hardware access.

Additional layer of processes that runDalvik's Java language environment. Dalvik is a managed runtime environment. Brought up by the zygote native daemon. JVM bytecode is translated to Dalvik bytecode.

Page 6: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

6Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Dalvik

Modern Operating Systems, 4th ed.Andrew Tanenbaum and Herbert BosPearson, 2014ISBN: 978-0133591620

Page 7: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

7Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Android Application Framework

Modern Operating Systems, 4th ed.Andrew Tanenbaum and Herbert BosPearson, 2014ISBN: 978-0133591620

Page 8: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

8Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Package Manager Example

The package manager provides a framework API for apps to call in their local process. The PackageManager class connects to the

corresponding service in the system server. The PackageManager makes calls on the service.

Calls are implemented as interprocess communication. Android Binder IPC mechanism.

Page 9: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

9Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Binder IPC

Relies on remote procedure calls (RPC).

Modern Operating Systems, 4th ed.Andrew Tanenbaum and Herbert BosPearson, 2014ISBN: 978-0133591620

Page 10: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

10Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Launching a New Application Process

Modern Operating Systems, 4th ed.Andrew Tanenbaum and Herbert BosPearson, 2014ISBN: 978-0133591620

Page 11: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

11Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Process Lifecycle

Process importance categories.

oom_adj: a strict ordering to determine which processes to kill first in an out-of-memory situation.

Modern Operating Systems, 4th ed.Andrew Tanenbaum and Herbert BosPearson, 2014ISBN: 978-0133591620

Page 12: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

12Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Postmortem Reports

Due Monday, May 18 at 11:59 PM A few paragraphs. Word document or just an email message Individual and private.

What did you learn in this class?

What were your accomplishments on your project team?

How well did each of your teammates do?

Page 13: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

13Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Final Exam

Section 3 (9:00 AM): Thursday, May 21 at 7:15 – 9:30 AM in DH 450

Section 2 (3:00 PM): Monday, May 18 at 2:45 – 5:00 PM in MH 233

Section 8 (6:00 PM): Tuesday, May 19 at 5:15 – 7:30 PM in MH 223

It will be similar to the midterm. Covers the entire semester. More emphasis on the second half.

Page 14: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

14Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Disk Storage

Industry standard I/O bus Host-attached storage

Network-attached storage (NAS) Storage-area network (SAN)

Page 15: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

15Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Disk Storage, cont'd

Disk scheduling algorithms FCFS: first-come first-served SSTF: shortest seek time first SCAN: elevator scheduling C-SCAN: circular scan LOOK and C-LOOK

Hierarchical storage management (HSM)

RAID

Page 16: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

16Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

File Systems

File types File attributes File operations File tables File locking

File structure Sequential access Direct (random) access

Page 17: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

17Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

File Systems, cont'd

Disk structure Partitions

Directories Operations Single- and two-level Tree-structured Acyclic graphs

Page 18: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

18Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

File Systems, cont'd

File path names

Mounting a file system

File protection Unix

Page 19: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

19Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

File Systems, cont'd

Implementation Layered architecture

Master boot record Superblock File-control blocks (inodes)

File allocation algorithms Contiguous Linked File allocation table (FAT) Indexed

Page 20: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

20Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

File Systems, cont'd

UNIX directories

Disk block size Free space management

Reliability Consistency

Page 21: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

21Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

File Systems, cont'd

Performance Caching Read ahead Disk arm motion

Log-structured

Virtual

Networked file system (NFS) NFS mounting

Page 22: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

22Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

I/O

Device controllers

Polling

I/O interrupts Priority levels Application-level interrupt handlers

Sockets select()

Clocks and timers

Page 23: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

23Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Virtualization

Virtual machine manager Types Implementation

Page 24: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

24Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Distributed Systems

Advantages

Network operating systems Distributed operating systems

Network structure LAN and WAN

Page 25: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

25Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Distributed Systems, cont'd

Communication structure

Naming Domain name service (DNS)

Routing Fixed, virtual, dynamic

Contention CSMA/CD

Page 26: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

26Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Distributed Systems, cont'd

Connection strategies Circuit, message, packet switching

Communications protocols ISO 7-layer model TCP/IP protocol layers

Ethernet

Failure detection Reconfiguration

Network design issues

Page 27: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

27Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Distributed Systems, cont'd

Distributed file system Structure Naming and transparency Naming schemes

Remote file access

Caching Location Update policy Consistency

Page 28: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

28Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Protection

Principle of least privilege

Granularity

Domains UNIX domains Domain switching

Page 29: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

29Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Protection, cont'd

Access matrix Access control list Capability list Role-based access control

Covert channels Program-level protection

Page 30: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

30Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Security

Violations

Methods Man in the middle Trojan horse Trap door Logic bomb Stack and buffer overflow

Page 31: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

31Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Security, cont'd

Levels Viruses Internet worms Port scanning Denial of service

User authentication Firewalls Cryptography

Page 32: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

32Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

Case Studies

Linux Windows 7 Android

Page 33: CS 149: Operating Systems May 12 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak mak.

33Computer Science Dept.Spring 2015: May 12

CS 149: Operating Systems© R. Mak

IBM Manual, 1925

All parts should go together without forcing. You must remember that the parts you are reassembling were disassembled by you.

Therefore, if you can’t get them together again, there must be a reason.

By all means, do not use a hammer.