46
CISC 7310X C01: Overview Hui Chen Department of Computer & Information Science CUNY Brooklyn College 2/1/2018 1 CUNY | Brooklyn College

CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

CISC 7310X

C01: OverviewHui Chen

Department of Computer & Information Science

CUNY Brooklyn College

2/1/2018 1CUNY | Brooklyn College

Page 2: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Quick Poll

• Did you take an Operating Systems class before?

• Have you written programs in the C programming language?

2/1/2018 CUNY | Brooklyn College 2

Page 3: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Outline

• Roll call

• Policy and organization of the course

• Overview of operating systems

• Assignments

• See the class website for due dates

• Descriptions are in Blackboard

2/1/2018 CUNY | Brooklyn College 3

Page 4: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Resources and Websites• Class website

• http://www.sci.brooklyn.cuny.edu/~chen/course/CISC7310X

• Online syllabus

• Weekly schedule, lecture notes, and assignments

• Additional resources

• CUNY Blackboard

• https://bbhosted.cuny.edu

• Advisor grades

• Description of assignments

• Assignment submission

• Git repositories hosted at Github (https://github.com)

2/1/2018 CUNY | Brooklyn College 4

Page 5: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Course Content

• Prerequisite

• Data structures and computer organizations

• Content

• Systems overview; systems programing; files; access control; resources management; and system modeling

2/1/2018 CUNY | Brooklyn College 5

Page 6: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Learning Objectives

• Interaction between system components (hardware, operating systems, applications)

• Major issues and solutions in system design (problems, data structures and algorithms)

• System programming including system calls and programming tools

• System research methods and tools as well as reading, writing, presentation, and experimentation

2/1/2018 CUNY | Brooklyn College 6

Page 7: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Textbook and Major References

• Textbook

• Andrew S. Tanenbaum and Herbert Bos. 2014. Modern Operating Systems (4th ed.). Prentice Hall Press, Upper Saddle River, NJ, USA.

• Main reference books and online resources

• Abraham Silberschatz, Peter Baer Galvin, and Greg Gagne. 2008. Operating System Concepts (8th ed.). Wiley Publishing.

• https://pdos.csail.mit.edu/6.828/2017

• http://pages.cs.wisc.edu/~Eremzi/OSTEP/

2/1/2018 CUNY | Brooklyn College 7

Page 8: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Grading Component and Scale

• Attendance

• Practice assignments

• Programming and laboratories

• Projects

• Team projects

• Research, programming, and laboratories

• Midterm exam

• Final exam

2/1/2018 CUNY | Brooklyn College 8

Page 9: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Teaming

• Draw a random ballot

• 3 – 4 students a team

• Steps

• Draw 3-member teams

• Students who draws ”*” draw again to join a team that has 3 members or fewer.

2/1/2018 CUNY | Brooklyn College 9

Page 10: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Assignments

• Learn to accept and submit assignments using Git at Github repositories

• Individual assignment

• Team assignment

2/1/2018 CUNY | Brooklyn College 10

Page 11: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Tool Support for Team Work

• Version control system

• Summary of your experience

9/28/2017 CUNY | Brooklyn College 11

Page 12: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Version Control System (VCS)

• Why do we need it?

• https://stackoverflow.com/questions/1408450/

9/28/2017 CUNY | Brooklyn College 12

“Have you ever:

Made a change to code, realised it was a mistake and wanted to revert back?Lost code or had a backup that was too old?Had to maintain multiple versions of a product?Wanted to see the difference between two (or more) versions of your code?Wanted to prove that a particular change broke or fixed a piece of code?Wanted to review the history of some code?Wanted to submit a change to someone else's code?Wanted to share your code, or let other people work on your code?Wanted to see how much work is being done, and where, when and by whom?Wanted to experiment with a new feature without interfering with working code?

Page 13: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Team Support with VCS

• VCS provides a “centralized” location to store project files

• Versioned code, configuration files, build scripts …

• VCS tracks each contributors’ individual changes

• VCS helps prevent concurrent work from conflicting

9/28/2017 CUNY | Brooklyn College 13

Page 14: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Benefits of VCS

• Branching & merging.

• Example workflow: branching for each feature, branching for each release.

• Traceability

• Example use scenarios: track changes between revisions of a project, documented history of who did what and when

• Complete history of changes

• Example use scenarios: help in root cause analysis for bugs, fix problems in older versions of software that has been released, roll back to an older version without newly introduced bugs

9/28/2017 CUNY | Brooklyn College 14

Page 15: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Centralized vs. Distributed

• Centralized VCS

• Examples: Revision Control System (RCS), Concurrent versions systems (CVS), Subversion (SVN)

• Distributed VCS

• Examples: Git, Mercurial (hg)

9/28/2017 CUNY | Brooklyn College 15

Page 16: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Basic VCS Operations

• Check out/update: copying the repository to the machine you are working at

• Check in/Commit: copying the changes you made to the repository and creating a new version

• Branch: create a new “child” development from a state of the repository

9/28/2017 CUNY | Brooklyn College 16

Page 17: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Example: Centralized Workflow

9/28/2017 CUNY | Brooklyn College 17

commit (check in)

Page 18: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Merge Conflicts

• A conflict may occur when two developers edit the same file

• Merge

• The developer that tries to commit the file last will have to combine her changes with those of the prior developer

• Many VCS’s (e.g., git) may automatically combine the changes

• Developers may have to merge the changes by hand

9/28/2017 CUNY | Brooklyn College 18

Page 19: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Question: A Merge?

9/28/2017 CUNY | Brooklyn College 19

• How would you revise this graph to illustrate when a merge is required?

Page 20: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Distributed Version Control

• Possible to commit locally without upsetting the others

• Allow more flexibility and support different kinds of workflow

9/28/2017 CUNY | Brooklyn College 20

Page 21: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Example: Distributed Workflow

9/28/2017 CUNY | Brooklyn College 21

commits commits

Remote Repository

Page 22: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Questions

• Course policy and organization

• Assignments

• Assignments submission via Git and Github

2/1/2018 CUNY | Brooklyn College 22

Page 23: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Operating System

2/1/2018 CUNY | Brooklyn College 23

System Hardware

Operating System

Application 1 Application 2 Application N

App User 1 App User M

User View:System Interface

(System Calls)

App User Interface

System View:Resource Allocation

Page 24: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Concept of Operating Systems

• A large piece of software function as

• an extended machine (user view)

• to provide an “beautiful” interface for application programs via the application developers

• a resource manager (system view)

• to provide a “beautiful” allocation scheme to share the processors, memories, and I/O devices in a “computer system”

2/1/2018 CUNY | Brooklyn College 24

Page 25: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

“beautiful”

• Question & Discussion: what is “beautiful”?

2/1/2018 CUNY | Brooklyn College 25

Page 26: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Various Computer Systems

2/1/2018 CUNY | Brooklyn College 26

Page 27: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

So, lots of computers …

• Question and discussion: what are in common and what are different?

2/1/2018 CUNY | Brooklyn College 27

Page 28: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Major Hardware Components

• Processors (CPU)

• Multithreaded and multicore processors

• Main Memory (Memory)

• Secondary Memory (Disks)

• I/O Devices

• Buses

2/1/2018 CUNY | Brooklyn College 28

CPU

Bus

MemoryI/O

Devices

Page 29: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Processors

2/1/2018 CUNY | Brooklyn College 29

ALU

Program Counter (PC)

Stack Pointer

Program Status Word (PSW)

Other Registers 1

Other Registers nCache

Kernel mode: can execute all instructions and access all hardware features

User mode: can execute subset of instructions and access subset of hardware features

Page 30: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Instructions

• Basic cycle

• Fetch, decode, execute

• Enhance: e.g., pipelining

• Instruction set

• Examples

• x86 (i386 for 32-bit; amd64 for 64-bit)

• ARM

2/1/2018 CUNY | Brooklyn College 30

Fetch Decode Execute

Fetch Decode Execute

Page 31: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Memory Hierarchy

2/1/2018 CUNY | Brooklyn College 31

Secondary Memory (e.g., Magnetic Disk)

Main Memory

Cache

Registers

~10ms

~10ns

~2ns

~1ns

~TB

~GB

~MB

<KB

Page 32: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

I/O

• Busy waiting

• Interrupted I/O

• Direct memory access (DMA)

2/1/2018 CUNY | Brooklyn College 32

Page 33: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Operating Systems

• Mainframe Operating Systems

• Server Operating Systems

• Multiprocessor Operating Systems

• Personal Computer Operating Systems

• Handheld Computer Operating Systems

• Embedded Operating Systems

• Sensor-Node Operating Systems

• Real-Time Operating Systems

• Smart Card Operating Systems

2/1/2018 CUNY | Brooklyn College 33

Page 34: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

So, a zoo of operating systems?

• Question: why? How are they differ?

2/1/2018 CUNY | Brooklyn College 34

Page 35: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Design Goals

• Resource utilization

• Timeliness

• Throughput

• Robustness

• Energy efficiency

2/1/2018 CUNY | Brooklyn College 35

Page 36: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Operating Systems Concepts

• Processes

• Address spaces

• Files

• I/O

• Protection

• The Shell

• The Kernel

• System Calls

2/1/2018 CUNY | Brooklyn College 36

Page 37: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Process

• A program in execution

• Address space

• Divided into a few parts: e.g., stack, heap, program code, program data

• Resources

• List of open files

• List of related processes

• Current working directory

2/1/2018 CUNY | Brooklyn College 37

Page 38: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Systems Research Literature

• Digital Libraries

• ACM, IEEE, and USENIX

• Google Scholar

• The Computer Systems subcategory

• List of researches in Section 1.9

2/1/2018 CUNY | Brooklyn College 38

Page 39: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Computing Research

• Computation is synthetic

• Different from natural sciences, such as, biology and physics

• We create and study artifacts – must show the artifacts are “better”

• Two paradigms

• Theory and experimentation

• Theory: Similar to mathematics of an abstract phenomena

• Experimentation: Property of artifacts

• System research are largely experimental.

2/1/2018 CUNY | Brooklyn College 39

Page 40: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

“Better” Property

• Examples

• “solves a problem in less time”

• “solves a larger class of problems”

• “is more efficient of resources”

• “is more expressive by some criterion”

• “is more visually appealing in the case of graphics”

• “presents a totally new capability”

2/1/2018 CUNY | Brooklyn College 40

Page 41: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

What Makes it Better?

• The “better” property is not simply an observation

• More about postulating that a new idea that something fundamental leads to the “better” result

• Examples

• Data structure, algorithm, language, mechanism, process, representation, protocol, methodology, optimization or simplification, and model

2/1/2018 CUNY | Brooklyn College 41

Page 42: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Research and Practice

• “Research” is broadly defined.

• In practice, the same principle applies

• When you design a system solution, is it because this is the first design that comes to your mind or it is a better design?

2/1/2018 CUNY | Brooklyn College 42

Page 43: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Questions

• Overview of operating systems

• Concept

• Hardware

• Operating systems concepts

• Systems research

2/1/2018 CUNY | Brooklyn College 43

Page 44: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Assignments

• Gain hands-on experience and familiarity with operating systems concepts

• Submission required

• Familiar yourself with digital libraries and Google Scholar

2/1/2018 CUNY | Brooklyn College 44

Page 45: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Quick Poll

• Do you have a laptop that you can bring to the class (on some days)?

2/1/2018 CUNY | Brooklyn College 45

Page 46: CISC 7310X C01: Overview•Major issues and solutions in system design (problems, data structures and algorithms) •System programming including system calls and programming tools

Questions

• Policy and organization of the course

• Overview of operating systems

• Assignments

• See the class website for due dates

• Descriptions are in Blackboard

2/1/2018 CUNY | Brooklyn College 46