1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.

Slides:



Advertisements
Similar presentations
Chap 2 System Structures.
Advertisements

Operating System Structure
Operating-System Structures
3.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 3: Operating-System Structures System Components Operating System.
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.
1/28/2004CSCI 315 Operating Systems Design1 Operating System Structures & Processes Notice: The slides for this lecture have been largely based on those.
1/26/2004CSCI 315 Operating Systems Design1 Operating System Structures Notice: The slides for this lecture have been largely based on those accompanying.
Cs238 Lecture 3 Operating System Structures Dr. Alan R. Davis.
Common System Components
Os31 Chapter 3 Operating-System Structures. os32 Outlines System Components Operating System Services System Calls System Programs System Structure Virtual.
Silberschatz, Galvin and Gagne  Operating System Concepts Common OS Components Process Management Memory Management File Management I/O System.
Introduction Operating Systems’ Concepts and Structure Lecture 1 ~ Spring, 2008 ~ Spring, 2008TUCN. Operating Systems. Lecture 1.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Modified from the text book.
Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Operating System Organization.
Abhinav Kamra Computer Science, Columbia University 3.1 Operating System Concepts Silberschatz, Galvin and Gagne  2002 Chapter 3: 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.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 14, 2005 Operating System.
OS provide a user-friendly environment and manage resources of the computer system. Operating systems manage: –Processes –Memory –Storage –I/O subsystem.
Introduction to Operating Systems Chapter 1. cs431 -cotter2 Lecture Objectives Understand the relationship between computing hardware, 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  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 6 System Calls OS System.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 7 OS System Structure.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: Operating-System Structures.
Silberschatz and Galvin  Operating System Concepts Module 3: Operating-System Structures System Components Operating System Services System Calls.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 2: Operating-System Structures.
Operating Systems David Goldschmidt, Ph.D. Computer Science The College of Saint Rose CIS 432.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.
Operating-System Structures. Operating System Services Operating systems provide an environment for execution of programs and services to programs and.
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.
3.1 Operating System Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual.
Operating Systems Lecture November 2015© Copyright Virtual University of Pakistan 2 Agenda for Today Review of previous lecture Hardware (I/O, memory,
Processes Introduction to Operating Systems: Module 3.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Silberschatz, Galvin and Gagne  Operating System Concepts UNIT II Operating System Services.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 3 Operating-System Structures Slide 1 Chapter 3 Operating-System Structures.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: Operating-System Structures.
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
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  Applied Operating System Concepts Module 3: Operating-System Structures System Components Operating System Services.
Operating System Structure Lecture: - Operating System Concepts Lecturer: - Pooja Sharma Computer Science Department, Punjabi University, Patiala.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Introduction to Operating Systems Concepts
Chapter 2: Operating-System Structures
Computer System Structures
Computer System Structures
OPERATING SYSTEM CONCEPTS AND PRACTISE
Module 3: Operating-System Structures
Operating System Structures
Chapter 2: System Structures
Operating System Structure
Chapter 2: Operating-System Structures
Ch 2 - Overview Interacting with services provided by the OS
Chapter 2: System Structures
Chapter 3: Operating-System Structures
Basic Concepts Protection: Security:
Chapter 2: Operating-System Structures
Operating Systems Lecture 3.
Outline Chapter 2 (cont) OS Design OS structure
Operating Systems: A Modern Perspective, Chapter 3
Chapter 2: Operating-System Structures
System calls….. C-program->POSIX call
Chapter 2: Operating-System Structures
Presentation transcript:

1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system Operating system design

2 System Structure Layered approach –Operating system divided into layers –Higher levels use only services of lower levels –Basic principle of abstract data types (classes) Figure 2.14

3 Original Unix O/S: Kernel approach Figure 2.13, p. 71 “monolithic structure”

4 Monolithic “structure” “an enormous amount of functionality … combined into one level [of abstraction in software]” (p. 71, Our text-- Silberschatz et al.) “… this approach might well be subtitled ‘The Big Mess.’ The structure is that there is no structure. The operating system is written as a collection of procedures, each of which can call any of the other ones whenever it wants to.” (p. 56, Tanenbaum, 2001, Modern Operating Systems, 2nd Ed).

5 Microkernel Approach More like a client-server system Kernel supports message passing –Plus some other low-level services such as interrupt handling, loading device drivers Much of former kernel runs in user mode (not kernel mode) –E.g., file system (server) may run in user mode Mach, QNX operating systems organized this way QNX is “real-time”; small (micro) kernel can be advantageous to real-time systems

6 Mac OS X: “Microkernel” Approach Figure 2.16

7 Solaris: Modular approach “Perhaps the best current methodology for operating-system design involves using object- oriented programming techniques to create a modular kernel” (p. 74) modules are typically dynamically loadable (e.g., Solaris, Linux, Mac OS X) Fig 2.15

Process Interfaces to the System In what we’ve been talking about so far, a process can either execute machine language code or it can make system calls What other kinds of process interfaces are possible? API interface Virtual machine interface 8

9 Virtual Machines Processes provided with an interface identical to the bare hardware Each process is provided with a (virtual) copy of the underlying computer E.g., IBM VM mainframe operating system Devices are an issue –e.g., Disks must be partitioned Each user runs an operating system on their virtual machine –Some instructions may run directly on hardware –Some instructions (e.g., I/O) are interpreted

10 Figure 2.17: System Models Non-virtual Machine Virtual Machine

11 Java Virtual Machine (JVM) Specification for an abstract computer – – Instructions specified as “bytecode”s Architecture neutral Java program code is compiled (javac) into files containing bytecode JVM includes –Class loader –Bytecode verifier –Bytecode interpreter

12 Operating System Design Design goals –User goals E.g., convenient, easy to use –System goals E.g., easy to design, implement, maintain; efficient Mechanism vs. Policy –Mechanisms determine how to do something Provided by the operating system E.g., ability to set the priority of a user process –Policies determine what will be done E.g., determining which processes get highest priority –Separation gives flexibility –See Solaris example p. 69

13 Services User interface Program execution: Processes Resource allocation I/O operations File-system manipulation Communications Protection & security Error detection Accounting Figure 2.1, p. 50 of text

Services - 1 User Interface –GUI and command line are the most common for general purpose operating systems Program execution –System must be able to load a machine language program into RAM memory and run that program –Why machine language? Resource allocation –Multiple processes or users: Need to share, allocate, and manage resources –Examples of types of resources: CPU cycles (time), main memory, files, I/O devices (printers, USB flash drives etc). 14

Services - 2 I/O operations –All I/O that a program does is typically carried out by the O/S –This is for efficiency and protection File-system manipulation –“Obviously, programs [in some operating systems] need to read and write files and directories” (p. 50) Communications –Between processes on the same computer and between processes across different computers –Shared memory & message passing: Two implementations 15

Services - 3 Protection & security –In multiuser systems, some people want to control access to their information –Generally, “when several separate processes execute concurrently, it should not be possible for one process to interfere with others or with the operating system itself” (p. 51) Error detection –“The operating system needs be constantly aware of possible errors” (p. 51) –Hardware errors include: power, memory, device errors –Software errors include: divide by 0, access of an illegal memory location Accounting –Which processes/users use which resources and for how long? –For statistics or for billing 16

17 What is a system call? A means for application programs to access operating system functionality Types of calls –Process control: E.g., create, load, execute –File operations: E.g., create, open, read, write –Device manipulation: E.g., request, read, write –Information: E.g., get or set process attributes –Communications: E.g., create connection, send or receive message

18 Figure 1.10: Transition from User to Kernel Mode

19 System Call Implementation For example? –E.g., file open, close, read or write ① Software interrupt CPU instruction is executed ② Execution control passes to an interrupt service routine in O/S; context switch is required ③ CPU mode bit is set to monitor (kernel) mode ④ Parameters of the software interrupt Indicate the type of system call (e.g., read or write) Parameters to the system call passed in registers, in a block of data, or the user stack ⑤ System call is executed E.g., kernel code runs Process is executing kernel code for duration of system call ⑥ Process is resumed (return from interrupt), back in user mode; context switch is required

20 Procedure Calls vs. System Calls Operating system System Call Return value(s) User process Libraries User process Libraries Procedure call is within the user process address space

21 System Programs Programs that provide system related services –Use operating system calls to provide operating system related functionality E.g., –Network communications such as http servers –File management: directory listing, copying files (cp on Unix) –User interface