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

Similar documents
Introduction. CS3026 Operating Systems Lecture 01

Process Time. Steven M. Bellovin January 25,

Processes and Threads. Processes and Threads. Processes (2) Processes (1)

Announcement. Exercise #2 will be out today. Due date is next Monday

ELEC 377 Operating Systems. Week 1 Class 2

Operating Systems Overview. Chapter 2

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

Computer System Overview

Process Description and Control. Chapter 3

Operating System Overview. Chapter 2

Operating System. Operating System Overview. Layers of Computer System. Operating System Objectives. Services Provided by the Operating System

Operating System Overview. Operating System

CS399 New Beginnings. Jonathan Walpole

Operating Systems : Overview

CSC 2405: Computer Systems II

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

CS 333 Introduction to Operating Systems Class 2 OS-Related Hardware & Software The Process Concept

Operating System. Operating System Overview. Structure of a Computer System. Structure of a Computer System. Structure of a Computer System

To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization

Announcements. Reading. Project #1 due in 1 week at 5:00 pm Scheduling Chapter 6 (6 th ed) or Chapter 5 (8 th ed) CMSC 412 S14 (lect 5)

System Call. Preview. System Call. System Call. System Call 9/7/2018

Operating Systems. Memory Management. Lecture 9 Michael O Boyle

Objectives and Functions Convenience. William Stallings Computer Organization and Architecture 7 th Edition. Efficiency

OS structure. Process management. Major OS components. CSE 451: Operating Systems Spring Module 3 Operating System Components and Structure

Operating System Support

Operating System Review

Processes and Threads

Operating System: Chap13 I/O Systems. National Tsing-Hua University 2016, Fall Semester

OPERATING SYSTEM SUPPORT (Part 1)

Major Requirements of an OS

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

B. V. Patel Institute of Business Management, Computer &Information Technology, UTU

Processes. CS 475, Spring 2018 Concurrent & Distributed Systems

Processes. Process Management Chapter 3. When does a process gets created? When does a process gets terminated?

Chapter 8: Virtual Memory. Operating System Concepts

1 PROCESSES PROCESS CONCEPT The Process Process State Process Control Block 5

Computer Systems II. First Two Major Computer System Evolution Steps

Mon Sep 17, 2007 Lecture 3: Process Management

Operating Systems. Introduction & Overview. Outline for today s lecture. Administrivia. ITS 225: Operating Systems. Lecture 1

2. The system of... generally ran one job at a time. These were called single stream batch processing.

Chapter 9: Virtual Memory

W4118: OS Overview. Junfeng Yang

CS 333 Introduction to Operating Systems. Class 2 OS-Related Hardware & Software The Process Concept

Chapter 9: Virtual Memory. Operating System Concepts 9 th Edition

Dr. Rafiq Zakaria Campus. Maulana Azad College of Arts, Science & Commerce, Aurangabad. Department of Computer Science. Academic Year

Chapter 1: Introduction

Chapter 1: Introduction

Misc. Third Generation Batch Multiprogramming. Fourth Generation Time Sharing. Last Time Evolution of OSs

Part V. Process Management. Sadeghi, Cubaleska RUB Course Operating System Security Memory Management and Protection

Device-Functionality Progression

Chapter 12: I/O Systems. I/O Hardware

Operating Systems. Lecture 05

CSE325 Principles of Operating Systems. Processes. David P. Duggan February 1, 2011

Threads Implementation. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Process a program in execution; process execution must progress in sequential fashion. Operating Systems

Chapter 8: Memory- Management Strategies. Operating System Concepts 9 th Edition

Hardware OS & OS- Application interface

Processes and More. CSCI 315 Operating Systems Design Department of Computer Science

Chapter 1: Introduction. Operating System Concepts 9 th Edit9on

7/20/2008. What Operating Systems Do Computer-System Organization

Operating Systems. Computer Science & Information Technology (CS) Rank under AIR 100

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

OPERATING SYSTEMS UNIT - 1

Chapter 8. Operating System Support. Yonsei University

Chapter 13: I/O Systems

Memory management. Last modified: Adaptation of Silberschatz, Galvin, Gagne slides for the textbook Applied Operating Systems Concepts

Operating System Control Structures

Module 1. Introduction:

Chapter 8: Main Memory

Chapter 1: Introduction. Chapter 1: Introduction

Ref: Chap 12. Secondary Storage and I/O Systems. Applied Operating System Concepts 12.1

W4118 Operating Systems. Junfeng Yang

Inter-Process Communication and Synchronization of Processes, Threads and Tasks: Lesson-1: PROCESS

Operating Systems Overview. Chapter 2

Chapter 1: Introduction

Solved MCQs on Operating System Principles. Set-1

Chapter 3: Process Concept

Chapter 3: Process Concept

Main Memory (Part I)

Module 4: Processes. Process Concept Process Scheduling Operation on Processes Cooperating Processes Interprocess Communication

by I.-C. Lin, Dept. CS, NCTU. Textbook: Operating System Concepts 8ed CHAPTER 13: I/O SYSTEMS

Module 4: Processes. Process Concept Process Scheduling Operation on Processes Cooperating Processes Interprocess Communication

Process Description and Control. Chapter 3

European University of Lefke. Instructor: Dr. Arif SARI

Processes and Non-Preemptive Scheduling. Otto J. Anshus

Unit 2 : Computer and Operating System Structure

3.1 Introduction. Computers perform operations concurrently

Chapter 8: Memory-Management Strategies

Process Description and Control. Major Requirements of an Operating System

OPERATING SYSTEM. Functions of Operating System:

Major Requirements of an Operating System Process Description and Control

Chapter 3: Process Concept

CHAPTER-1: INTRODUCTION TO OPERATING SYSTEM:

Process. Program Vs. process. During execution, the process may be in one of the following states

CS510 Operating System Foundations. Jonathan Walpole

Chapter 1: Introduction. Operating System Concepts 8th Edition,

Chapter 8: Virtual Memory. Operating System Concepts Essentials 2 nd Edition

QUESTION BANK UNIT I

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

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

Transcription:

What is an Operating System? A Whirlwind Tour of Operating Systems Trusted software interposed between the hardware and application/utilities to improve efficiency and usability Most computing systems have some form of operating systems Hard to use computer systems without OS Applications & Utilities Operating System Computer Hardware How did OS evolve? In the beginning. Computers cost millions of $$ Hard to operate (done using console switches) Hard to program particularly device I/O How did OS evolve? Expensive machines cannot idle... utilization should be very high Batch processing was devised Programming done offline and subroutine were created for common tasks I/O and processing overlap obtained via buffering and interrupts 1

How did OS evolve? What are the design concerns? OS evolution was driven by two important factors: Cost of Computers (i.e., computer time) Cost of People (i.e., user time) Systems Personal/Embedded systems (e.g., PDAs) Design Concerns computer utilization personal systems time sharing systems early batch systems user wait time Time-sharing systems (e.g., Lab workstations) Batch systems (e.g., IBM mainframes, supercomputers) What are the major OS functions? Control access and provide interfaces To the OS and devices attached to the system Provide interfaces for human-machine and machine-machine transactions Manage resources Mediate resource usage among different tasks Implement policies What are the major OS functions? Provide abstractions Hide the peculiarities of the hardware. Example: device independent I/O Consume resources* OS runs on the system that is being managed so it is going to consume resources! 2

What is the access problem? User wants to access OS, why? User wants to access devices connected to the system It all starts with recognizing the user s intent to access! Access problem: Handling I/O Programmed I/O The CPU transfers the data from (or to) the device buffers. After issuing an I/O operation the CPU continuously checks (polls) for its completion I/O device I/O in progress I/O is completed time CPU CPU issues an I/O operation CPU periodically checks for the completion of I/O operation CPU resumes normal Program execution Access problem: Handling I/O How OS service interrupts? Interrupt-driven I/O (slow speed, character device) The CPU issues an I/O operation and goes on; Device notifies (interrupts) the CPU as data arrives; CPU processes the data I/O in progress * Any program 1 Operating System interrupt vector 2 I/O device I/O is completed interrupt interrupt service routine 3 interrupt interrupt interrupt time 4 CPU CPU issues an I/O operation CPU does other work * One unit of data (a byte or a word) is transferred. CPU resumes execution 1. An interrupt occurs, branch to OS 2. Locate the interrupt service routine (ISR) via interrupt vector 3. Execute the ISR 4. Return to interrupted program 3

Access problem: processing data Once data is captured from device (e.g., keyboard) what is next? Imagine you want to write an word processor Capture some keystrokes for arrow and other control keys Capture words (cooked or raw form?) Accessing devices vs. OS services OS interposes itself between the hardware and applications/utilities/users user device Controlling access to OS Controls device access OS How to control access to OS? Provides a two level architecture: Trusted mode Untrusted mode The OS (at least the core part called Kernel) runs in the trusted mode User applications/utilities run in the untrusted mode System call via Trap OS provides system calls for accessing OS services from applications System calls are special procedure calls Control transfer Switch protection domain System calls also: Validate the call Allow authorized actions to take place 4

How system call is processed? Example system calls in UNIX read() User Program 1. system service is requested (system call) 2. switch mode; verify arguments and service 3. branch to the service function via system call table 5 1 system call entry 2 system call exit system call table.. 4 3 write() open() read() system call routines Process control fork(), exec(), wait(), abort() File manipulation chmod(), link(), stat(), creat() Device manipulation open(), close(), ioctl(), select() Information maintenance time(), acct(), gettimeofday() Communications socket(), accept(), send(), recv() 4. return from service function; switch mode 5. return from system call Operating System How does OS manage resources? Process: Avatar of the application A process represented process table entry Resources Resource Manager (Operating System) Recipients of the Resources (Processes represent applications) Process management File management Memory management Pointer to text segment Pointer to data segment Pointer to bss Registers (uninit. data) segment Program Signal counter UMASK mask status Program Process status word Root directory ID Stack Parent pointer Working directory process Process Process state File descriptors group Time when process Effective Real started uid CPU time Effective Real used gid Children s System Effective CPU time call parameters uid Time of Various Effective next alarm flag bits gid Message Bit maps queue for pointers signals Process Various flag ID bits Various flag bits 5

A simple process model Below is a two-state process model Running (on the CPU) Not running (waiting to get the CPU or at I/O) Process creation Process termination Resource mgmt.: Processor time Processor time is the primary resource managed by the OS How it is managed depends on the type of OS: Batch vs Time-sharing Uniprogramming vs Multiprogramming Some examples Uniprogramming (only one program is running in the system) Some examples Multiprogramming (multiple programs simultaneously loaded into the system) What is the CPU utilization? 6

More examples Process scheduling Comparing the system utilizations process 1 process 2 process n CPU Operating System dispatcher Ready Queue Process scheduling objectives Fairness Give equal and fair access to resources Differential responsiveness Discriminate among different classes of jobs Efficiency Maximize throughput, minimize response time, and accommodate as many users as possible Why memory management? For multiprogramming: multiple programs should co-exist in the memory If programs don t co-exist (share the memory space) what will happen? With memory space sharing: necessary to protect co-residing programs from each other depending on the occupancy pattern, a program would not know the location until load time 7

Why is memory management? It provides: Protection Relocation How does OS manage memory? Idea: Divide the memory into partitions and allocate them to different processes Partitions can be fixed size or variable size A process Cannot access memory not allocated to it Can request more memory from OS Can release already held memory to OS May only use a small portion of the allocated memory How does OS manage memory? We can load more processes than that fitting the memory Where do the rest go? Answer: Virtual memory Virtual memory in action Some memory chunks (pages) are in memory Rest in disk OS is responsible for retrieving the pages from and flushing the pages to disk 8

Storage management: overview Storage management: Data view Requirement: Need to store data in persistent store Organize the data such that it is easy to access and is protected What are the challenges? Performance: secondary storage such as disks are very slow Handle heterogeneity Protect devices USER dir21: file21.1 file21.2 file21.3 dir22: file22.1 file22.2 file22.3 dir23: file23.1 file23.2 file23.3 File system based view content visible as files and directories FILE SYSTEM Block based view content considered as blocks of data DISK SYSTEM 01010 10100 10100 01011 Physical view all data just a stream of bits Storage mgmt.: Component view Abstractions provided by the OS Users Access control Directory management File Structure Logical view Access methods Records File manipulation Buffering Block Caches Disk scheduling File allocation Free space management Controller Caches Central to the abstractions provided by OS is Processes or Threads (lightweight processes) What are the functions provided for process? Lifecycle management Resource management Inter-process communication 9

What is inter-process comm.? Processes: Compete with one another for resources Sometimes they also cooperate to get an application done! Can you give an example? Inter-process communication: Key for cooperating processes that depend on each other How to do inter-process comm.? We can use two approaches: Shared memory approach: Message passing approach What is an OS architecture? How do we build an OS that has all the above functions? We need an architecture for the OS UNIX UNIX limited by hardware functionality, the original UNIX operating system had limited structuring. Systems programs Kernel Consists of everything below the system-call interface and above the physical hardware Provides the file system, CPU scheduling, memory management, and other operating-system functions; a large number of functions for one level 10

UNIX System Structure Layered Vs Microkernel With and without virtual machines 11