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

Similar documents
Operating System Services

Chapter 2: Operating-System Structures

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

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

Chapter 2: Operating-System

Chapter 2: Operating-System Structures

Chapter 2: Operating-System Structures

Lecture 2 Operating System Structures (chapter 2)

Chapter 1: Introduction. Operating System Concepts 9 th Edit9on

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

Chapter 2: System Structures

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

CS420: Operating Systems. OS Services & System Calls

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

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

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

Chapter 1: Introduction

CS307: Operating Systems

System Call System Program Linker/Loader with Examples Types of computing Environment

CHAPTER 2: SYSTEM STRUCTURES. By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

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

Chapter 1: Introduction. Chapter 1: Introduction

Operating-System Structures

Chapter 2. Operating-System Structures

OPERATING SYSTEMS: Lesson 1: Introduction to Operating Systems

CS420: Operating Systems

Chapter 1: Introduction

CS420: Operating Systems

Chapter 1: Introduction

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

OPERATING SYSTEMS Lecture Notes. Prepared by K.Rohini, Assistant Professor, CSE Department, GVPCEW.

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

TDDI04, K. Arvidsson, IDA, Linköpings universitet Operating System Structures. Operating System Structures Overview. Operating System Services

Chapter 2: Operating-System Structures

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy

European University of Lefke. Instructor: Dr. Arif SARI

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

UNIT 2. OPERATING SYSTEM STRUCTURES

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

CS370 Operating Systems

SRIMAAN COACHING CENTRE-TRB-COMPUTER INSTRUCTORS STUDY MATERIAL CONTACT: III

Chapter 2: Operating-System Structures

Chapter 2. Operating System Structures

Four Components of a Computer System

Operating-System Structures

Operating System: Chap2 OS Structure. National Tsing-Hua University 2016, Fall Semester

Introduction to Operating Systems (Part II)

DM510 Operating Systems. Jacob Aae Mikkelsen

CS370 Operating Systems

Chapter 2 Operating-System Structures

Lecture 2 - Fundamental Concepts

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

Operating System Services. User Services. System Operation Services. User Operating System Interface - CLI. A View of Operating System Services

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

Chapter 3: Operating-System Structures

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

Chapter 2 Operating System Structures

Chapter 3: Operating-System Structures

Chap2: Operating-System Structures

What are some common categories of system calls? What are common ways of structuring an OS? What are the principles behind OS design and

The Slide does not contain all the information and cannot be treated as a study material for Operating System. Please refer the text book for exams.

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

Course Details. Operating Systems with C/C++ Course Details. What is an Operating System?

Module 3: Operating-System Structures

Last class: OS and Architecture. OS and Computer Architecture

Last class: OS and Architecture. Chapter 3: Operating-System Structures. OS and Computer Architecture. Common System Components

Operating Systems. Lecture Course in Autumn Term 2015 University of Birmingham. Eike Ritter. September 22, 2015

CS370 Operating Systems

OPERATING SYSTEMS. Prescribed Text Book Operating System Principles, Seventh Edition By Abraham Silberschatz, Peter Baer Galvin and Greg Gagne

Chapter 3 Process Description and Control

CSE 4/521 Introduction to Operating Systems

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

Operating-System Structures

Lecture 1 Introduction (Chapter 1 of Textbook)

Module 3: Operating-System Structures. Common System Components

Chapter 3: Operating-System Structures

Operating- System Structures

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

Operating-System Structures

Operating Systems. Overview. Dr Alun Moon. Computing, Engineering and Information Sciences. 27th September 2011

OPERATING SYSTEMS UNIT - 1

Chapter 2: OS Structures

CSC 453 Operating Systems

Chapter 1: Introduction. Operating System Concepts 9 th Edit9on

Computer-System Architecture (cont.) Symmetrically Constructed Clusters (cont.) Advantages: 1. Greater computational power by running applications

Lecture 1 - Operating System Overview

Chapter 2: System Structures

EECS 3221 Operating System Fundamentals

EECS 3221 Operating System Fundamentals

CSE Opera+ng System Principles

Introduction to Operating Systems (Part III)

Four Components of a Computer System. Operating System Concepts 7 th Edition, Jan 12, 2005

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

OPERATING SYSTEM OVERVIEW

Chapter 3: Processes

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

Introduction. Chapter Prof. Amr El-Kadi

Module 1 Introduction/OS Overview

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

Transcription:

Chapter 2: Operating-System Structures Operating System Concepts 8 th Edition Silberschatz, Galvin and Gagne 2009

Chapter 2: Operating-System Structures Different Services of Operating System. System Calls- Concept, Types and Uses Simple Structure, Layered, Monolithic, Microkernel. Components activities- - Process Management, - Main Memory Management, - File Management, - I/O System management, -Secondary storage management. 2.2

Operating System Services Operating systems provide an environment for execution of programs and services to programs and users Different operating system services are: 1. User interface - Almost all operating systems have a user interface (UI). Interfaces can be Command-Line (CLI), Graphics User Interface (GUI), Batch 2. Program execution - The system must be able to load a program into memory and to run that program, end execution, either normally or abnormally (indicating error) 3. I/O operations - A running program may require I/O, which may involve a file or an I/O device 4. File-system manipulation - The file system is of particular interest. Programs need to read and write files and directories, create and delete them, search them, list file Information, permission management. 2.3

Operating System Services (Cont.) 5. Communications Processes may exchange information, on the same computer or between computers over a network. Communications may be via shared memory or through message passing (packets moved by the OS) 6. Error detection OS needs to be constantly aware of possible errors May occur in the CPU and memory hardware, in I/O devices, in user program For each type of error, OS should take the appropriate action to ensure correct and consistent computing 2.4

Operating System Services (Cont.) Another set of OS functions exists for ensuring the efficient operation of the system itself via resource sharing 7 Resource allocation - When multiple users or multiple jobs running concurrently, resources must be allocated to each of them 1. Many types of resources - Some (such as CPU cycles, main memory, and file storage) may have special allocation code, others (such as I/O devices) may have general request and release code 8 Accounting - To keep track of which users use how much and what kinds of computer resources 9 Protection and security - The owners of information stored in a multiuser or networked computer system may want to control use of that information, concurrent processes should not interfere with each other Protection involves ensuring that all access to system resources is controlled Security of the system from outsiders requires user authentication, extends to defending external I/O devices from invalid access attempts 2.5

A View of Operating System Services 2.6

System Calls Programming interface to the services provided by the OS Typically written in a high-level language (C or C++) Mostly accessed by programs via a high-level Application Program Interface (API) rather than direct system call use Three most common APIs are Win32 API for Windows, POSIX API for POSIX-based systems and Java API for the Java virtual machine (JVM) 2.7

Example of System Calls System call sequence to copy the contents of one file to another file 2.8

Example of Standard API Consider the ReadFile() function in the Win32 API a function for reading from a file A description of the parameters passed to ReadFile() HANDLE file the file to be read LPVOID buffer a buffer where the data will be read into and written from DWORD bytestoread the number of bytes to be read into the buffer LPDWORD bytesread the number of bytes read during the last read LPOVERLAPPED ovl indicates if overlapped I/O is being used 2.9

System Call Implementation Typically, a number associated with each system call System-call interface maintains a table indexed according to these numbers The system call interface invokes intended system call in OS kernel and returns status of the system call and any return values The caller need know nothing about how the system call is implemented Just needs to obey API and understand what OS will do as a result call Most details of OS interface hidden from programmer by API Managed by run-time support library (set of functions built into libraries included with compiler) 2.10

API System Call OS Relationship 2.11

Standard C Library Example C program invoking printf() library call, which calls write() system call 2.12

Types of System Calls Process control end, abort load, execute create process, terminate process get process attributes, set process attributes wait for time wait event, signal event allocate and free memory File management create file, delete file open, close file read, write, reposition get and set file attributes 2.13

Types of System Calls (Cont.) Device management request device, release device read, write, reposition get device attributes, set device attributes logically attach or detach devices Information maintenance get time or date, set time or date get system data, set system data get and set process, file, or device attributes Communications create, delete communication connection send, receive messages transfer status information attach and detach remote devices 2.14

Examples of Windows and Unix System Calls 2.15

Simple Structure MS-DOS written to provide the most functionality in the least space Not divided into modules Although MS-DOS has some structure, its interfaces and levels of functionality are not well separated 2.16

MS-DOS Layer Structure 2.17

Layered Approach The operating system is divided into a number of layers (levels), each built on top of lower layers. The bottom layer (layer 0), is the hardware; the highest (layer N) is the user interface. With modularity, layers are selected such that each uses functions (operations) and services of only lower-level layers 2.18

Traditional UNIX System Structure 2.19

UNIX UNIX limited by hardware functionality, the original UNIX operating system had limited structuring. The UNIX OS consists of two separable parts Systems programs The 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 2.20

Layered Operating System 2.21

Microkernel System Structure Moves as much from the kernel into user space Communication takes place between user modules using message passing Benefits: Easier to extend a microkernel Easier to port the operating system to new architectures More reliable (less code is running in kernel mode) More secure Disadvantages: Performance overhead of user space to kernel space communication 2.22

Mac OS X Structure 2.23

System Boot Operating system must be made available to hardware so hardware can start it Small piece of code bootstrap loader, locates the kernel, loads it into memory, and starts it Sometimes two-step process where boot block at fixed location loads bootstrap loader When power initialized on system, execution starts at a fixed memory location Firmware used to hold initial boot code 2.24

Process Management A process is a program in execution. It is a unit of work within the system. Program is a passive entity, process is an active entity. Process needs resources to accomplish its task CPU, memory, I/O, files Initialization data Process termination requires reclaim of any reusable resources Single-threaded process has one program counter specifying location of next instruction to execute Process executes instructions sequentially, one at a time, until completion Multi-threaded process has one program counter per thread Typically system has many processes, some user, some operating system running concurrently on one or more CPUs Concurrency by multiplexing the CPUs among the processes / threads 2.25

Process Management Activities The operating system is responsible for the following activities in connection with process management: Creating and deleting both user and system processes Suspending and resuming processes Providing mechanisms for process synchronization Providing mechanisms for process communication Providing mechanisms for deadlock handling 2.26

Memory Management To execute a program all (or part) of the instructions must be in memory All (or part) of the data that is needed by the program must be in memory. Memory management determines what is in memory and when Optimizing CPU utilization and computer response to users Memory management activities Keeping track of which parts of memory are currently being used and by whom Deciding which processes (or parts thereof) and data to move into and out of memory Allocating and deallocating memory space as needed 2.27

Storage Management OS provides uniform, logical view of information storage Abstracts physical properties to logical storage unit - file Each medium is controlled by device (i.e., disk drive, tape drive) Varying properties include access speed, capacity, datatransfer rate, access method (sequential or random) File-System management Files usually organized into directories Access control on most systems to determine who can access what OS activities include Creating and deleting files and directories Primitives to manipulate files and directories Mapping files onto secondary storage Backup files onto stable (non-volatile) storage media 2.28

Mass-Storage Management Usually disks used to store data that does not fit in main memory or data that must be kept for a long period of time Proper management is of central importance Entire speed of computer operation hinges on disk subsystem and its algorithms OS activities Free-space management Storage allocation Disk scheduling Some storage need not be fast Tertiary storage includes optical storage, magnetic tape Still must be managed by OS or applications Varies between WORM (write-once, read-many-times) and RW (read-write) 2.29