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



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

OS Concepts and structure

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

Operating System Structure

Chapter 3 Operating-System Structures

Example of Standard API

Components of a Computer System

Chapter 2 System Structures

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

Operating System Components

ELEC 377. Operating Systems. Week 1 Class 3

Operating System Structures

LSN 10 Linux Overview

CHAPTER 15: Operating Systems: An Overview

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

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

OPERATING SYSTEMS STRUCTURES

Operating System Structures

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


CS161: Operating Systems

COS 318: Operating Systems

Operating Systems 4 th Class

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

CPS221 Lecture: Operating System Structure; Virtual Machines

Overview of Operating Systems Instructor: Dr. Tongping Liu

Kernel Types System Calls. Operating Systems. Autumn 2013 CS4023

Operating System Components and Services

Chapter 6, The Operating System Machine Level

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

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

Computer Systems and Networks. ECPE 170 Jeff Shafer University of the Pacific. Linux Basics

Introduction. What is an Operating System?

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

Principles of Operating Systems CS 446/646

Operating System Organization. Purpose of an OS

theguard! ApplicationManager System Windows Data Collector

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

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

Operating Systems OS Architecture Models

Programming for GCSE Topic H: Operating Systems

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

Process Description and Control william stallings, maurizio pizzonia - sistemi operativi

Operating system Dr. Shroouq J.

FAME Operating Systems

Microkernels, virtualization, exokernels. Tutorial 1 CSC469

CSE 265: System and Network Administration. CSE 265: System and Network Administration

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

Tuning U2 Databases on Windows. Nik Kesic, Lead Technical Support

CHAPTER 1: OPERATING SYSTEM FUNDAMENTALS

Computers: Tools for an Information Age

Distributed File Systems

1 Organization of Operating Systems

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

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

CSE 265: System and Network Administration

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

Chapter 15 Windows Operating Systems

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

Operating Systems OBJECTIVES 7.1 DEFINITION. Chapter 7. Note:

Unit 4 Objectives. System Software. Component 4: Introduction to Information and Computer Science. Unit 4: Application and System Software Lecture 2

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

Kernel comparison of OpenSolaris, Windows Vista and. Linux 2.6

CS3600 SYSTEMS AND NETWORKS

Operating System Tutorial

Operating System Overview. Otto J. Anshus

VMware Server 2.0 Essentials. Virtualization Deployment and Management

OPERATING. William Stallings

Windows NT. Chapter 11 Case Study 2: Windows Windows 2000 (2) Windows 2000 (1) Different versions of Windows 2000

CSE 265: System and Network Administration. CSE 265: System and Network Administration

Network operating systems typically are used to run computers that act as servers. They provide the capabilities required for network operation.

CSE 120 Principles of Operating Systems

x86 ISA Modifications to support Virtual Machines

Lecture 25 Symbian OS

CatDV Pro Workgroup Serve r

KVM: Kernel-based Virtualization Driver

Understanding the OS Architecture and Linux History. Zhiqiang Lin

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

Functions of NOS Overview of NOS Characteristics Differences Between PC and a NOS Multiuser, Multitasking, and Multiprocessor Systems NOS Server

6.828 Operating System Engineering: Fall Quiz II Solutions THIS IS AN OPEN BOOK, OPEN NOTES QUIZ.

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

System Structures. Services Interface Structure

OPERATING SYSTEM SERVICES

Operating Systems. Design and Implementation. Andrew S. Tanenbaum Melanie Rieback Arno Bakker. Vrije Universiteit Amsterdam

Outline. Operating Systems Design and Implementation. Chap 1 - Overview. What is an OS? 28/10/2014. Introduction

Software: Systems and Application Software

Red Hat enterprise virtualization 3.0 feature comparison

Chapter 5: System Software: Operating Systems and Utility Programs

Linux Driver Devices. Why, When, Which, How?

Linux Kernel Architecture

Outline: Operating Systems

Encryption Wrapper. on OSX

Introduction to Virtual Machines

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 2 Introducing Operating Systems

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

Virtualization. Jia Rao Assistant Professor in CS

A single user ran a single program ran on a single computer there was no need for Page 1 of 6 Copyright Virtual University of Pakistan

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

Chapter 2: OS Overview

Transcription:

CSE 120 Principles of Operating Systems Fall 2000 Lecture 3: Operating System Modules, Interfaces, and Structure Geoffrey M. Voelker Modules, Interfaces, Structure We roughly defined an OS as the layer of software between hardware and applications We then looked in more detail at the support the hardware provides OSes to do their job Now we re going to look the other direction and survey the support OSes provide to applications Modules OS services and abstractions Interfaces operations supported by components Structure how components get hooked together September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 2 1

OS Module Overview Common OS modules Processes Memory I/O Secondary storage Files Protection Accounting Command interpreter (shell) We ll survey each module and discuss its interface Remainder of class will focus on each module in detail September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 3 Process Module An OS executes many kinds of activities User programs Batch jobs or command scripts System programs (daemons): print spoolers, name servers, file servers, Web servers, etc. Each execution entity is encapsulated in a process A process includes both the program (code, data) and execution context (PC, regs, address space, resources, etc.) Process module manages processes Creation, scheduling, deletion, etc. September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 4 2

Processes A program is passive a file on disk with code and data that is potentially runnable A process is one instance of a program in execution At any instance, multiple processes can be running copies of the same program (e.g., shell, editor) These processes are separate and independent Unix» ps aux (BSD) or ps edaf (SYSV) will list all processes» Will see that multiple processes are executing the same program Processes are fundament OS objects Processes are the OS abstraction for execution September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 5 Process Interface Process module interface Create a process Delete a process Suspend a process Resume a process Inter-process communication» Transfer, share data Inter-process synchronization Process relationships» Parent, child, process groups September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 6 3

Memory Primary memory is the direct access storage for CPU Programs must be stored in memory to execute Interacts with process module Operating systems Allocate memory for programs (explicitly and implicitly) Deallocate memory when needed (by rest of system) Maintain mappings from virtual to physical memory (page tables) Decide how much memory to allocate to each process» Large space of policy decisions Decide when a process should be removed from memory» More policy decisions September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 7 I/O Much of an OS deals with device I/O One of the main reasons we use OSes Hundreds of thousands of lines of code in NT for I/O, drivers The OS provides a standard interface between programs (user or system) and devices File system (disks), sockets (network), frame buffer (video) Device drivers are the routines responsible for controlling devices OS defines an interface for each class of devices (e.g., disks) A driver implements interface, encapsulates device-specific knowledge (initiation and control, interrupt handling, errors) September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 8 4

Secondary Storage Secondary storage (disk) is the persistent memory It endures system failures (for the most part) Low-level OS routines are often responsible for lowlevel disk functions Read/write blocks Schedule requests (optimize arm movement) Device errors Usually independent of file system Although there might be cooperation (e.g., free space management) Low-level knowledge can help FS performance (placement) September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 9 File System Secondary storage devices are too crude to use directly for long-term storage Read/write physical device blocks too low-level for programs The file system provides a much higher level, more convenient abstraction for persistent storage Objects (files, directories) and interfaces (read, write, etc.) Files are the basic storage entity A file is a named collection of persistent information Directories are special files that contain the names of other files + metadata (data about files, attributes) Directories have all properties of files ( inheritance ) September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 10 5

File System Interface File system interface provides standard file operations Existence: File/directory creation, deletion Manipulation: open, read, write, append, rename, close, etc. Sometimes higher-level operations» File copy, change notification (NT)» Records (IBM) File system also provides general services Backup Consistency Accounting and quotas September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 11 Protection Protection is general mechanism throughout OS All objects (resources) need protection Processes Memory Devices Files Protection mechanisms help to prevent errors as well as to prevent malicious destruction E.g., running as root September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 12 6

Accounting General facility for keeping track of resource usage for all system objects Quotas in the file system (Unix: quota v ) Memory usage (Unix: man limit ) Process resource usage (Unix: rusage <command> ) Resource usage might be used to bill customers In world of PCs, might seem strange In world of mainframes and minicomputers, crucial» Departments, users billed for CPU time IBM mainframe turbo switch September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 13 Command Interpreter (Shell) Process that handles Handles user input (commands) Manages subprocesses Executes script files (files of commands) On some systems, CI is part of OS Users constrained to use that CI (DOS) Others, it is just another user-level process Unix shell Any program can be a CI (sh, csh, ksh, bash, etc.) Or, there may not be a command language at all MacOS (hey, where s the shell?) September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 14 7

The Challenge of Structure It is clear what modules an OS should provide Not so clear how to hook them together (well) Process Management Command Interpreter File System Memory Management Protection Secondary Storage I/O Subsystem Accounting September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 15 OS Structure An OS consists of all of the above modules, others we haven t discussed, system programs (privileged and non-privileged), etc. The challenge How do we organize it all? What are the modules, where do they exist? How do they cooperate? How do we build a complex software system that is: Large and complex Concurrent Long-lived and evolving Performance-critical September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 16 8

Monolithic Kernels Traditionally, OSes such as Unix are built as a monolithic kernel (BSD, SYSV, Solaris, Linux, etc.) User Programs Everything OS Kernel Hardware September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 17 Monolithic Problems Monolithic kernels have one great feature The overhead of inter-module interaction is low Monolithic kernels have a number of problems Hard to understand Hard to modify Hard to maintain Unreliable (a bug in one module can take down entire system) From the beginning, OS designers have sought ways to organize the OS to simplify design and construction September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 18 9

Layering An early approach is layering Each system service is a layer Each layer defines and implements an abstraction for the layer above it Layers in effect virtualize the layer below Approach first used by Dijkstra s THE system (1968) Analogous to protocol layers in networking stacks September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 19 THE System Levels see a virtual machine provided by lower level Level 1 (CPU scheduling) Level 2 (memory management) sees virtual processors Level 3 (console) sees VM (segments) Level 4 (device buffers) sees a virtual console Level 5 (user programs) sees virtual I/O drivers System composed of a set of sequential processes Processes communicate via synchronization in memory Key: Each layer could be tested and verified independently September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 20 10

Layering Problems Layered systems are hierarchical, but real systems have much more complex interactions File system requires VM services (data structures, buffers) VM requires file system services (backing store) What do you do? Layering not flexible enough Can have poor performance (depends on how layers interact) Systems often modeled as layered structures, but not built as such September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 21 Microkernel Structure Microkernel structures were hot in late 80s, early 90s Minimize kernel services, implement remaining OS modules as user-level processes Better reliability (file system dies, restart it ) Easier to extend and customize (start a new process) Support multiple coexisting OS implementations But, mediocre performance Overhead of inter-module interaction is high (c.f. monolithic) First microkernel system was Hydra (CMU, 1970) Others: Mach (CMU), Chorus (French Unix-like system), NT (Microsoft), OSX (Apple) September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 22 11

Microkernel Structure User Programs User Mode H/L Scheduling File System Network Processes External Pager OS Modules Kernel Mode Communication Low-level VM CPU scheduling Protection Microkernel Hardware September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 23 Windows NT 3.1 (1993) User Programs User Mode Security OS/2 Win32 Posix Protected Subsystems Object Manager Security Processes Kernel Mode Virtual Memory Local Proc Call Kernel Services I/O NT Executive Hardware Abstraction Layer HAL Hardware September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 24 12

Next time Read Chapter 5 (Chapter 4 is optional) September 27, 2000 CSE 120 -- Lecture 3 Mods, Ints, Structure 25 13