Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Modified from the text book.

Slides:



Advertisements
Similar presentations
Chap 2 System Structures.
Advertisements

Operating-System Structures
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: Operating-System Structures.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 2: Operating-System Structures Operating.
3.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 3: Operating-System Structures System Components Operating System.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 14, 2005 Chapter 2: Operating-System.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Lecture 2: OS Programming Interface T.Yang, CS
Silberschatz, Galvin and Gagne ©2007 Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Chapter 2: Operating-System Structures.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 2: Operating-System Structures Operating.
1/21/2008CSCI 315 Operating Systems Design1 Operating System Structures Notice: The slides for this lecture have been largely based on those accompanying.
Chapter 2: Operating-System Structures
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 14, 2005 Chapter 2 Outline.
1/28/2004CSCI 315 Operating Systems Design1 Operating System Structures & Processes Notice: The slides for this lecture have been largely based on those.
Silberschatz, Galvin and Gagne ©2007 Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Chapter 2: Operating-System Structures.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 2: Operating-System Structures.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
Abhinav Kamra Computer Science, Columbia University 3.1 Operating System Concepts Silberschatz, Galvin and Gagne  2002 Chapter 3: Operating-System Structures.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: Operating-System Structures.
2.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 2: Operating-System Structures.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 2: Operating-System Structures.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 14, 2005 Operating System.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 2: Operating-System Structures Operating.
Silberschatz, Galvin and Gagne ©2009 Edited by Khoury, 2015 Operating System Concepts – 9 th Edition, Chapter 2: Operating-System Structures.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 1: Introduction.
Chapter 2: Operating-System Structures Adapted to COP4610 by Robert van Engelen.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 2: Operating-System Structures Operating.
Chapter 2: System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Chapter 2: System Structures Operating System Services.
2.1 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 2: Operating-System Structures Overview of topics covered Operating System Services.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Operating System Services One set of operating-system.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures T.Yang, 2012 Partially based on the.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: Operating-System Structures.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 2: Operating-System Structures.
3.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 3: Operating-System Structures System Components Operating System.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 3: Operating-System Structures System Components Operating System Services.
3.1 Operating System Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual.
Operating Systems Structure what is the organizational principle?
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures.
Shan Gao Fall 2007 Department of Computer Science Georgia State University.
Silberschatz, Galvin and Gagne  Operating System Concepts UNIT II Operating System Services.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 14, 2005 Chapter 2: Operating-System.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: Operating-System Structures.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 2: Operating-System Structures Operating.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System.
1.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Lecture 2: OS Structures (Chapter 2.7)
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: Operating-System Structures.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: Operating-System Structures.
2.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition System Programs (p73) System programs provide a convenient environment.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: System Structures.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 2: Operating-System Structures Operating.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 2: Operating-System Structures Operating.
2.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Chapter 2: System Structures To describe the services an operating system provides.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Chapter 2: Operating-System Structures
OPERATING SYSTEM CONCEPTS AND PRACTISE
Operating System Structures
Lecture 4: Operating System Structures
Chapter 2: Operating-System Structures
Ch 2 - Overview Interacting with services provided by the OS
Chapter 2: System Structures
Outline Chapter 2 (cont) OS Design OS structure
Chapter 2: Operating-System Structures
System calls….. C-program->POSIX call
Presentation transcript:

Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Modified from the text book

2.2 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Operating System Services & User OS Interface System Calls System Programs (System utilities) Operating System Design and Implementation Virtual Machines

2.3 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Operating System Services One set of operating-system services provides functions that are helpful to the user: User interface - Almost all operating systems have a user interface (UI).  Varies between Command-Line (CLI), Graphics User Interface (GUI), Batch Program execution - The system must be able to load a program into memory and to run that program, end execution, either normally or abnormally (indicating error). I/O operations - A running program may require I/O, which may involve a file or an I/O device. File-system manipulation - The file system is of particular interest. Obviously, programs need to read and write files and directories, create and delete them, search them, list file Information, permission management.

2.4 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition A View of Operating System Services

2.5 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Linux Layers

2.6 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Transition from User to Kernel Mode

2.7 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition UI: Shell Command Interpreter

2.8 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition GUI

2.9 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition API – System Call – OS Relationship

2.10 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Standard C Library Example C program invoking printf() library call, which calls write() system call

2.11 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition System Calls 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?

2.12 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition System Calls 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? Portability. Simplicity.

2.13 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Types of System Calls Process control File management Device management Information maintenance Communications Protection

2.14 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Examples of Windows and Unix System Calls

2.15 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Unix I/O Calls n fileHandle = open(pathName, flags) A file handle is a small integer, valid only within a single process, to operate on the device or file Pathname: a name in the file system. In unix, devices are put under /dev. E.g. /dev/ttya is the first serial port, /dev/sda the first SCSI drive Flags: read only, read/write, append etc… Mode may be added as the third argument for file permission n errorCode = close(fileHandle) Kernel will free the data structures associated with the device

2.16 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Unix I/O Calls n byteCount = read(fileHandle, buf, count) Read at most count bytes from the device and put them in the byte buffer buf. Bytes placed from 0 th byte. Kernel can give the process fewer bytes, user process must check the byteCount to see how many were actually returned. A negative byteCount signals an error (value is the error type) n byteCount = write(fileHandle, buf, count) Write at most count bytes from the buffer buf Actual number written returned in byteCount A negative byteCount signals an error

2.17 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition System Programs/Utilities System programs/utitilies provide a convenient environment for program development and execution. The can be divided into: File manipulation Status information File modification Programming language support Program loading and execution Communications Application programs Most users’ view of the operation system is defined by system programs, not the actual system calls

2.18 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Linux Utility Programs (1) Categories of utility programs: File and directory manipulation commands. Filters. Program development tools, such as editors and compilers. Text processing. System administration. Miscellaneous.

2.19 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Linux Utility Programs (2)

2.20 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Operating System Design and Implementation Design and Implementation of OS: some approaches have proven successful Start by defining goals and specifications Affected by choice of hardware, type of system  User goals – convenient to use, easy to learn, reliable, safe, and fast  System goals – easy to design, implement, and maintain, as well as flexible, reliable, error-free, and efficient Important principle: separate policy and mechanism. Policy: What will be done Mechanism: How to do it Why?

2.21 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Operating System Design and Implementation Design and Implementation of OS: some approaches have proven successful Start by defining goals and specifications Affected by choice of hardware, type of system  User goals – convenient to use, easy to learn, reliable, safe, and fast  System goals – easy to design, implement, and maintain, as well as flexible, reliable, error-free, and efficient Important principle: separate policy and mechanism. Policy: What will be done Mechanism: How to do it Why? allows maximum flexibility

2.22 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition OS Design Principles Separate policy (what to do) and mechanism (how to do) Layered structure Module Monolithic kernel vs. Microkernel

2.23 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition 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

2.24 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition MS-DOS: Simple Layer 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

2.25 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Traditional UNIX System Structure

2.26 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition 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 with more flexible

2.27 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Solaris Modular Approach

2.28 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition 28 Monolithic Kernel vs. Microkernel

2.29 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Microkernel System Structure Moves as much from the kernel into “user” space 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

2.30 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Mac OS X Structure

2.31 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Virtual Machines A virtual machine takes the layered approach to its logical conclusion. It treats hardware and the operating system kernel as though they were all hardware. A virtual machine provides an interface identical to the underlying bare hardware. The operating system host creates the illusion that a process has its own processor and (virtual memory). Each guest provided with a (virtual) copy of underlying computer.

2.32 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Virtual Machines (Cont.) (a) Nonvirtual machine (b) virtual machine

2.33 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition VMware Architecture

2.34 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition The Java Virtual Machine

2.35 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Android