ELEC 377. Operating Systems. Week 1 Class 3



Similar documents
Example of Standard API

Chapter 3 Operating-System Structures

Chapter 2 System Structures

System Structures. Services Interface Structure

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

Operating System Structures

Operating System Structures

Operating System Components and Services

Chapter 3: Operating-System Structures. Common System Components

Components of a Computer System

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

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

Chapter 2: OS Overview

OPERATING SYSTEM SERVICES

CHAPTER 15: Operating Systems: An Overview

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

Operating System Components

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

Origins of Operating Systems OS/360. Martin Grund HPI

CPS221 Lecture: Operating System Structure; Virtual Machines

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

OPERATING SYSTEMS STRUCTURES

OS Concepts and structure

Operating Systems 4 th Class

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

Processes and Non-Preemptive Scheduling. Otto J. Anshus

Multi-core Programming System Overview

An Implementation Of Multiprocessor Linux

Kernel Types System Calls. Operating Systems. Autumn 2013 CS4023

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

Chapter 3. Operating Systems

Operating System Organization. Purpose of an OS

COS 318: Operating Systems

CS420: Operating Systems OS Services & System Calls

Operating Systems. 05. Threads. Paul Krzyzanowski. Rutgers University. Spring 2015

CS161: 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

Programming for GCSE Topic H: Operating Systems

Operating System Structure

Microkernels, virtualization, exokernels. Tutorial 1 CSC469

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

Overview of Operating Systems Instructor: Dr. Tongping Liu

Operating Systems and Networks

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

CS3600 SYSTEMS AND NETWORKS

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

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

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

Virtualization Technology. Zhiming Shen

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

How To Understand The History Of An Operating System

Introduction to Virtual Machines

CSC 2405: Computer Systems II

Introduction. What is an Operating System?

Topic 5a Operating System Fundamentals

Virtual Servers. Virtual machines. Virtualization. Design of IBM s VM. Virtual machine systems can give everyone the OS (and hardware) that they want.

Full and Para Virtualization

Security Overview of the Integrity Virtual Machines Architecture

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

LSN 10 Linux Overview

How To Understand How A Process Works In Unix (Shell) (Shell Shell) (Program) (Unix) (For A Non-Program) And (Shell).Orgode) (Powerpoint) (Permanent) (Processes

Android Operating System

Operating System Overview. Otto J. Anshus

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

Technical Properties. Mobile Operating Systems. Overview Concepts of Mobile. Functions Processes. Lecture 11. Memory Management.

Chapter 10 Case Study 1: LINUX

Virtualization. Clothing the Wolf in Wool. Wednesday, April 17, 13

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

(Advanced Topics in) Operating Systems

Linux Kernel Architecture

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

Operating System Tutorial

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

System Virtual Machines

Operating Systems. Lecture 03. February 11, 2013

Operating Systems OBJECTIVES 7.1 DEFINITION. Chapter 7. Note:

Operating Systems PART -A

12. Introduction to Virtual Machines

Virtual Machines. COMP 3361: Operating Systems I Winter

Virtual Machines.

Android Architecture. Alexandra Harrison & Jake Saxton

Principles of Operating Systems CS 446/646

Cloud Computing. Up until now


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

Chapter 5 Cloud Resource Virtualization

Restraining Execution Environments

Virtualization in Linux KVM + QEMU

Networking Operating Systems (CO32010)

Lecture 1 Introduction to Android

International Engineering Journal For Research & Development

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

Virtualization. Types of Interfaces

Computer Organisation Operating Systems

Computers: Tools for an Information Age

Intel DPDK Boosts Server Appliance Performance White Paper

CS5460: Operating Systems. Lecture: Virtualization 2. Anton Burtsev March, 2013

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

Transcription:

Operating Systems Week 1 Class 3

Last Class! Computer System Structure, Controllers! Interrupts & Traps! I/O structure and device queues.! Storage Structure & Caching! Hardware Protection! Dual Mode Operation

Command Interpreter! User Interface! accept commands and execute them! scripting languages! Graphical Interface Sometimes built into the system! Windows/Macintosh! Old Basic Systems (Pet, Apple 2)! Sometimes separate process! Unix shell! TSO Interpreter! MS-DOS COMMAND.COM

System Services! All of the systems we have discussed have to be accessible to user and user programs! Have to have mechanisms to start programs, request I/O, communicate with other processes and with other computers! Error detection is required (hardware, user programs) Other services needed are:! Resource Allocation! Accounting (time, disk space, pages, etc.)! Protection

System Calls! Interface between a running process and the operating system! Generally implemented as an assembly language instruction (INT on INTEL, TRAP on PDP-11, ALine instruction on 68000)! Sometimes a function call (Amiga, NCR32000)! Programming languages provide libraries that wrap these instructions for easy access.! Like most function calls, they take arguments and return a result, it s just the mechanism of the call that is different.

System Calls! The system call is identified in one of two ways! One of the parameters (Dos)! Different instruction (Macintosh)! Three general ways are used to pass parameters! Use the registers of the CPU (Amiga, MS-DOS)! Store them in memory and pass the address of the memory in a register (Linux)! Pass them on the stack! Results are passed back in one of two ways:! On the stack! In a register

Types of System Calls! Process Management! exit, abort, TSR,load, execute! manage child processes (attributes, wait, trace)! memory allocation, signals! File System Management! create,open,close,read,write,etc.! Device Management (e.g. serial speed)! request, release, read,write,attributes! Information Maintenance! time, date, file and device attributes! Communication! open,close,send,receive, status

Communication Model! Interprocess Communication! Command interpreter -> child process! other processes need to communicate (Mac publish and subscribe)! Message Model! Operating system provides message passing facility.! In some cases, works over network (sockets)! Shared Memory Model! both processes have access to the same memory! small segments or all of processes memory

Systems Program! System calls provide capability, but user must be able to invoke them.! Users view of system defined by system programs, not system calls. No system call to copy a file, but there is a system program.! Programs must be written that the user can invoke that make the system calls! Command interpreter! File System Management (copy, cp, mkdir, rmdir)! Info (date, time, disk space, list directory)! Editors! compilers, project support! communication (web browsers, ftp clients)

System Structure! Simple Structure! Limited by hardware! MS-DOS - interfaces and functionality not well separated! Unix is two separate parts!!kernel system call interface (some! modularity)!!systems programs! Layered (OS/2)! Operating system divided into layers! Each layer only uses lower layers (no sibling calls)! Microkernel (Mach)! Minimal kernel (no consensus on what minimal is)! Move as much as possible into system programs

Virtualization! Multiprocessing creates the illusion that there is more than one CPU! What if the OS provided an interface that looked exactly like a computer system (virtual CPU, devices, etc.)! IBM VM Operating system (each can run it s own operating system such as CMS or Linux)! Requires more hardware support! Available on PCs (vmware/xen/kvm)! Limits sharing of resources! Perfect for OS research and development! Emulation (Sheepshaver/BOCHS)

Virtual Machines! Portability! virtual machine provides same interface on all hardware! Security! sandbox! Like an OS! class loader (loads bytecode)! threads (sort of like virtual cpus)! Performance! Just in time compilation! Android! Linux Kernel! Dalvik virtual machine

Virtual Machines (Java)! Portability! virtual machine provides same interface on all hardware! Security! sandbox! Like an OS! class loader! threads! Performance! Just in time compilation

Design and Implementation! Mechanisms and Policies! Mechanisms are how! Use timer to protect CPU! Policy is what will be done! timer value (max time process can have CPU)! more flexibility! Implementation! language! efficiency! portability (Linux runs on many architectures)! monitoring capability! sysgen (customization of operating system)

What is a process?! An operating system handles a variety of programs in a variety of ways! Batch systems handle jobs! Timesharing systems calls them user programs or tasks.! Job and process are used almost interchangeably.! A process is a program in execution, and all of the resources associated with that executing instance of the program! Memory! Program Counter! Open files, other devices, etc.

Program Layout Procedure Call/Return Local Variables grows downwards Top Half is the Heap (malloc) grows upwards Bottom Half is Global Vars Executable Code Binary Machine Instructions Usually Shared Stack Segment Unallocated Data Segment Text Segment

Process State New Started Ready Interrupt Dispatch Running Exit Done I/O or Event Completion Wait I/O or Event Request

Process Control Block! One allocated for each process and sometimes for each thread! Repository for information that varies from process to process! Some operating systems have a pre allocated number of them, that is an array (early UNIX)! Some permit dynamic allocation (Amiga OS) Queue Info Process State Schedule Info Process Id Program Counter Registers Memory Info Open File, etc. Accounting Info

Context Switch Process 1 Process 2 Int or System Call Save State into PCB Do Accounting Do OS Tasks Select Next Process Restore State from PCB Return from Int

Context Switch - Start CPU Other Regs StkPtr Pgm Ctr Memory Lmt Memory Base Stack Data & Code Stack Data & Code Proc1 Proc2 Int Serv Rout

Context Switch - Int. or Sys Call CPU Other Regs StkPtr Pgm Ctr Memory Lmt Memory Base Stack Data & Code Stack Data & Code Proc1 Proc2 Int Serv Rout

Context Switch - Save State CPU Other Regs StkPtr Pgm Ctr Memory Lmt Memory Base Stack Data & Code Stack Data & Code Proc1 Proc2 Int Serv Rout PCB2 PCB1

Context Switch - Restore State CPU Other Regs StkPtr Pgm Ctr Memory Lmt Memory Base Stack Data & Code Stack Data & Code Proc1 Proc2 Int Serv Rout PCB2 PCB1

Context Switch - Ret from Int or Trap CPU Other Regs StkPtr Pgm Ctr Memory Lmt Memory Base Stack Data & Code Stack Data & Code Proc1 Proc2 Int Serv Rout PCB2 PCB1

Context Switch! Depends on hardware number of registers to save/restore supporting hardware (memory management, etc). hardware support! banks of registers! supporting hardware (cache, TLB, etc.)! System is not doing useful work! overhead of multitasking! 1 to 1000 micro seconds