Operating System Structures

Similar documents
Example of Standard API

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

System Structures. Services Interface Structure

CPS221 Lecture: Operating System Structure; Virtual Machines

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

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

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

Chapter 2 System Structures

Operating System Structures

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

Kernel Types System Calls. Operating Systems. Autumn 2013 CS4023

Chapter 3: Operating-System Structures. Common System Components

Operating System Components

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

OS Concepts and structure

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

Introduction to Virtual Machines

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

Operating System Structures

Operating Systems OS Architecture Models

Chapter 3 Operating-System Structures

Components of a Computer System

CS3600 SYSTEMS AND NETWORKS

OPERATING SYSTEM SERVICES

CS420: Operating Systems OS Services & System Calls

Operating System Structure


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

ELEC 377. Operating Systems. Week 1 Class 3

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

x86 ISA Modifications to support Virtual Machines

CHAPTER 15: Operating Systems: An Overview

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

Virtual Machines.

CS161: Operating Systems

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

Operating System Organization. Purpose of an OS

Operating System Software

Virtualization. Types of Interfaces

OPERATING SYSTEMS STRUCTURES

Lesson 06: Basics of Software Development (W02D2

Operating System Components and Services

Operating Systems 4 th Class

Operating System Overview. Otto J. Anshus

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

12. Introduction to Virtual Machines

Virtualization for Cloud Computing

Operating Systems (Linux)

COS 318: Operating Systems

Multi-core Programming System Overview

Project Adding a System Call to the Linux Kernel

OPERATING SYSTEMS Software in the Background. Chapter 2

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

Microkernels, virtualization, exokernels. Tutorial 1 CSC469

JavaPOS TM FAQ. What is an FAQ? What is JavaPOS?

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

GETTING STARTED WITH ANDROID DEVELOPMENT FOR EMBEDDED SYSTEMS

Comparing Virtualization Technologies

General Introduction

Section 1.4. Java s Magic: Bytecode, Java Virtual Machine, JIT,

VMware Server 2.0 Essentials. Virtualization Deployment and Management

Understanding the OS Architecture and Linux History. Zhiqiang Lin

Software systems and issues

Overview of Operating Systems Instructor: Dr. Tongping Liu

Characteristics of Java (Optional) Y. Daniel Liang Supplement for Introduction to Java Programming

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

Code Injection From the Hypervisor: Removing the need for in-guest agents. Matt Conover & Tzi-cker Chiueh Core Research Group, Symantec Research Labs

Operating Systems OBJECTIVES 7.1 DEFINITION. Chapter 7. Note:

INTRODUCTION TO OPERATING SYSTEMS

Porting Plan 9 to the PowerPC Architecture. Ian Friedman Ajay Surie Adam Wolbach

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

1/5/2013. Technology in Action

9/26/2011. What is Virtualization? What are the different types of virtualization.

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

(Advanced Topics in) Operating Systems

ReactOS is (not) Windows. Windows internals and why ReactOS couldn t just use a Linux kernel

Virtualization and the U2 Databases

Virtual Machines. Virtualization

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

Chapter 8 Operating Systems and Utility Programs

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

Virtual machines and operating systems

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

Virtualization Technology

FRONT FLYLEAF PAGE. This page has been intentionally left blank

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

Computers: Tools for an Information Age

Virtualization. Introduction to Virtualization Virtual Appliances Benefits to Virtualization Example Virtualization Products

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

Jonathan Worthington Scarborough Linux User Group

An Overview of Virtual Machine Architectures

Virtual Machine Security

Operating Systems. Study this screen display and answer these questions.

KVM: A Hypervisor for All Seasons. Avi Kivity avi@qumranet.com

Cloud Computing. Up until now

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

Introduction. General Course Information. Perspectives of the Computer. General Course Information (cont.)

What is a programming language?

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

Transcription:

Operating System Structures While process management, memory management, file systems, and I/O provide an idea of what an operating system does (its verbs), additional concepts help define what an operating system is made of (its nouns) Three different perspectives for these concepts: users programmers operating system designers user interface, programs ( system programs, system utilities, application programs ) application programming interfaces (APIs), system calls mechanisms, policies, layers, microkernels, modules, virtual machines User Interfaces to Operating Systems Command interpreter or shell Text-driven, command-response interface style A shell is ultimately just a program, so there may be more than one Two variations: embed system calls in shell, or separate all system calls as external programs (keeps the shell small, and protects it from operating system changes) Graphical user interface Menu-driven and/or direct manipulation interface style Also just a program, so there may also be more than one GUI environment available In many cases, both UI types are provided; really an orthogonal issue to the operating system itself

Programs: System, Utility, Application Primarily an end-user distinction; they re all the same to the operating system Application programs generally refer to the programs that directly perform the work that we need to do: e-mail, Web browsing, document creation, etc. When a program s work involves something on the computer itself, it may be viewed as a system utility Finally, programs whose functions correspond most directly with an operating system s underlying services may be viewed as system programs APIs and System Calls Beneath the programs that end-users run are application programming interfaces (APIs) functions that the programs developers invoke APIs themselves are implemented by another layer of developers; ultimately, they invoke an OS s system calls APIs hide system call-specific details from your average programmer; they keep semantics at the level of the programming language and may facilitate portability (e.g., standard C interfaces), but not always (e.g., Windows APIs) System calls define the direct programming interface to operating system services, and form the boundary between user and kernel modes

Operating System Design and Implementation In the end, operating systems are software programs, and are as subject to good software engineering practices and principles as any other program Interesting side reading: The Art of Unix Programming by Eric S. Raymond (http://www.faqs.org/docs/artu) Also notable: The Mythical Man-Month by Frederick P. Brooks (primarily about the software development process, but the software in question is an operating system, IBM s OS/360) Mechanisms and Policies A mechanism defines how something is done; a policy states what is actually done General principle: separate mechanism from policy; or, allow for a single mechanism to support the widest possible range of policies (i.e., a change in policy should not necessitate a change in mechanism) Good principle to follow in all software design, but particularly important in operating systems Yet another way: separate the interface (policy) from the engine (mechanism)

Operating System Implementation Originally machine or assembly language Feasible these days in a higher-level language, such as C or C++ allows for (potentially) better portability and improvements based on compiler technology C and C++ have reigned for quite a while; some research has involved going beyond these languages (Java for native object-orientation, Haskell for the benefits of functional languages) Subject to possible inefficiencies; frequently coupled with changes at the hardware level Interesting Operating System Language Choices Or, neither assembly nor C/C++ :) Operating System Implementation Era Master Control Program (MCP) ESPOL (ALGOL variant) 1960s Multics PL/1 1960s 1980s Hello Standard ML 1999 (master s thesis) House, Osker Haskell present (research)

Overall Operating System Structure The usual rules apply: we want easy modification, robust operation, and efficiency (speed) Simplest case first: monolithic structure (MS-DOS, early Unix versions) Hardware below, programs above, no other distinctions in between MS-DOS (and other early PC operating systems) had it even worse hardware didn t support dual-mode operation, so many protections taken for granted today weren t even available Layered Approach Strict separation of functions and data structures; layer zero represents the hardware Each layer may only call functions and use data structures from itself and the layers below it Benefits: the usual good things that come from abstraction, information hiding, and isolation Drawbacks: strict top-down approach makes the actual layers hard to define cyclic dependencies between functions must be avoided or else layer separation can t be done; possible efficiency issues as well

Microkernels Minimalist approach to the kernel include only what is absolutely necessary, and everything else is a program in user space Introduced by CMU in the Mach operating system Services communicate using message passing Benefits: ease of OS extension and porting; somewhat enhanced security because more code is in user space Drawbacks: performance issues due to increased overhead (message passing, fine-grained separation) Modules Current best-of-both-worlds approach, particularly for existing Unix derivatives such as Solaris, Linux, and Mac OS X (Darwin) What matters is the abstraction: module-based kernels publish well-defined interfaces to their services Developers expand kernel functionality by adding modules that plug into the relevant interfaces Solaris: 7 types of loadable modules Mac OS X (Darwin): Mach microkernel is actually one of the components inside the kernel

Virtual Machines The ultimate abstraction: a user-mode program that runs an operating system kernel Device drivers in the virtual machine actually connect to hardware abstractions provided by the virtual machine software; for example, a disk drive in the virtual machine may map to a file in the physical host Dual-mode simulation: virtual user and kernel modes that are both in user mode on the physical host Virtual environment may go as far as translating machine instructions, but not necessarily Notable Virtual Machine Implementations VMware: x86 virtual machine supporting multiple operating systems User Mode Linux: Runs Linux kernel as a user process VirtualPC: x86 virtual machine on Mac OS X, all the way down to the CPU; translates PowerPC instructions to x86, but provides some PowerPC-native implementations of some functions Java: special bytecode format to represent code, with a just-in-time (JIT) compiler translating into native code

Operating System Generation and System Boot In the end, operating systems are ultimately sets of files, built from source code Installation sometimes requires customization, based on the installation target s hardware and devices A restart (warm or cold) points the CPU to start executing from a predetermined location For large, general purpose OSes, this initial program is a bootstrap program or loader (e.g., BIOS, OpenFirmware, EFI [Extensible Firmware Interface]) that locates the rest of the OS in secondary storage and loads/runs it, usually from a known boot block In other systems, the predetermined start location is the start of the operating system s code (firmware); other variations include booting off the network Exercise: Build an Operating System Kernel It s easier than you think! Easily obtainable kernel sources: Linux (of course) XNU (a Mach/BSD kernel; a.k.a. the Darwin or Mac OS X kernel) In addition to the sources, you will need: developer tools (compile/make) and instructions Finally, note how it s just the beginning many more files are involved before you have a full OS