Copyright ©: University of Illinois CS 241 Staff1 Operating Systems Orientation.

Slides:



Advertisements
Similar presentations
OPERATING SYSTEMS Lecturer: Szabolcs Mikulas Office: B38B
Advertisements

Winter 2005 CMPE 151: Network Administration Lecture 2.
Tuesday, June 06, 2006 I hear and I forget, I see and I remember, I do and I understand. -Chinese Proverb.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
1 Introduction Chapter What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4 Computer hardware review 1.5.
1 CS 333 Introduction to Operating Systems Class 2 – OS-Related Hardware & Software The Process Concept Jonathan Walpole Computer Science Portland State.
Operating Systems Concepts Professor Rick Han Department of Computer Science University of Colorado at Boulder.
Computer Organization and Architecture
1 Introduction Chapter What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4 Computer hardware review 1.5.
Ceng Operating Systems 1-1 Chapter 1: Introduction What is the aim of the subject? Why are OSes important? What is an OS? A bit of history Some basic.
Computer System Overview Chapter 1. Basic computer structure CPU Memory memory bus I/O bus diskNet interface.
Introduction Operating Systems’ Concepts and Structure Lecture 1 ~ Spring, 2008 ~ Spring, 2008TUCN. Operating Systems. Lecture 1.
Operating Systems (CSCI2413) Lecture 3 Processes phones off (please)
Chapter 1 Introduction 1.1 What is an operating system
1 What is an operating system? CSC330Patricia Van Hise.
Chapter 2: Computer-System Structures
O PERATING S YSTEMS BIT OUTLINE Introduction, concepts, review & historical perspective Processes Synchronization Scheduling Deadlock Memory management,
CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.
System Calls 1.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
Operating Systems CS3502 Fall 2014 Dr. Jose M. Garrido
CS Fall 2011 CS 423 – Operating Systems Design Lecture 2 – Concepts Review Klara Nahrstedt Fall 2011.
1 CS503: Operating Systems Spring 2014 Dongyan Xu Department of Computer Science Purdue University.
Composition and Evolution of Operating Systems Introduction to Operating Systems: Module 2.
Introduction to Operating Systems Chapter 1. cs431 -cotter2 Lecture Objectives Understand the relationship between computing hardware, operating system,
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
1 Operating System Overview. 2 Today’s Objectives Explain the main purpose of operating systems and describe milestones of OS evolution Explain fundamental.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Chapter 1 Introduction 1.1 What is an operating system
ITEC 502 컴퓨터 시스템 및 실습 Chapter 1: Introduction. ITEC 502 컴퓨터 시스템 및 실습 Chapter 1: Introduction Mi-Jung Choi DPNM Lab. Dept. of CSE,
1 Instructor :Erdal Kose Office hours: Tuesday 9:00-9:30 pm. Mail box : 2109 Ingersoll Hall (Erdal ) Web site :
1 Introduction Chapter What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4 Computer hardware review 1.5.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: Phone:
1 Introduction. 2 A computer system consists of –hardware –system programs –application programs.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 1 Introduction Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview Part 2: History (continued)
Operating Systems Lecture 7 OS Potpourri Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of Software.
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.
1 Operating Systems: Principles and Practice Cpr E 308.
Chapter 1 Introduction to Operating System Part 1
Processes CS 6560: Operating Systems Design. 2 Von Neuman Model Both text (program) and data reside in memory Execution cycle Fetch instruction Decode.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
Concurrency, Processes, and System calls Benefits and issues of concurrency The basic concept of process System calls.
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.
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
Chapter 2 Process Management. 2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states.
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
Copyright ©: Nahrstedt, Angrave, Abdelzaher1 Operating System Overview Tarek Abdelzaher Lawrence Angrave Vikram Adve.
1 Process Description and Control Chapter 3. 2 Process A program in execution An instance of a program running on a computer The entity that can be assigned.
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.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview: Using Hardware.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
Introduction to Operating Systems Concepts
Operating System Overview
Evolution of Operating Systems
Jonathan Walpole Computer Science Portland State University
CS 3305 System Calls Lecture 7.
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Today’s agenda Hardware architecture and runtime system
Lecture Topics: 11/1 General Operating System Concepts Processes
CSCE 313 – Introduction to UNIx process
CS510 Operating System Foundations
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment. Phone:
Introduction and Overview
Presentation transcript:

Copyright ©: University of Illinois CS 241 Staff1 Operating Systems Orientation

Objectives Explain the main purpose of operating systems and describe milestones of OS evolution Explain fundamental machine concepts  Instruction processing  Memory hierarchy  Interrupts  I/O Explain fundamental OS concepts  System calls  Processes  Synchronization  Files Explain the POSIX standard (UNIX specification) Copyright ©: University of Illinois CS 241 Staff2

OS Structure Copyright ©: University of Illinois CS 241 Staff33 FirefoxSecond Life Yahoo Chat GMail Application Software Network Hardware Read/Write Standard Output Device Control File System Communication Operating System Standard Operating System Interface Machine Independent Machine Specific

POSIX The UNIX Interface Standard Copyright ©: University of Illinois CS 241 Staff4 FirefoxSecond Life Yahoo Chat GMail Application Software Read/Write Standard Output Device Control File System Communication Unix POSIX Standard Interface

What is an Operating System? It is an extended machine  Hides the messy details that must be performed  Presents user with a virtualized and simplified abstraction of the machine, easier to use It is a resource manager  Each program gets time with the resource  Each program gets space on the resource Copyright ©: University of Illinois CS 241 Staff5

Machine-dependent layer A Peek into Unix Copyright ©: University of Illinois CS 241 Staff6 Application Portable OS Layer Libraries User space/level Kernel space/level User/kernel modes are supported by hardware Some systems do not have clear user-kernel boundary

Machine-dependent layer Application Copyright ©: University of Illinois CS 241 Staff7 Applications (Firefox, Emacs, grep) Portable OS Layer Libraries Written by programmer Compiled by programmer Use function calls

Machine-dependent layer Unix: Libraries Copyright ©: University of Illinois CS 241 Staff8 Application Portable OS Layer Libraries (e.g., stdio.h) Provided pre-compiled Defined in headers Input to linker (compiler) Invoked like functions May be “resolved” when program is loaded

Machine-dependent layer Typical Unix OS Structure Copyright ©: University of Illinois CS 241 Staff9 Application Portable OS Layer Libraries System calls (read, open..) All “high-level” code

Machine-dependent layer Typical Unix OS Structure Copyright ©: University of Illinois CS 241 Staff10 Application Portable OS Layer Libraries Bootstrap System initialization Interrupt and exception I/O device driver Memory management Kernel/user mode switching Processor management

History of Computer Generations Pre-computing generation  Charles Babbage’s “Analytical Engine”  Purely mechanical  Designed, but never actually built Required high-precision gears/cogs that didn’t exist yet  A man before his time When this works, we’ll need software! First programming language World’s first programmer: Ada Lovelace Copyright ©: University of Illinois CS 241 Staff11

History of Computer Generations Pre-computing generation 1792 – 1871 First generation 1945 – 1955  Vacuum tubes, relays, plug boards  Seconds per operation! Focus on numerical calculations  No programming language Everything done using pure machine language or wiring electrical circuits!  No operating system Sign up for your time slot!  Progress: Punch cards! Copyright ©: University of Illinois CS 241 Staff12

History of Computer Generations Pre-computing generation 1792 – 1871 First generation 1945 – 1955 Second generation  Transistors, mainframes  Large human component Copyright ©: University of Illinois CS 241 Staff13

History of Operating Systems Problem: a lot of time wasted by operators walking around machine room One solution: An early “batch system” by IBM  bring cards to 1401  read cards to tape  put tape on 7094 which does computing  put tape on 1401 which prints output Copyright ©: University of Illinois CS 241 Staff14

History of Computer Generations Pre-computing generation 1792 – 1871 First generation 1945 – 1955 Second generation  Transistors, mainframes  Large human component  Solution: Batched jobs Copyright ©: University of Illinois CS 241 Staff15

History of Computer Generations Pre-computing generation 1792 – 1871 First generation 1945 – 1955 Second generation 1955 – 1965 Third generation 1965 – 1980  Integrated circuits and multiprogramming  IBM’s New model: all software and OS must work on all platforms A beast!  Progress: Multiprogramming Keep the CPU busy Copyright ©: University of Illinois CS 241 Staff16

History of Operating Systems Multiprogramming/timesharing system  Three jobs in memory – 3rd generation Copyright ©: University of Illinois CS 241 Staff17 Memory Management Process Management

History of Computer Generations Pre-computing generation 1792 – 1871 First generation 1945 – 1955 Second generation 1955 – 1965 Third generation 1965 – 1980  Integrated circuits and multiprogramming  IBM’s New model: all software and OS must work on all platforms  Progress: Multiprogramming and timesharing  Progress: Spooling Always have something ready to run  MULTICS + minicomputers == UNIX! Copyright ©: University of Illinois CS 241 Staff18

History of Computer Generations Pre-computing generation 1792 – 1871 First generation 1945 – 1955 Second generation 1955 – 1965 Third generation 1965 – 1980 Fourth generation 1980 – present  Personal computers  Multi-processors  Phones  … Copyright ©: University of Illinois CS 241 Staff19

Computer Hardware Review Components of a simple personal computer Copyright ©: University of Illinois CS 241 Staff20 Bus Monitor The “Brains”

Computer Hardware Review Components of a simple personal computer Copyright ©: University of Illinois CS 241 Staff21 CPU Bus Monitor Computer operation and data processing

Computer Hardware Review Components of a simple personal computer Copyright ©: University of Illinois CS 241 Staff22 Memory Bus Monitor CPU Stores data and programs Communication between CPU, Memory and I/O

Early Pentium system Copyright ©: University of Illinois CS 241 Staff23

CPU, From CS231 Fetch instruction from code memory Fetch operands from data memory Perform operation (and store result) (Check interrupt line) Go to next instruction 'Conventional CPU' (Ignore pipeline, optimization complexities) Copyright ©: University of Illinois CS 241 Staff24

CPU Registers Fetch instruction from code memory Fetch operands from data memory Perform operation (and store result) Go to next instruction Note: CPU must maintain certain state  Current instructions to fetch (program counter)  Location of code memory segment  Location of data memory segment Copyright ©: University of Illinois CS 241 Staff25

CPU Register Examples Hold instruction operands Point to start of  Code segment (executable instructions)  Data segment (static/global variables)  Stack segment (execution stack data) Point to current position of  Instruction pointer  Stack pointer Copyright ©: University of Illinois CS 241 Staff26

CPU Register Examples Hold instruction operands Point to start of  Code segment  Data segment  Stack segment Point to current position of  Instruction pointer  Stack pointer Why stack? Copyright ©: University of Illinois CS 241 Staff27

Command-line arguments and environment variables Uninitialized static data Initialized static data Program text (code segment) Sample Layout for program image in main memory Copyright ©: University of Illinois CS 241 Staff28 Processes have three segments: text, data, stack stack heap Allocations from malloc family Activation record for function calls (return address, parameters, saved registers, automatic variables argc, argv, environment High address Low address

Memory Hierarchy Leverage locality of reference Copyright ©: University of Illinois CS 241 Staff29 1 KB 128 MB 4 GB 1TB 10 TB 1.Decreasing cost per bit 2.Increasing capacity 3.Increasing access time 4.Decreasing frequency of access

Computer Hardware Review Components of a simple personal computer Copyright ©: University of Illinois CS 241 Staff30 Bus Memory I/O Devices Bus Monitor CPU I/O Devices I/O Devices I/O Devices Move data between computer and external environment

I/O Device Access System Calls  Application makes a system call  Kernel translates to specific driver  Driver starts I/O  Polls device for completion Interrupts  Application starts device  Asks for an interrupt upon completion  OS blocks application  Device controller generates interrupt Copyright ©: University of Illinois CS 241 Staff31

I/O Interrupt Mechanism 1. Application writes into device registers, Controller starts device 2. When done, device controller signals interrupt controller 3. Interrupt controller asserts pin on CPU 4. Interrupt controller puts I/O device number on bus to CPU Copyright ©: University of Illinois CS 241 Staff32 (a)(b)

Operating System Concepts Process  An instance of a computer program that is being executed  Only one process can use the CPU at a time Copyright ©: University of Illinois CS 241 Staff33 AZ

Operating System Concepts How to go back and forth between processes? How would you switch CPU execution from one process to another? Solution: Context Switching  Store/restore state on CPU, so execution can be resumed from same point later in time  Triggers: multitasking, interrupt handling, user/kernel mode switching  Involves: Saving/loading registers and other state into a “process control block” (PCB)  PCBs stored in kernel memory Copyright ©: University of Illinois CS 241 Staff34

Operating System Concepts Context Switching  What are the costs involved? Copyright ©: University of Illinois CS 241 Staff35 ItemTimeScaled Time in Human Terms (2 billion times slower) Processor cycle0.5 ns (2 GHz)1 s Cache access1 ns (1 GHz)2 s Memory access15 ns30 s Context switch5,000 ns (5 micros)167 m Disk access7,000,000 ns (7 ms)162 days System quanta100,000,000 (100 ms)6.3 years

Operating System Concepts Shared resources  Now I have B KB of memory, but need 2B KB  Now I have N processes trying to access the disk  How would you control access to resources?  What are the challenges? Copyright ©: University of Illinois CS 241 Staff36

Operating System Concepts One challenge: Deadlock  Set of actions waiting for each other to finish Example:  Process A has lock on file 1, wants to acquire lock on file 2  Process B has a lock on file 2, wants to acquire lock on file 1 Copyright ©: University of Illinois CS 241 Staff37 (a) A potential deadlock(b) An actual deadlock

Operating System Concepts Process  An executable instance of a program  Only one process can use a (single-core) CPU at a time A process tree  A created two child processes, B and C  B created three child processes, D, E, and F Copyright ©: University of Illinois CS 241 Staff38 A BC EFD Z

Operating System Concepts Inter-process Communication  Now process A needs to exchange information with process B  How would you enable communication between processes? Copyright ©: University of Illinois CS 241 Staff39 AB Pipe AB Shared Memory

Summary Resource Manager Hardware independence Virtual Machine Interface POSIX Concurrency & Deadlock Copyright ©: University of Illinois CS 241 Staff40