Unix API Books. Linux Kernel Books. Assignments and Exams. Grading for CSC 256. Operating Systems 8/31/2018. CSC 256/456 Fall

Similar documents
CSC 256/456: Operating Systems. Introduction. John Criswell! University of Rochester

Processes & Threads. Recap of the Last Class. Microkernel System Architecture. Layered Structure

Processes & Threads. Recap of the Last Class. Layered Structure. Virtual Machines. CS 256/456 Dept. of Computer Science, University of Rochester

Process and Its Image An operating system executes a variety of programs: A program that browses the Web A program that serves Web requests

2/14/2012. Using a layered approach, the operating system is divided into N levels or layers. Also view as a stack of services

Operating Systems CS 571

Lecture 2 - Fundamental Concepts

Lecture Topics. Announcements. Today: Operating System Overview (Stallings, chapter , ) Next: Processes (Stallings, chapter

Operating System Labs. Yuanbin Wu

Introduction to Unix. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Andrew S. Tanenbaum, Operating Systems, Design and Implementation, (Second Edition), Prentice Hall.

CS 475. Process = Address space + one thread of control Concurrent program = multiple threads of control

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

Chapter 2: Operating-System

Announcements Processes: Part II. Operating Systems. Autumn CS4023

CSE 410: Systems Programming

Multiprogramming. Evolution of OS. Today. Comp 104: Operating Systems Concepts 28/01/2013. Processes Management Scheduling & Resource Allocation

csci3411: Operating Systems

What is an Operating System? Signals, Processes, & Threads. Resource Sharing. Resource Abstraction ... Operating Systems 10/20/2010

High Performance Computing Lecture 11. Matthew Jacob Indian Institute of Science

Processes. Dr. Yingwu Zhu

Operating System Labs. Yuanbin Wu

Roadmap. Tevfik Ko!ar. CSC Operating Systems Fall Lecture - VII CPU Scheduling - II. Louisiana State University

Roadmap. Multilevel Queue Scheduling. Multilevel Queue. Example of Multilevel Feedback Queue. Multilevel Feedback Queue. Tevfik Ko!

Today. Operating System Evolution. CSCI 4061 Introduction to Operating Systems. Gen 1: Mono-programming ( ) OS Evolution Unix Overview

Introduction to OS Processes in Unix, Linux, and Windows MOS 2.1 Mahmoud El-Gayyar

CS420: Operating Systems. OS Services & System Calls

Chapter 2: Operating-System Structures

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

Introduction to System Programming

Four Components of a Computer System

Roadmap. Tevfik Ko!ar. CSC Operating Systems Spring Lecture - III Processes. Louisiana State University. Virtual Machines Processes

Today. Operating System Evolution. CSCI 4061 Introduction to Operating Systems. Gen 1: Mono-programming ( ) OS Evolution Unix Overview

Chapter 4: Threads. Operating System Concepts. Silberschatz, Galvin and Gagne

Introduction to Operating Systems

OS Interaction and Processes

OS Structure, Processes & Process Management. Don Porter Portions courtesy Emmett Witchel

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

CSE 153 Design of Operating Systems Fall 2018

Processes and Threads

Chapter 2: Operating-System Structures

What is a Process? Processes and Process Management Details for running a program

CSE 4/521 Introduction to Operating Systems

CISC 7310X. C03: Process. Hui Chen Department of Computer & Information Science CUNY Brooklyn College. 2/15/2018 CUNY Brooklyn College

Chapter 3: Operating-System Structures

NWI-IBC019: Operating systems. Nils Jansen and Bernard van Gastel

Operating Systems (ECS 150) Spring 2011

Processes. Sanzheng Qiao. December, Department of Computing and Software

Architectural Support for Operating Systems. Jinkyu Jeong ( Computer Systems Laboratory Sungkyunkwan University

Operating Systems ( )

ENGR 3950U / CSCI 3020U Midterm Exam SOLUTIONS, Fall 2012 SOLUTIONS

CSC Operating Systems Fall Lecture - II OS Structures. Tevfik Ko!ar. Louisiana State University. August 27 th, 2009.

Announcements. Computer System Organization. Roadmap. Major OS Components. Processes. Tevfik Ko!ar. CSC Operating Systems Fall 2009

Lecture 2 Operating System Structures (chapter 2)

Operating Systems ( )

What is an Operating System? A Whirlwind Tour of Operating Systems. How did OS evolve? How did OS evolve?

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

CS 5460/6460 Operating Systems

Kernel Types Simple OS Examples System Calls. Operating Systems. Autumn CS4023

Operating Systems Overview. Chapter 2

CS 3204: Introduction

CS307: Operating Systems

Slide 6-1. Processes. Operating Systems: A Modern Perspective, Chapter 6. Copyright 2004 Pearson Education, Inc.

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

Lecture Topics. Announcements. Today: Threads (Stallings, chapter , 4.6) Next: Concurrency (Stallings, chapter , 5.

W4118 Operating Systems. Junfeng Yang

CSC Operating Systems Fall Lecture - I Introduction. Tevfik Ko!ar. Louisiana State University. August 25 th, Contact Information

CSC Operating Systems Spring Lecture - II OS Structures. Tevfik Ko!ar. Louisiana State University. January 17 th, 2007.

Announcements. Operating System Structure. Roadmap. Operating System Structure. Multitasking Example. Tevfik Ko!ar

Linux Operating System

Operating Systems ( )

Processes. CS 475, Spring 2018 Concurrent & Distributed Systems

Operating-System Structures

What we saw. Desarrollo de Aplicaciones en Red. 1. OS Design. 2. Service description. 1.1 Operating System Service (1)

Operating Systems ( )

Processes. Process Scheduling, Process Synchronization, and Deadlock will be discussed further in Chapters 5, 6, and 7, respectively.

Design Overview of the FreeBSD Kernel CIS 657

COMPSCI: Principles of Operating Systems. Lecture 1: Introduction. Anton Burtsev January, 2017

Design Overview of the FreeBSD Kernel. Organization of the Kernel. What Code is Machine Independent?

Spring 2017 :: CSE 506. Introduction. Nima Honarmand

ESE 333 Real-Time Operating Systems 2 What is an operating system? Two views: 1. Top-down view: Extended machine ffl Covers the details of the hardwar

CL020 - Advanced Linux and UNIX Programming

CSC209 Review. Yeah! We made it!

Chapter 2: Operating-System Structures

OS lpr. www. nfsd gcc emacs ls 1/27/09. Process Management. CS 537 Lecture 3: Processes. Example OS in operation. Why Processes? Simplicity + Speed

PROCESS MANAGEMENT. Operating Systems 2015 Spring by Euiseong Seo

Processes and Threads

EEE 435 Principles of Operating Systems

CPSC 341 OS & Networks. Introduction. Dr. Yingwu Zhu

ELEC 377 Operating Systems. Week 1 Class 2

CSE3008: Operating Systems. Computer Systems Laboratory Sungkyunkwan University

Chapter 2: Operating-System Structures

Processes COMPSCI 386

OS and Computer Architecture. Chapter 3: Operating-System Structures. Common System Components. Process Management

Outline. Threads. Single and Multithreaded Processes. Benefits of Threads. Eike Ritter 1. Modified: October 16, 2012

2 Processes. 2 Processes. 2 Processes. 2.1 The Process Model. 2.1 The Process Model PROCESSES OPERATING SYSTEMS

Chris Riesbeck, Fall Introduction to Computer Systems

Operating System Labs. Yuanbin Wu

Welcome to CSE 4300! Spring 2018

Processes and Threads

Transcription:

Prerequisites CSC 2/456: Operating s CSC 252 or equivalent C/C++ programming experience on Unix systems Instructor: Sandhya Dwarkadas TAs: Zhuojia Shen, Mohsen Mohammadi 8/31/2018 CSC 2/456 1 2 Meaning of Prerequisites You understand basic processor organization You are aware of virtual memory and its support You can read assembly language code You can write assembly language code You understand bit-wise operations (AND, OR, XOR) You can write C code that manipulates pointerbased data structures (e.g., linked lists, trees, etc.) General Course Information Course Web page: www.cs.rochester.edu/u/sandhya/csc256 Course-related announcement/correspondence: Blackboard Discussion Board Texts Tanenbaum et al, Modern Operating s Silberschatz et al, Operating Concepts 3 8/31/2018 CSC 2/456 4 CSC 256/456 Fall 2018 1

Linux Kernel Books Unix API Books Understanding the Linux Kernel by Bovet and Cesati Professional Linux Kernel Architecture by Mauerer Linux Kernel Development by Love Advanced Programming in the UNIX Environment by Stevens and Rago Available online via the library 5 6 Assignments and Exams Tentatively 5 programming assignments Modify Linux kernel internals Midterm and final Homework/quizzes/other Other: participation in class discussions, presentations CSC456 Part in assignments C programming Class presentation and end-of-term survey paper for CSC456 students 8/31/2018 CSC 2/456 7 Midterm 20% Grading for CSC 256 Final Exam 20% Homeworks 10% Programming 50% 8 CSC 256/456 Fall 2018 2

Grading for CSC 456 Term paper/seminar 10% Final Exam 15% Midterm 15% Homeworks 10% Programming 50% 9 If you don t have a Unix account, please get one ASAP! 10 Computer- Architecture What is an Operating? that abstracts the computer hardware Hides the messy details of the underlying hardware Presents users with a resource abstraction that is easy to use Extends or virtualizes the underlying machine Manages the resources Processors, memory, timers, disks, mice, network interfaces, printers, displays, Allows multiple users and programs to share the resources and coordinates the sharing 8/31/2018 CSC 2/456 11 8/31/2018 CSC 2/456 12 CSC 256/456 Fall 2018 3

Why Study Operating s? Learn to design an OS or other computer systems Understand an OS Understand the inner workings of an OS Enable you to write efficient/correct application code Calls and Interfaces/Abstractions Examples: Win32, POSIX, or Java APIs Process management fork, waitpid, execve, exit, kill Exceptions, interrupts (events) signals File management open, close, read, write, lseek Directory and file system management mkdir, rmdir, link, unlink, mount, umount Inter-process communication sockets, pipe, ipc (msg, shm, sem) 8/31/2018 CSC 2/456 13 8/31/2018 CSC 2/456 14 Reasons for Abstractions Reduce functional complexity Provide single abstraction over multiple devices Resource sharing Objectives when Sharing Resources Efficiency Fairness Security/protection 15 16 CSC 256/456 Fall 2018 4

Perspectives of the Computer cut save Hardware print send (a) End User View open() malloc() fork() Hardware (b) Programmer View start-printer read-disk push-bits-into-nic Hardware (c) Programmer View 8/31/2018 CSC 2/456 17 A general piece of software with common functionalities that support many applications Examples C compiler and library functions Shell command line interpreter A window system A database management system The operating system A thin layer of software that operates directly on the raw hardware 8/31/2018 CSC 2/456 18 The Structure of Computer s Programmer OS Programmer Disk Abstractions Programmer Command Line Interpreter Compiler API Loader Libraries Libraries Libraries Window load(); seek(); out(); void write() { load(); seek() out() } int fprintf() {... write() } Database Management 8/31/2018 CSC 2/456 19 OS Hardware (a) Direct Control (b) write() (c) fprintf() abstraction abstraction 8/31/2018 CSC 2/456 20 CSC 256/456 Fall 2018 5

Under the Abstraction functional complexity Resource Sharing Program P i Program P j Program P k Extended machine interface (resource abstraction) a single abstraction over multiple devices replication reliability OS Resource Sharing resouce sharing 8/31/2018 CSC 2/456 21 Time-multiplexed Physical Processor P i Memory P k Memory P j Memory Space-multiplexed Physical Memory 8/31/2018 CSC 2/456 22 Objectives of Resource Sharing Evolution of Modern OS Efficiency Timesharing Distributed OS Fairness Security/protection Batch Memory Mgmt Memory Mgmt Scheduling Protection Protection Scheduling Files Devices PC & Wkstation Human-Computer Interface Client-Server Model Network Protocols Real-Time RT Scheduling Small Computer Modern OS Power Management 8/31/2018 CSC 2/456 23 8/31/2018 CSC 2/456 24 CSC 256/456 Fall 2018 6

History Machine language Batch systems (mainframes) Multiprogramming and time sharing Graphical user interfaces, virtual memory, protection, network/distributed operating systems 8/31/2018 CSC 2/456 25 Examples of Modern OSes UNIX variants (e.g., Mac OS X, FreeBSD, AIX, Solaris, Linux) -- have evolved since 1969 Windows 78/10//NT/2K -- has evolved since 1989 Smartphone Oses: Android, ios, (most based on Unix family) Other OSes microkernel extensible OS virtual machines sensor OS isolated processes special-purpose OS for highly concurrent Internet servers still evolving 8/31/2018 CSC 2/456 26 Operating s Concepts Processes Memory management File systems Device management Security/protection Processes Definition: A process is an instance of a running program. One of the most profound ideas in computer science Not the same as program or processor Program = Set of Instructions May not be running Processor = Hardware that executes programs 8/31/2018 CSC 2/456 27 2 8 CSC 256/456 Fall 2018 7

Processes Process Control Block (PCB) Process provides each program with two key abstractions: Logical control flow: each program seems to have exclusive use of the CPU Private address space: each program seems to have exclusive use of main memory How are these illusions maintained? Process executions interleaved (multitasking) Address spaces managed by virtual memory system 29 OS data structure (in kernel memory) for maintaining information associated with each process. Process state Program counter CPU registers CPU scheduling information Memory-management information Accounting information Information about open files 30 Pointer for Linked List Process State Process ID (pid) Program Counter Registers Exit Status Procfs: The /proc filesystem [Killian 84] Processes as files: a pseudo-file system a file system interface to kernel in-memory data structures Linux implementation originated with Bell Labs Plan 9 Hierarchical file system Each live process has its own directory (numbered with pid) Non-process-related system information in named files: e.g., cpuinfo, meminfo 8/31/2018 CSC 2/456 31 Process Creation When a process (parent) creates a new process (child) Execution sequence? Address space sharing? Open files inheritance? UNIX examples fork() system call creates new process with a duplicated copy of everything exec() system call replaces process memory space with a new program Typically used after a call to fork Child and parent compete for CPU like two normal processes 32 CSC 256/456 Fall 2018 8

The fork() system call Assignment #1 Duplicates a process Linked List Ptr Linked List Ptr Process State Process State Process ID (pid) Process ID (pid) Program Counter Program Counter Exclusively outside of the OS Part I: observing the OS through the /proc virtual file system Part II: building a shell (command-line interpreter) Support foreground/background executions Support pipes Registers Open Files Registers Open Files 33 8/31/2018 CSC 2/456 49 Disclaimer Parts of the lecture slides contain original work from Gary Nutt, Andrew S. Tanenbaum, Dave O Hallaron, Randal Bryant, and Kai Shen. The slides are intended for the sole purpose of instruction of operating systems at the University of Rochester. All copyrighted materials belong to their original owner(s). 8/31/2018 CSC 2/456 51 CSC 256/456 Fall 2018 9