CSC 501 Operating Systems Principles

Slides:



Advertisements
Similar presentations
CSC 360- Instructor: K. Wu Overview of Operating Systems.
Advertisements

Lecture 9 VM & Threads. Review through VAX/VMS The VAX-11 architecture comes from DEC 1970’s The OS is known as VAX/VMS (or VMS) One primary architect.
Introduction CSCI 444/544 Operating Systems Fall 2008.
Introduction to Operating Systems CS-2301 B-term Introduction to Operating Systems CS-2301, System Programming for Non-majors (Slides include materials.
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
CSC 501 Lecture 2: Processes. Von Neumann Model Both program and data reside in memory Execution stages in CPU: Fetch instruction Decode instruction Execute.
Operating Systems CS451 Brian Bershad
1 School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Dr. Mohamed Hefeeda.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
CS 416 Operating Systems Design Spring 2008 Liviu Iftode
Operating Systems Concepts Professor Rick Han Department of Computer Science University of Colorado at Boulder.
Lecture 1: Introduction CS170 Spring 2015 Chapter 1, the text book. T. Yang.
OS Spring’04 Introduction Operating Systems Spring 2004.
Processes Part I Processes & Threads* *Referred to slides by Dr. Sanjeev Setia at George Mason University Chapter 3.
Computer Organization Review and OS Introduction CS550 Operating Systems.
COSC 3407: Operating Systems Lecture 3: Processes.
1 COMPSCI 110 Operating Systems Who - Introductions How - Policies and Administrative Details Why - Objectives and Expectations What - Our Topic: Operating.
CS 162 Discussion Section Week 1 (9/9 – 9/13) 1. Who am I? Kevin Klues Office Hours:
Introduction and Overview Questions answered in this lecture: What is an operating system? How have operating systems evolved? Why study operating systems?
Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
Today’s Topics Introducing process: the basic mechanism for concurrent programming –Process management related system calls Process creation Process termination.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
Processes and Threads CS550 Operating Systems. Processes and Threads These exist only at execution time They have fast state changes -> in memory and.
PA0 due 60 hours. Lecture 4 Memory Management OSTEP Virtualization CPU: illusion of private CPU RAM: illusion of private memory Concurrency Persistence.
1 CMSC421: Principles of Operating Systems Nilanjan Banerjee Principles of Operating Systems Assistant Professor, University of Maryland Baltimore County.
Operating Systems and Systems Programming CS162 Teaching Staff.
Chapter 1: Introduction and History  Where does the operating system fit in a computing system?  What does the operating system achieve?  What are the.
CS333 Intro to Operating Systems Jonathan Walpole.
Operating Systems Lecture 1 Jinyang Li. Class goals Understand how an OS works by studying its: –Design principles –Implementation realities Gain some.
Chapter 2 Introduction to OS Chien-Chung Shen CIS, UD
Processes CS 6560: Operating Systems Design. 2 Von Neuman Model Both text (program) and data reside in memory Execution cycle Fetch instruction Decode.
STRUCTURE OPERATING SYSTEMS. I. PROCESS MANAGEMENT Process a program in execution More than one process can be associated with a single program Each is.
CS4315A. Berrached:CMS:UHD1 Introduction to Operating Systems Chapter 1.
Chapter 2 Introduction to OS Chien-Chung Shen CIS/UD
Concepts and Structures. Main difficulties with OS design synchronization ensure a program waiting for an I/O device receives the signal mutual exclusion.
Major OS Components CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
1.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Lecture 1: Introduction & OS Structures (Part One, Chapters 1&2)
Chapter 3 The Programming Interface Chien-Chung Shen CIS/UD
Chapter 2 Operating System Overview Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William.
Welcome to Intro to Operating Systems Course Website:
CMPS Operating Systems Prof. Scott Brandt Computer Science Department University of California, Santa Cruz.
Introduction to Operating Systems Concepts
Chien-Chung Shen CIS/UD
Andy Wang COP 5611 Advanced Operating Systems
Andy Wang COP 5611 Advanced Operating Systems
CS399 New Beginnings Jonathan Walpole.
Operating Systems and Systems Programming
Lecture Note 0: Course Introduction
What does an Operating System Do?
Operating Systems CSE451 Winter 2000
Operating Systems : Overview
Andy Wang COP 5611 Advanced Operating Systems
Chapter 2: Operating-System Structures
Jonathan Walpole Computer Science Portland State University
Operating Systems CSE451 Spring 2000
Operating Systems : Overview
Concurrency, Processes and Threads
Operating Systems : Overview
Operating Systems CS451 Spring 1998
Operating Systems: A Modern Perspective, Chapter 3
Andy Wang COP 5611 Advanced Operating Systems
Operating Systems : Overview
Lecture Note 0: Course Introduction
Chapter 2 Operating System Overview
Chapter 2: Operating-System Structures
Andy Wang COP 5611 Advanced Operating Systems
Threads CSE 2431: Introduction to Operating Systems
Advanced OS COMP 755.
Presentation transcript:

CSC 501 Operating Systems Principles

Logistics Instructor: Guoliang Jin TA: Wenzhao Zhang Grader: TBA https://moodle1415-courses.wolfware.ncsu.edu/course/view.php?id=6189

You? Degree? First OS course? Experience in C programming? Read OS papers before?

Course Overview Goals: Structure: OS internals Distributed Systems Current trends in OS research Structure: Each major area: Review basic material Read and review papers to understand advanced issues Programming projects

Textbook - Required Operating Systems: Three Easy Pieces Remzi H. Arpaci-Dusseau Andrea C. Arpaci-Dusseau http://pages.cs.wisc.edu/~remzi/OSTEP/ It is FREE, FUN to read

Other materials Books Papers The webpage will list more They will be FREE as well Let me know if you think they are FUN to read Reference of the OSTEP book Recent conferences

Grading Policy We have a big class, to make TA’s life easier: Submit your own work No late submission There will be midterm, final, and programming. There could be homework and paper review. Due to limited TA/grader resource

Today Intro to OS

What happens when a program runs Execute one instruction after another: Fetch Decode Execute

What is an OS OS makes it easy to run programs application (user) operating system hardware OS makes it easy to run programs Run many programs at once (seemingly) Share memory among programs Enable interaction with devices, etc. Correctly and efficiently A virtual machine, standard library, resource manager

int main(int argc, char. argv[]) { if (argc int main(int argc, char *argv[]) { if (argc != 2) { fprintf(stderr, "usage: cpu <string>\n"); exit(1); } char *str = argv[1]; while (1) { printf("%s\n", str); Spin(1); return 0;

The illusion of many many CPUs ----CPU virtualization To OS, only limited number of CPUs A running program thinks it owns one CPU

Abstraction: Processes A process is a system abstraction: illusion of being the only job in the system hardware: computer operating system: process user: application create, kill processes, inter-process comm. multiplex resources

OS as a resource manager Mechanism: Creation, destruction, suspension, context switch, signalling, IPC, etc. Policy: Minor policy questions: Who can create/destroy/suspend processes? How many active processes can each user have? Major policy question that we will concentrate on: How to share resources between multiple processes?

int main(int argc, char. argv[]) { if (argc. = 2) … int int main(int argc, char *argv[]) { if (argc != 2) … int *p = malloc(sizeof(int)); assert(p != NULL); printf("(pid:%d) addr of p: %llx\n", …); printf("(pid:%d) addr stored in p: %llx\n", …); *p = atoi(argv[1]); while (1) { Spin(1); *p = *p + 1; printf("(pid:%d) value of p: %d\n", getpid(), *p); } return 0;

The illusion of private address space ----Memory virtualization To OS, physical memory is shared A running program thinks it has all to itself

Abstraction: Virtual memory Virtual memory is a memory abstraction: illusion of large contiguous memory, often more memory than physically available application: address space virtual addresses operating system: virtual memory physical addresses hardware: physical memory

OS as a resource manager Mechanism: Virtual-to-physical memory mapping, page-fault, etc. Policy: How to multiplex a virtual memory that is larger than the physical memory onto what is available? How to share physical memory between multiple processes?

OSTEP Virtualization Concurrency

int main(int argc, char. argv[]) { if (argc int main(int argc, char*argv[]) { if (argc != 2) { fprintf(stderr, "usage: threads <value>\n"); exit(1); } loops = atoi(argv[1]); pthread_t p1, p2; printf("Initial value : %d\n", counter); Pthread_create(&p1, NULL, worker, NULL); Pthread_create(&p2, NULL, worker, NULL); Pthread_join(p1, NULL); Pthread_join(p2, NULL); printf("Final value : %d\n", counter); return 0; volatile int ounter = 0; int loops; void *worker(void *arg) { int I; for (i = 0; i < loops; i++) { counter++; } return NULL;

Concurrency is my research focus My PhD work: Failure diagnosis for concurrency bugs Automated concurrency-bug fixing

A thread is a processor abstraction: Abstraction: Thread A thread is a processor abstraction: illusion of having 1 processor per execution context application: execution context create, kill, synch. operating system: thread context switch hardware: processor

int main(int argc, char*argv[]) { int fd = open("/tmp/file”, O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU); assert(fd > -1); int rc = write(fd, "hello world\n", 13); assert(rc == 13); close(fd); return 0; }

Persistence Hardware: hard drives Software: file systems FS does not virtualize disks Tedious to deal with hardware details OS does it for you somehow as a library

Abstraction: File system A file system is a storage abstraction: illusion of structured storage space application/user: copy file1 file2 naming, protection, operations on files operating system: files, directories operations on disk blocks hardware: disk

OS as a resource manager Mechanism: Naming, protection, operations on files Different data structures Policy: When to write to disk? How to order accesses? Where to write on the disk?

Design goals Now we know what an OS does: 1, 2, and 3. Providing abstractions Good performance Protection, isolation Reliability Energy-efficient Security Mobility …

Some history Early Operating Systems: Just Libraries Implements commonly-used functionalities Beyond Libraries: Protection System call The Era of Multiprogramming Unix The Modern Era

Questions? Miss something?

Reading for the next lecture Book chapters on Virtualization Dialogue Processes Process API Direct Execution Paper Lottery Scheduling: Flexible Proportional-Share Resource Management