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

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

Chapter 2: Operating-System Structures

CHAPTER 2: SYSTEM STRUCTURES. By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

Operating System Services. User Services. System Operation Services. User Operating System Interface - CLI. A View of Operating System Services

Chapter 2. Operating-System Structures

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

Four Components of a Computer System

Chapter 2: System Structures

Chapter 2: Operating-System Structures

Chapter 2: Operating-System Structures

Chapter 2 Operating System Structures

Chapter 2: Operating-System Structures. Operating System Concepts Essentials 8 th Edition

Chapter 2: Operating-System

Chapter 2: OS Structures

Chapter 2: Operating-System Structures

CSE 4/521 Introduction to Operating Systems

Chapter 2: System Structures

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

Operating-System Structures

Chapter 2: Operating-System Structures

Operating-System Structures

Architectural Support for Operating Systems. Jinkyu Jeong ( Computer Systems Laboratory Sungkyunkwan University

Often, more information is required when designing system call Information varies according to OS and types of system call

Chapter 2: Operating-System Structures. Chapter 2: Operating-System Structures. Objectives. Operating System Services

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy

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

CS307: Operating Systems

Structure of OS. After knowing a bit of OS Review of different computing environment

What are some common categories of system calls? What are common ways of structuring an OS? What are the principles behind OS design and

Chapter 2 Operating-System Structures

TDDI04, K. Arvidsson, IDA, Linköpings universitet Operating System Structures. Operating System Structures Overview. Operating System Services

Introduction to Operating Systems (Part III)

Operating System Structure

Objectives. Chapter 2: Operating-System Structures. 2.1 Operating System Services

Chapter 1: Introduction

Kernel Types Simple OS Examples System Calls. Operating Systems. Autumn CS4023

The Slide does not contain all the information and cannot be treated as a study material for Operating System. Please refer the text book for exams.

OS Design Approaches. Roadmap. OS Design Approaches. Tevfik Koşar. Operating System Design and Implementation

OS Structures. ICS332 Operating Systems

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

CSC Operating Systems Fall Lecture - II OS Structures. Tevfik Ko!ar. Louisiana State University. August 27 th, 2009.

Announcements. Computer System Organization. Roadmap. Major OS Components. Processes. Tevfik Ko!ar. CSC Operating Systems Fall 2009

CSC Operating Systems Spring Lecture - II OS Structures. Tevfik Ko!ar. Louisiana State University. January 17 th, 2007.

Announcements. Operating System Structure. Roadmap. Operating System Structure. Multitasking Example. Tevfik Ko!ar

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

OPERATING SYSTEMS. Prescribed Text Book Operating System Principles, Seventh Edition By Abraham Silberschatz, Peter Baer Galvin and Greg Gagne

Chapter 3: Operating-System Structures

Operating Systems. Operating System Structure. Lecture 2 Michael O Boyle

Roadmap. Tevfik Koşar. CSE 421/521 - Operating Systems Fall Lecture - II OS Structures. University at Buffalo. OS Design and Implementation

OS Design Approaches. Roadmap. System Calls. Tevfik Koşar. Operating System Design and Implementation. CSE 421/521 - Operating Systems Fall 2013

OS and Computer Architecture. Chapter 3: Operating-System Structures. Common System Components. Process Management

Full file at

Operating System Architecture. CS3026 Operating Systems Lecture 03

Module 3: Operating-System Structures

Last class: OS and Architecture. OS and Computer Architecture

Last class: OS and Architecture. Chapter 3: Operating-System Structures. OS and Computer Architecture. Common System Components

Chapter 3: Operating-System Structures

Lecture 2 Operating System Structures (chapter 2)

CS420: Operating Systems. OS Services & System Calls

Operating System: Chap2 OS Structure. National Tsing-Hua University 2016, Fall Semester

Operating- System Structures

Chapter 3: Operating-System Structures

Operating-System Structures

Module 3: Operating-System Structures. Common System Components

Operating System Concepts Ch. 2: Operating System Structures

Operating System Structure

Operating System Structure

Lecture 2 - Fundamental Concepts

ELEC 377 Operating Systems. Week 1 Class 2

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

Introduction to PC Operating Systems

UNIT 2. OPERATING SYSTEM STRUCTURES

CS370 Operating Systems

! Software ( kernel ) that runs at all times. ! OS performs two unrelated functions: Maria Hybinette, UGA. user! 1! Maria Hybinette, UGA. user! n!

NON SCHOLAE, SED VITAE

Chapter 2. Operating System Structures

CS 300 Leftovers. CS460 Pacific University 1

L4/Darwin: Evolving UNIX. Charles Gray Research Engineer, National ICT Australia

CS 550 Operating Systems Spring Operating Systems Overview

IJRDTM Kailash ISBN No Vol.17 Issue

An Introduction to Android. Jason Chen Developer Advocate Google I/O 2008

Operating-System Structures

CSC 453 Operating Systems

INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY

OPERATING SYSTEMS Lecture Notes. Prepared by K.Rohini, Assistant Professor, CSE Department, GVPCEW.

Module 1 Introduction/OS Overview

Fall 2015 COMP Operating Systems. Lab #3

ios vs Android By: Group 2

Lecture 1 Introduction to Android. App Development for Mobile Devices. App Development for Mobile Devices. Announcement.

CS 390 Chapter 2 Homework Solutions

What we saw. Desarrollo de Aplicaciones en Red. 1. OS Design. 2. Service description. 1.1 Operating System Service (1)

Chapter 2: Operating-System Structures

Processes and Threads

Chapter 4: Threads. Chapter 4: Threads. Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues

Android App Development. Muhammad Sharjeel COMSATS Institute of Information Technology, Lahore

Chapter 3: Processes. Operating System Concepts 9 th Edit9on

CSCI 6730 / 4730 Operating Systems. Key Questions in System Design. Review: What is An Operating System? Key Points

EEE 435 Principles of Operating Systems

Developing Applications for ios

CSE Opera+ng System Principles

Transcription:

Chapter 2: Operating-System Structures Operating System Concepts 9 th Edit9on Silberschatz, Galvin and Gagne 2013

Chapter 2: Operating-System Structures 1. Operating System Services 2. User Operating System Interface 3. System Calls 4. Types of System Calls 5. System Programs 6. Operating System Design and Implementation 7. Operating System Structure 8. Operating System Debugging 9. Operating System Generation 10. System Boot 2 Silberschatz, Galvin and Gagne 2013

2.6 OPERATING-SYSTEM DESIGN AND IMPLEMENTATION 3 Silberschatz, Galvin and Gagne 2013

2.6.1 Design Goals Design and Implementation of OS not solvable, but some approaches have proven successful Internal structure of different Operating Systems can vary widely Start the design by defining goals and specifications Affected by choice of hardware, type of system User goals and System goals User goals operating system should be convenient to use, easy to learn, reliable, safe, and fast no general agreement on how to achieve them. System goals operating system should be easy to design, implement, and maintain, as well as flexible, reliable, error-free, and efficient vague and may be interpreted in various ways no unique solution Specifying and designing an OS is highly creative task of software engineering 4 Silberschatz, Galvin and Gagne 2013

2.6.2 Mechanisms and Policies Important principle to separate Policy: What will be done? Mechanism: How to do it? Mechanisms determine how to do something, policies decide what will be done The separation of policy from mechanism is a very important principle, it allows maximum flexibility if policy decisions are to be changed later (example timer) Microkernel-based operating systems (Section 2.7.3) take the separation of mechanism and policy to one extreme by implementing a basic set of primitive building blocks. UNIX almost policy free At first, a time-sharing scheduler Solaris - scheduling is controlled by loadable tables. Policy decisions are important 5 Silberschatz, Galvin and Gagne 2013

2.6.3 Implementation Much variation Early OSes in assembly language Then system programming languages like Algol, PL/1 Now C, C++ Actually usually a mix of languages Lowest levels in assembly Main body in C Systems programs in C, C++, scripting languages like PERL, Python, shell scripts More high-level language easier to port to other hardware (MS-DOS vs. LINUX) disadvantages reduced speed and increased storage requirements Emulation can allow an OS to run on non-native hardware modern compiler can perform complex analysis and apply sophisticated optimizations that produce excellent code major performance improvements are more likely to be the result of better data structures and algorithms than of excellent assembly-language code 6 Silberschatz, Galvin and Gagne 2013

2.7 OPERATING-SYSTEM STRUCTURE 7 Silberschatz, Galvin and Gagne 2013

Operating System Structure General-purpose OS is very large program A system as large and complex must be engineered carefully if it is to function properly and be modified easily. A common approach is to partition the task into small components, or modules, rather than have one monolithic system Various ways to structure ones Simple structure MS-DOS More complex -- UNIX Layered an abstrcation Microkernel -Mach 8 Silberschatz, Galvin and Gagne 2013

2.7.1 Simple Structure MS-DOS written to provide the most functionality in the least space Not divided into modules Although MS-DOS has some structure, its interfaces and levels of functionality are not well separated 9 Silberschatz, Galvin and Gagne 2013

Simple Structure - the original UNIX UNIX limited by hardware functionality, the original UNIX operating system had limited structuring. The UNIX OS consists of two separable parts Systems programs The kernel Consists of everything below the system-call interface and above the physical hardware Provides the file system, CPU scheduling, memory management, and other operating-system functions; a large number of functions for one level 10 Silberschatz, Galvin and Gagne 2013

Traditional UNIX System Structure Beyond simple but not fully layered 11 Silberschatz, Galvin and Gagne 2013

2.7.2 Layered Approach The operating system is divided into a number of layers (levels), each built on top of lower layers. The bottom layer (layer 0), is the hardware; the highest (layer N) is the user interface. With modularity, layers are selected such that each uses functions (operations) and services of only lower-level layers Main advantage simplicity of construction and debugging Major difficulty appropriately defining the various layers Problem be less efficient than other types passing parameters a small backlash fewer layers with more functionality 12 Silberschatz, Galvin and Gagne 2013

2.7.3 Microkernels Moves as much from the kernel into user space Mach example of microkernel Mac OS X kernel (Darwin) partly based on Mach Communication takes place between user modules using message passing Benefits: Easier to extend a microkernel Easier to port the operating system to new architectures More reliable (less code is running in kernel mode) More secure Detriments: Performance overhead of user space to kernel space communication 13 Silberschatz, Galvin and Gagne 2013

Microkernel System Structure Application Program File System Device Driver user mode messages messages Interprocess Communication memory managment CPU scheduling kernel mode microkernel hardware 14 Silberschatz, Galvin and Gagne 2013

2.7.4 Modules Many modern operating systems implement loadable 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 with more flexible because any module can call any other module similar to the microkernel approach but more efficient because modules do not need to invoke message passing to communicate Linux, Solaris, etc 15 Silberschatz, Galvin and Gagne 2013

Solaris Modular Approach 16 Silberschatz, Galvin and Gagne 2013

2.7.5 Hybrid Systems Most modern operating systems are actually not one pure model Hybrid combines multiple approaches to address performance, security, usability needs Linux and Solaris kernels in kernel address space, so monolithic, plus modular for dynamic loading of functionality Windows mostly monolithic, plus microkernel for different subsystem personalities 17 Silberschatz, Galvin and Gagne 2013

2.7.5.1 Mac OS X Apple Mac OS X hybrid, layered, Aqua UI plus Cocoa programming environment Below is kernel consisting of Mach microkernel and BSD Unix parts, plus I/O kit and dynamically loadable modules (called kernel extensions) graphical user interface Aqua application environments and services Java Cocoa Quicktime BSD kernel environment Mach BSD I/O kit kernel extensions 18 Silberschatz, Galvin and Gagne 2013

2.7.5.2 ios Apple mobile OS for iphone, ipad Structured on Mac OS X, added functionality Does not run OS X applications natively Also runs on different CPU architecture (ARM vs. Intel) Cocoa Touch Objective-C API for developing apps Media services layer for graphics, audio, video Core services provides cloud computing, databases Core operating system, based on Mac OS X kernel 19 Silberschatz, Galvin and Gagne 2013

2.7.5.3 Android Developed by Open Handset Alliance (mostly Google) Open Source Similar stack to IOS Based on Linux kernel but modified Provides process, memory, device-driver management Adds power management Runtime environment includes core set of libraries and Dalvik virtual machine Apps developed in Java plus Android API Java class files compiled to Java bytecode then translated to executable than runs in Dalvik VM Libraries include frameworks for web browser (webkit), database (SQLite), multimedia, smaller libc 20 Silberschatz, Galvin and Gagne 2013

Android Architecture Applications Application Framework SQLite surface manager webkit Libraries opengl media framework libc Android runtime Core Libraries Dalvik virtual machine Linux kernel 21 Silberschatz, Galvin and Gagne 2013

2.8 OPERATING-SYSTEM DEBUGGING 22 Silberschatz, Galvin and Gagne 2013

2.8.1 Failure Analysis Debugging is finding and fixing errors, or bugs OS generate log files containing error information Failure of an application can generate core dump file capturing memory of the process Operating-system kernel debugging is even more complex because of the size and complexity of the kernel, its control of the hardware, and the lack of user-level debugging tools. Operating system failure can generate crash dump file containing kernel memory Kernighan s Law: Debugging is twice as hard as writing the code in th e first place. Therefore, if you write the code as cleverly as possible, yo u are, by definition, not smart enough to debug it. 23 Silberschatz, Galvin and Gagne 2013

2.8.2 Performance Tuning Beyond crashes, performance tuning can optimize system performance Sometimes using trace listings of activities, recorded for analysis Profiling is periodic sampling of instruction pointer to look for statistical trends Improve performance by removing bottlenecks OS must provide means of computing and displaying measures of system behavior For example, top program or Windows Task Manager 24 Silberschatz, Galvin and Gagne 2013

2.8.3 DTrace DTrace tool in Solaris, FreeBSD, Mac OS X allows live instrumentation on production systems Probes fire when code is executed within a provider, capturing state data and sending it to consumers of those probes Example of following XEventsQueued system call move from libc library to kernel and back 25 Silberschatz, Galvin and Gagne 2013

Dtrace (Cont.) DTrace code to record amount of time each process with UserID 101 is in running mode (on CPU) in nanoseconds 26 Silberschatz, Galvin and Gagne 2013

2.9 OPERATING-SYSTEM GENERATION 27 Silberschatz, Galvin and Gagne 2013

Operating System Generation Operating systems are designed to run on any of a class of machines; the system must be configured for each specific computer site SYSGEN program obtains information concerning the specific configuration of the hardware system Used to build system-specific compiled kernel or system-tuned Can general more efficient code than one general kernel 28 Silberschatz, Galvin and Gagne 2013

2.10 SYSTEM BOOT 29 Silberschatz, Galvin and Gagne 2013

System Boot When power initialized on system, execution starts at a fixed memory location Firmware ROM used to hold initial boot code Operating system must be made available to hardware so hardware can start it Small piece of code bootstrap loader, stored in ROM or EEPROM locates the kernel, loads it into memory, and starts it Sometimes two-step process where boot block at fixed location loaded by ROM code, which loads bootstrap loader from disk Common bootstrap loader, GRUB, allows selection of kernel from multiple disks, versions, kernel options Kernel loads and system is then running 30 Silberschatz, Galvin and Gagne 2013

End of Chapter 2 Operating System Concepts 9 th Edit9on Silberschatz, Galvin and Gagne 2013