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

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

Kernel Types System Calls. Operating Systems. Autumn 2013 CS4023

CS3600 SYSTEMS AND NETWORKS

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

Operating System Structures

System Structures. Services Interface Structure

The Plan Today... System Calls and API's Basics of OS design Virtual Machines

OPERATING SYSTEMS STRUCTURES

Lecture 1 Operating System Overview

Example of Standard API

Operating System Structure

CS420: Operating Systems OS Services & System Calls

Operating System Components

Chapter 2 System Structures

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

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

Chapter 3 Operating-System Structures

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

OPERATING SYSTEM SERVICES

CS161: Operating Systems

Chapter 3: Operating-System Structures. Common System Components

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


Operating Systems. Rafael Ramirez (T, S)

COS 318: Operating Systems

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

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

Operating- System Structures

Components of a Computer System

OS Concepts and structure

Operating System Organization. Purpose of an OS

Chapter 6, The Operating System Machine Level

Introduction. System Calls

Operating Systems OS Architecture Models

Overview of Operating Systems Instructor: Dr. Tongping Liu

CPS221 Lecture: Operating System Structure; 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

Operating Systems. Lecture 03. February 11, 2013

Lecture 25 Symbian OS

Operating Systems and Networks

ELEC 377. Operating Systems. Week 1 Class 3

Introduction to Virtual Machines

Operating Systems: Basic Concepts and History

Multi-core Programming System Overview

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

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

ECE 677: Distributed Computing Systems. Distributed Operating Systems: Design Issues Case Studies

Operating System Structures

I/O Device and Drivers

Introduction. What is an Operating System?

Virtualization. Jia Rao Assistant Professor in CS

Full and Para Virtualization

Chapter 2: OS Overview

FAME Operating Systems

Have both hardware and software. Want to hide the details from the programmer (user).

Microkernels, virtualization, exokernels. Tutorial 1 CSC469

Operating System Overview. Otto J. Anshus

Operating System Components and Services

Hoofdstuk 17. Operating systems uit de praktijk

Mobile Operating Systems. Week I

Kernel comparison of OpenSolaris, Windows Vista and. Linux 2.6

CSC 2405: Computer Systems II

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

Real-Time Systems Prof. Dr. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

x86 ISA Modifications to support Virtual Machines

Security Overview of the Integrity Virtual Machines Architecture

Research and Design of Universal and Open Software Development Platform for Digital Home

CHAPTER 1: OPERATING SYSTEM FUNDAMENTALS

Overview of CS 282 & Android

Reminders. Lab opens from today. Many students want to use the extra I/O pins on

Real Time Programming: Concepts

Università Degli Studi di Parma. Distributed Systems Group. Android Development. Lecture 1 Android SDK & Development Environment. Marco Picone

Virtualization. Types of Interfaces

Distributed File Systems

Embedded Systems. 6. Real-Time Operating Systems

Weighted Total Mark. Weighted Exam Mark

Fachbereich Informatik und Elektrotechnik SunSPOT. Ubiquitous Computing. Ubiquitous Computing, Helmut Dispert

Operating System for the K computer

Virtual Machines.

I/O. Input/Output. Types of devices. Interface. Computer hardware

Virtualization for Cloud Computing

Why Threads Are A Bad Idea (for most purposes)

Restraining Execution Environments

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

COS 318: Operating Systems. Virtual Machine Monitors

OSes. Arvind Seshadri Mark Luk Ning Qu Adrian Perrig SOSP2007. CyLab of CMU. SecVisor: A Tiny Hypervisor to Provide

Computer Organisation Operating Systems

1. Computer System Structure and Components

Operating Systems 4 th Class

Going Linux on Massive Multicore

Encryption Wrapper. on OSX

Cloud Computing. Up until now

Developing Applications for ios

12. Introduction to Virtual Machines

Virtual Machine Security

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

Transcription:

Last Class: OS and Computer Architecture System bus Network card CPU, memory, I/O devices, network card, system bus Lecture 3, page 1 Last Class: OS and Computer Architecture OS Service Protection Interrupts System calls I/O Scheduling, error recovery, accounting Synchronization Virtual memory Hardware Support Kernel/user mode, protected instructions, base/limit registers Interrupt vectors Trap instructions and trap vectors Interrupts and memory mapping Timer Atomic instructions Translation look-aside buffers Lecture 3, page 2

Today: OS Structures & Services More on System Calls Introduce the organization and components in an OS. Four example OS organizations Monolithic kernel Layered architecture Microkernel Modular Lecture 3, page 3 Class Exercise ios 7 and iphone 5S iphone 5S first 64-bit smartphone, ios 7 first 64-bit OS iphone 5S has M7 co-processor in addition to main A7 processor Offloads work (primarily sensor data processing) from main CPU to co-processor Critique these design decisions. Benefits? Lecture 3, page 4

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 (including virtually all versions of UNIX, Linux, and Mac OS X), and Java API for the Java virtual machine (JVM) Why use APIs rather than system calls? Lecture 3, page 5 Standard C Library Example C program invoking printf() library call, which calls write() system call k Lecture 3, page 6

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 Lecture 3, page 7 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) Lecture 3, page 8

API System Call OS Relationship Lecture 3, page 9 System Call Parameter Passing Often, more information is required than simply identity of desired system call Exact type and amount of information vary according to OS and call Three general methods used to pass parameters to the OS Simplest: pass the parameters in registers In some cases, may be more parameters than registers Parameters stored in a block, or table, in memory, and address of block passed as a parameter in a register This approach taken by Linux and Solaris Parameters placed, or pushed, onto the stack by the program and popped off the stack by the operating system Block and stack methods do not limit the number or length of parameters being passed Lecture 3, page 10

Examples of Windows and Unix System Calls Lecture 3, page 11 One Basic OS Structure The kernel is the protected part of the OS that runs in kernel mode, protecting the critical OS data structures and device registers from user programs. Debate about what functionality goes into the kernel (above figure: UNIX) - monolithic kernels Lecture 3, page 12

Mac OS X Architecture Lecture 3, page 13 Windows 8 Architecture Lecture 3, page 14

Layered OS design User programs Device drivers Virtual memory I/O channel Cpu scheduler Hardware Layer N: uses layer N-1 and provides new functionality to N+1 Advantages: modularity, simplicity, portability, ease of design/debugging Disadvantage - communication overhead between layers, extra copying, book-keeping, layer design Lecture 3, page 15 Microkernel Small kernel that provides communication (message passing) and other basic functionality other OS functionality implemented as user-space processes Lecture 3, page 16

Microkernel Features Goal: to minimize what goes in the kernel (mechanism, no policy), implementing as much of the OS in User-Level processes as possible. Advantages better reliability, easier extension and customization mediocre performance (unfortunately) First Microkernel was Hydra (CMU '70). Current systems include Chorus (France) and Mach (CMU). Lecture 3, page 17 Mac OS X - hybrid approach Layered system: Mach microkernel (mem, RPC, IPC) + BSD (threads, CLI, networking, filesystem) + user-level services (GUI) Lecture 3, page 18

Modules Most modern operating systems implement kernel modules Uses object-oriented approach Each core component is separate Each talks to the others over known interfaces Each is loadable as needed within the kernel Overall, similar to layers but more flexible Lecture 3, page 19 Solaris Modular Approach Lecture 3, page 20

Summary Big Design Issue: How do we make the OS efficient, reliable, and extensible? General OS Philosophy: The design and implementation of an OS involves a constant tradeoff between simplicity and performance. As a general rule, strive for simplicity except when you have a strong reason to believe that you need to make a particular component complicated to achieve acceptable performance (strong reason = simulation or evaluation study) Lecture 3, page 21 Lecture 3, page 22