OS concepts and structure. q OS components & interconnects q Structuring OSs q Next time: Processes

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

Operating Systems. Operating System Structure. Lecture 2 Michael O Boyle

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

OS Concepts and structure

EEE 435 Principles of Operating Systems

Chapter 2 Operating-System Structures

OS Design Approaches. Roadmap. OS Design Approaches. Tevfik Koşar. Operating System Design and Implementation

Operating-System Structures

Chapter 2: 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

Chapter 2: System Structures

Chapter 2. Operating-System Structures

Operating-System Structures

Chapter 2: Operating-System Structures

CSC 453 Operating Systems

Roadmap. Tevfik Koşar. CSE 421/521 - Operating Systems Fall Lecture - II OS Structures. University at Buffalo. OS Design and Implementation

OS Design Approaches. Roadmap. System Calls. Tevfik Koşar. Operating System Design and Implementation. CSE 421/521 - Operating Systems Fall 2013

Operating System Architecture. CS3026 Operating Systems Lecture 03

COS 318: Operating Systems

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

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

Chapter 2: Operating-System Structures

Chapter 2: 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

Module 3: Operating-System Structures. Common System Components

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

ELEC 377 Operating Systems. Week 1 Class 2

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

Operating-System Structures

Operating System Services

Chapter 3: 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

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

Chapter 2: Operating-System

Operating-System Structures

Four Components of a Computer System

Chapter 3: Operating-System Structures

Operating Systems, Fall

Master level: Operating systems, distributed systems, networking,

Chapter 3: Operating-System Structures

Module 1 Introduction/OS Overview

Unit 2 : Computer and Operating System Structure

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

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

NON SCHOLAE, SED VITAE

Operating Systems Structure. Otto J. Anshus

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.

Microkernels and Client- Server Architectures

Module 3: Operating-System Structures

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

Operating System Structure

COS 318: Operating Systems

Operating System Concepts Ch. 2: Operating System Structures

Chapter 2: Operating-System Structures

Reserves time on a paper sign-up sheet. Programmer runs his own program. Relays or vacuum tube hardware. Plug board or punch card input.

Operating System Kernels

OPERATING SYSTEMS: Lesson 1: Introduction to Operating Systems

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

Process Description and Control

UNIT 2. OPERATING SYSTEM STRUCTURES

Operating Systems CS3502 Spring 2018

CS370 Operating Systems

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

Chapter 2: System Structures

Introduction. Chapter Prof. Amr El-Kadi

Operating- System Structures

Topics. Operating System I. What is an Operating System? Let s Get Started! What is an Operating System? OS History.

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

Operating System Review

Virtual Machines Disco and Xen (Lecture 10, cs262a) Ion Stoica & Ali Ghodsi UC Berkeley February 26, 2018

Operating System Structure

Operating System Structure

Operating System Structure

What does an Operating System do?

Introduction to OS (cs1550)

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

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

CS307: Operating Systems

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

Topics. Operating System. What is an Operating System? Let s Get Started! What is an Operating System? Where in the Book are we?

Some popular Operating Systems include Linux Operating System, Windows Operating System, VMS, OS/400, AIX, z/os, etc.

Operating System Structure

Operating systems Architecture

Chapter 1: Introduction Operating Systems MSc. Ivan A. Escobar

Often, more information is required when designing system call Information varies according to OS and types of system call

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

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

Types and Functions of Win Operating Systems

! Software ( kernel ) that runs at all times. ! OS performs two unrelated functions: Maria Hybinette, UGA. user! 1! Maria Hybinette, UGA. user! n!

Memory Management Topics. CS 537 Lecture 11 Memory. Virtualizing Resources

Introduction to Operating Systems (Part III)

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

Lecture 5: February 3

CSCI 8530 Advanced Operating Systems. Part 19 Virtualization

Lecture 3: O/S Organization. plan: O/S organization processes isolation

OS - Introduction Ezio Bartocci Institute for Computer Engineering

Transcription:

OS concepts and structure q OS components & interconnects q Structuring OSs q Next time: Processes

OS Views Perspectives, OS as the services it provides its components and interactions Services to Users via a GUI or a command interpreter/shell Programmers via system calls Some services are for convenience: FS management Some to ensure efficient operation: Resource allocation 2

GUI or command interpreter (shell) GUI Friendlier (desktop), if sometimes limiting Xerox PARK Alto >> Apple >> Windows >> Linux Command interpreter Handle (interpret and execute) user commands Could be part of the OS: MS DOS, Apple II Or just a special program: UNIX, Win XP The command interpreter could Implement all commands Simply understand what program to invoke and how (UNIX) 3

System calls Low-level interface to services for applications Higher-level requests get translated into sequence of system calls Writing cp copy source to destination Get file names Open source Create destination Loop Read from source Copy to destination Close destination Report completion Terminate 4

Major OS components & abstractions Processes Memory I/O Secondary storage File systems Protection Accounting Shells & GUI Networking 5

Major OS components & abstractions Networking Secondary storage Protection System Memory Shells & GUI Accounting Processes File systems Error handling I/O 6

Processes An OS executes many kind of activities Each encapsulated in a process A program in execution Address space, set of registers, OS resources Threads and processes for now consider each process to have a single thread (we ll revisit this later) To get a better sense of it What data do you need to re-start a suspended process? Where do you keep this data? What is the process abstraction interface offered by the OS? 7

Memory management Main memory directly accessed for CPU Programs must be in memory to execute Memory access is fast (e.g., 60 ns to load/store), but not persistent (won t survive power failures) OS must Allocate memory space to processes Decide how to allocate it to each process Deallocate it when needed Maintain mappings from physical to virtual memory Decide when to remove a process from memory 8

I/O A big chunk of the OS kernel deals with I/O Hundreds of thousands of lines in NT The OS provides a standard interface between programs & devices File system (disk), sockets (network), frame buffer (video) Device drivers are the routines that interact with specific device types Encapsulates device-specific knowledge e.g., how to initialize a device, request I/O, handle errors Examples: SCSI device drivers, Ethernet card drivers, video card drivers, sound card drivers, 9

Secondary storage Secondary storage (disk, tape) is persistent memory Often magnetic media, survives power failures (hopefully) Code interacting with disks are at a very low level in the OS Used by many components (file system, VM, ) Handle scheduling of disk operations, head movement, error handling, and often management of space on disks Usually independent of file system Although there may be cooperation FS knowledge of device details can help with performance e.g., place related files close together on disk 10

File systems Storage devices are hard to work with File system offers a convenient abstraction Defines logical abstractions/objects like files & directories As well as operations on these objects A file is the basic unit of long-term storage A directory is just a special kind of file containing names of other files & metadata Interface File/directory creation/deletion, manipulation, copy, lock Other higher level services: accounting & quotas, backup, indexing or search, versioning 11

Protection Protection is a general mechanism used throughout the OS All resources must be protected memory processes files devices Mechanisms help detect and contain errors, and preventing malicious destruction 12

OS design & implementation A challenge Conflicting user and system goals User Convenient, easy to learn, reliable, safe, fast System Easy to design, implement, and maintain, flexible, reliable, error-free and efficient Dealing with concurrency users and devices Some hostile users, others who want to collaborate Long expected lives (Unix is ~40y, Windows ~ 30y) & no clear ideas on future needs Portability and support for 1,000s of devices Backward compatibility 13

OS design & implementation A software engineering principle separate policy & mechanism Policy: What will be done? Mechanism: How to do it? Why do you care? Max flexibility, easier to change Implementation on high-level language Early on assembly (e.g. MS-DOS 8088), later Algol (MCP), PL/1 (MULTICS), C (Unix, ) Advantages faster to write, more compact, easier to maintain & debug, easier to port Cost Size, speed?, but who cares?! 14

OS structure OS made of number of components Process, memory management, and system programs e.g., bootstrap code, the init program, Major design issue How do we organize all this? What are the modules, and where do they exist? How do they interact? http://www.makelinux.net/kernel_map/ 15

Monolithic design Major advantage Cost of module interactions is low (procedure call) Disadvantages Hard to understand Hard to modify & maintain Unreliable (no isolation between system modules) Alternative? Operating System Applications Everything Hardware How to organize the OS in order to simplify design, implementation and maintenance? 16

Layering Traditional approach Implement OS as a set of layers Each layer presents an enhanced virtual mach to the layer above Each can be tested and verified independently Layer Function 5 The operator 4 User programs MULTICS 3 I/O management 2 Operator-process communication Ring 0 Ring 1 1 Memory and drum management 0 Processor allocation and multiprogramming Dijkstra s THE system (1968) Ring n - 1 17

Problems with layering Imposes hierarchical structure but real systems have complex interactions Strict layering isn t flexible enough Poor performance Each layer crossing has an associated overhead Disjunction between model and reality Systems modelled as layers, but not built that way 18

HAL Hardware Abstraction Layer An example of layering in modern OSs Goal to hide differences in hardware from most of the OS kernel On a PC, you can consider it as the driver of the motherboard BSD, Mac OS X, Windows NT, Linux, NetBSD all use a HAL either explicitly identified or not 19

Virtual machines Initial release of OS/360 were strictly batch but users wanted timesharing IBM CP/CMS, later renamed VM/370 ( 79) Timesharing systems provides Multiprogramming & Extended (virtual) machine Essence of VM/370 separate the two Heart of the system (VMM) does multiprogramming & provides multiple exact copies of bare HW to next layer up Each VM can run any OS System call here I/O instruction here Trap here CMS OS/360 CMS VM/370 370 Bare hardware Trap here Conversational Monitor System 20

Virtual machines A resurgence in mid-90s, started with Rosenblum s work on Disco and VMWare Nowadays Java VM, Xen, VritulaBox, Virtual Iron, VMLite, Simics, Parallels, Palacios, QEMU, What for? Server consolidation from different services in different lightly used machine (administration cost) Different applications for other OS in your desktop Testing and debugging 21

Microkernels Popular in the late 80 s, early 90 s Making some of a comeback Goal: Minimal kernel, the rest in user-level What for? Better reliability (isolation between components) Ease of extension and customization Poor performance (user/kernel boundary crossings) First microkernel Hydra (CMU, 1970) Mach (CMU), Chorus (UNIX-like), OS X (Apple), in some ways NT (Microsoft), L4 (Karlsruhe), MINIX 3, 22

Microkernel User processes itunes Thunderbird Chrome Powerpoint Vuze System processes File system Threads Network Scheduling Virtual Memory microkernel Low-level VM Process control Communication Protection Hardware 23

Exokernels OS, typically securely multiplexes & abstract physical resources But no OS abstractions fits all! Exokernel A minimal OS securely multiplexes resources Library OSes implement higher-level abstractions Secure binding a protection mechanism that decouples authorization (done at binding) from use of a resource Firefox www TCP POSIX Applications Library operating systems DSM IPC VM Traps Exokernel Secure bindings Hardware Frame buffer TLB Network Memory Disk 24

Summary & preview Today The mess under the carpet Basic concepts in OS OS design has been an evolutionary process Structuring OS - a few alternatives, not a clear winner Next Process the central concept in OS Process model and implementation What it is, what it does and how it does it 25