OS Concepts and structure

Similar documents
Review from last time. CS 537 Lecture 3 OS Structure. OS structure. What you should learn from this lecture

CSE 120 Principles of Operating Systems. Modules, Interfaces, Structure

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

Chapter 2 System Structures

Operating System Structures

Chapter 3 Operating-System Structures

Objectives. Chapter 2: Operating-System Structures. Operating System Services (Cont.) Operating System Services. Operating System Services (Cont.

Chapter 3: Operating-System Structures. Common System Components

How do Users and Processes interact with the Operating System? Services for Processes. OS Structure with Services. Services for the OS Itself

Kernel Types System Calls. Operating Systems. Autumn 2013 CS4023

System Structures. Services Interface Structure

Example of Standard API

Operating System Components

Chapter 3: Operating-System Structures. System Components Operating System Services System Calls System Programs System Structure Virtual Machines

Components of a Computer System

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

Microkernels, virtualization, exokernels. Tutorial 1 CSC469

Operating Systems 4 th Class

Operating System Structures

Operating Systems OS Architecture Models

Operating System Components and Services

Virtual Machines.

COS 318: Operating Systems

OPERATING SYSTEMS STRUCTURES

Introduction to Virtual Machines

How To Write A Windows Operating System (Windows) (For Linux) (Windows 2) (Programming) (Operating System) (Permanent) (Powerbook) (Unix) (Amd64) (Win2) (X


ELEC 377. Operating Systems. Week 1 Class 3

CPS221 Lecture: Operating System Structure; Virtual Machines

Star System Deitel & Associates, Inc. All rights reserved.

Operating System Structure

OPERATING SYSTEM SERVICES

Principles of Operating Systems CS 446/646

Anh Quach, Matthew Rajman, Bienvenido Rodriguez, Brian Rodriguez, Michael Roefs, Ahmed Shaikh

Multiprogramming. IT 3123 Hardware and Software Concepts. Program Dispatching. Multiprogramming. Program Dispatching. Program Dispatching

CHAPTER 15: Operating Systems: An Overview

How To Understand The History Of An Operating System

Kernel. What is an Operating System? Systems Software and Application Software. The core of an OS is called kernel, which. Module 9: Operating Systems

(Advanced Topics in) Operating Systems

Virtualization. Explain how today s virtualization movement is actually a reinvention

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

Components of a Computing System. What is an Operating System? Resources. Abstract Resources. Goals of an OS. System Software

Overview of Operating Systems Instructor: Dr. Tongping Liu

CS 3530 Operating Systems. L02 OS Intro Part 1 Dr. Ken Hoganson

Operating Systems OBJECTIVES 7.1 DEFINITION. Chapter 7. Note:

Virtualization. Dr. Yingwu Zhu

Chapter 6, The Operating System Machine Level

Computers: Tools for an Information Age

CS3600 SYSTEMS AND NETWORKS

After studying this lesson, you will have a clear understanding of, what an Operating System is. functions of an Operating System

Tools Page 1 of 13 ON PROGRAM TRANSLATION. A priori, we have two translation mechanisms available:

CS420: Operating Systems OS Services & System Calls

Software: Systems and Application Software

CS161: Operating Systems

Operating System Organization. Purpose of an OS

OPERATING SYSTEMS Software in the Background. Chapter 2

COS 318: Operating Systems. Virtual Machine Monitors

1 Organization of Operating Systems

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

Exokernel : An Operating System Architecture for Application-Level Resource Management. Joong Won Roh

Operating System Overview. Otto J. Anshus

nanohub.org An Overview of Virtualization Techniques

COM 444 Cloud Computing

Lesson 06: Basics of Software Development (W02D2

Why study Operating Systems? CS 372. Why study. Why study. Introduction to Operating Systems

Introduction to Operating Systems. Perspective of the Computer. System Software. Indiana University Chen Yu

Chapter 16: Virtual Machines. Operating System Concepts 9 th Edition

Multi-core Programming System Overview

Technology in Action. Alan Evans Kendall Martin Mary Anne Poatsy. Eleventh Edition. Copyright 2015 Pearson Education, Inc.

File Management. COMP3231 Operating Systems. Kevin Elphinstone. Tanenbaum, Chapter 4

Chapter 3. Operating Systems

Virtualization. Pradipta De

Outline: Operating Systems

Introduction. What is an Operating System?

LSN 10 Linux Overview

Operating Systems. Notice that, before you can run programs that you write in JavaScript, you need to jump through a few hoops first

Operating Systems: Basic Concepts and History

Software systems and issues

Uses for Virtual Machines. Virtual Machines. There are several uses for virtual machines:

Programming for GCSE Topic H: Operating Systems

Operating Systems. Rafael Ramirez (T, S)

Comparing Free Virtualization Products

The Art of Virtualization with Free Software

Unit 10 : An Introduction to Linux OS

12. Introduction to Virtual Machines

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study

Full and Para Virtualization

Fall Lecture 1. Operating Systems: Configuration & Use CIS345. Introduction to Operating Systems. Mostafa Z. Ali. mzali@just.edu.

Chapter 5: System Software: Operating Systems and Utility Programs

IOS110. Virtualization 5/27/2014 1

CSE490H: Virtualization

Why Threads Are A Bad Idea (for most purposes)

Page 1 of 5. IS 335: Information Technology in Business Lecture Outline Operating Systems

Chapter 10 Case Study 1: LINUX

Security Overview of the Integrity Virtual Machines Architecture

Lecture 1 Operating System Overview

Data Centers and Cloud Computing

Week Overview. Installing Linux Linux on your Desktop Virtualization Basic Linux system administration

Cloud Computing. Up until now

Overview and History of Operating Systems

Transcription:

OS Concepts and structure Today OS services OS interface to programmers/users OS components & interconnects Structuring OSs Next time Processes

Between hardware and your apps User processes Thunderbird itunes Chrome Powerpoint Vuze Application Interface Operating System File System Virtual Memory Process Manager Network Device Drivers Interrupt Handlers Boot and Init Hardware Abstraction Layer Hardware 2

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

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 Program execution, I/O operation, file system management, communication Some to ensure efficient operation Resource allocation, accounting, protection and security 4

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 Could be just a special program: UNIX, Win XP In this way, multiple shells are possible The command interpreter could Implement all commands Simply understand what program to invoke and how (UNIX) 5

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 6

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

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? Create, delete, suspend, resume & clone a process Inter-process communication & synchronization 8

Memory management Main memory directly accessed storage 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 (explicitly and implicitly) Decide how to allocate to each process Deallocate space when needed by rest of system Maintain mappings from physical to virtual memory Decide when to remove a process from memory 9

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, 10

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 ( VM, Used by many components (file system, 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 11

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 12

Protection Protection is a general mechanism used throughout the OS All resources must be protected memory processes files devices Protection mechanisms help to detect and contain errors, as well as preventing malicious destruction 13

And now a short break NASA Press Conference 14

OS structure OS made of number of components Process & memory management, file system, 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? Massive software engineering Design a large, complex program that: performs well, is reliable, extensible, backwards compatible, 15

OS design & implementation User goals and System goals Clear goals, a unified vision, easier decision making User Convenient to use, easy to learn, reliable, safe, fast System Easy to design, implement, & maintain, also flexible, reliable, error-free & efficient Affected by choice of hardware, type of system Clearly conflicting goals, no unique solution 16

Why is it hard to design an OS? Size: Windows XP ~40G SLOC, RH 7.1 17G SLOC Nobody can understand it all; there are more complex systems but not as tangled Dealing with concurrency multiple users and multiple devices Potentially hostile users, but some who want to collaborate Long expected lives (Unix is ~40y, Windows ~ 30y) & no clear ideas on future needs Portability and support to thousands of device drivers Backward compatibility 17

Design and implementation Guidelines for OS interface design Simplicity Perfection is reached not when there is no longer anything to add, but when there is no longer anything to take away A. de St. Exupéry Completeness Everything should be as simple as possible, but no simpler A. Einstein Efficiency If a system or system call cannot be implemented efficiently, it is probably not worth having A. Tanenbaum System structure How to organize/structure such a complex system? 18

Monolithic design Applications Operating System Everything Hardware 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? How to organize the OS in order to simplify design, implementation and maintenance? 19

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

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 21

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 22

Virtual machines Initial release of OS/360 were strictly batch but users wanted timesharing IBM CP/CMS, later renamed VM/370 ( 79) Note that timesharing systems provides 1. Multiprogramming 2. 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 23

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 to consolidation (administration cost) Different applications for other OS in your desktop Testing and debugging System call here I/O instruction here Trap here CMS OS/360 CMS VM/370 370 Bare hardware Trap here Conversational Monitor System 24

Microkernels Popular in the late 80 s, early 90 s Recent resurgence Goal Minimize what goes in kernel Organize rest of OS as user-level processes This results in 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, 25

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 26

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 27

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?! Early versions were written in assembly language, but during the summer of 1973, it was rewritten in C. The size of the new system is about one third greater than the old. much easier to understand and to modify but also includes many functional improvements we considered this increase in size quite acceptable. D. Ritchie and K. Thompson, The UNIX time-sharing system, CACM 17(7),1974 28

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 29