2.1 Silberschatz, Galvin and Gagne ©2009Operating System Concepts with Java – 8 th Edition Chapter 2: Operating-System Structures.

Slides:



Advertisements
Similar presentations
W EEK S IX O PERATING S YSTEM S TRUCTURE. T HE C ONCEPT OF L OADING AND L INKING Loader – Loader is a utility program which takes object code as input,
Advertisements

Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures.
Dr. Kalpakis CMSC 421, Operating Systems Operating-System Structures.
Chap 2 System Structures.
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.
Operating-System Structures
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
Modified from Silberschatz, Galvin and Gagne ©2009 CS 446/646 Principles of Operating Systems Lecture 3 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.
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.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Modified from the text book.
2.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 2: Operating-System Structures.
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 ©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 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.
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.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 6 System Calls OS 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.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 14, 2005 Outline n Operating.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 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.
3.1 Operating System Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual.
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.
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.
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.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Lecture 8 Chapter 2: Operating-System Structures Provided & Updated by Sameer.
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.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures.
Chapter 2: Operating-System Structures
OPERATING SYSTEM CONCEPTS AND PRACTISE
Operating System Structures
Chapter 2: Operating-System Structures
Lecture 4: Operating System Structures
Chapter 2: System Structures
Chapter 2: Operating-System Structures
Chapter 2: Operating-System Structures
Chapter 2: Operating-System Structures
Chapter 2: System Structures
Outline Chapter 2 (cont) OS Design OS structure
System calls….. C-program->POSIX call
Presentation transcript:

2.1 Silberschatz, Galvin and Gagne ©2009Operating System Concepts with Java – 8 th Edition Chapter 2: Operating-System Structures

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

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

2.4 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Parameter Passing via Table

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

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

2.7 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Process Control Issues Loading and executing a program What happens to the existing program?  Lost  Suspended (saved and allowed to continue later)  Run concurrently (needs creation of new process) Control execution of the new program (set priority, set max execution time, terminate)

2.8 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Process Control Issues (Contd.) Waiting for jobs wait time, wait event and signal event Managing shared data acquire lock, release lock, etc. Handling termination process (Normal or abnormal) Taking memory dump Return control to calling process

2.9 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition MS-DOS execution (a) At system startup (b) running a program

2.10 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition FreeBSD Running Multiple Programs

2.11 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition File Management Issues Creating files and directories Deleting files and directories Read and write Reposition Set attributes and get attributes Move and copy Some OSes provide explicit system calls Others provide API which is implemented using other system calls

2.12 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Device Management Issues Physical and virtual resources Request and release devices in multi-user OS Needed to ensure exclusive access to devices Unmanaged access can lead to device contention and deadlocks Read, write, reposition Unix treats devices as files

2.13 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Information Management Issues Transferring information between OS and user programs System time, date, information about users, processes, resources etc. Tracing and debugging programs Dumping, trace, etc. Single step Profiling of programs Get and set of attributes of processes

2.14 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Communication Issues Message passing model exchange between processes on same machine or different machine Needs opening of a connection Host name and process id Open, close, accept connections Daemon processes – waiting on incoming connections

2.15 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Shared Memory Shared memory create Shared memory attach Process inform OS that they want to remove the OS placed restriction about accessing each others memory Modalities of data sharing determined by the processes and not the OS

2.16 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition System Programs System programs 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.17 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition System Programs Provide a convenient environment for program development and execution Some of them are simply user interfaces to system calls; others are considerably more complex File management - Create, delete, copy, rename, print, dump, list, and generally manipulate files and directories Status information Some ask the system for info - date, time, amount of available memory, disk space, number of users Others provide detailed performance, logging, and debugging information Typically, these programs format and print the output to the terminal or other output devices Some systems implement a registry - used to store and retrieve configuration information

2.18 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition System Programs (Cont.) File modification Text editors to create and modify files Special commands to search contents of files or perform transformations of the text Programming-language support - Compilers, assemblers, debuggers and interpreters sometimes provided Program loading and execution- Absolute loaders, relocatable loaders, linkage editors, and overlay-loaders, debugging systems for higher-level and machine language Communications - Provide the mechanism for creating virtual connections among processes, users, and computer systems Allow users to send messages to one another’s screens, browse web pages, send electronic-mail messages, log in remotely, transfer files from one machine to another

2.19 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Operating System Design and Implementation Design and Implementation of OS not “solvable”, but some approaches have proven successful Internal structure of different Operating Systems can vary widely Start by defining goals and specifications User goals and System goals User goals - Should be convenient to use, easy to learn, reliable, safe, and fast System goals - Should be easy to design, implement, and maintain, as well as flexible, reliable, error-free, and efficient Affected by choice of hardware, type of system

2.20 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Mechanism – Policy Separation Policy: What will be done? Mechanism: How to do it? Examples Class attendance credit – card scanner/signup sheet/roll call Time-multiplexing of CPU – Timer construct LRU – Linked list implementation The separation of policy from allows maximum flexibility if policy decisions are to be changed later Solaris Scheduler

2.21 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition OS Implementation Early OSes were written in assembly language Currently most OSes are written in C Advantages of using high-level language Faster, compact Easier to understand, debug and take advantage of compiler optimizations Portable – MS DOS Vs. Unix Possible disadvantage? Performance

2.22 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition OS Structure Describes how the code of the OS is organized Function call, information flow, etc. Not enough thought on structure in early OSes Heavy price - crashes, vulnerabilities, etc. 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.23 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition MS-DOS Layer Structure

2.24 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition OS Structures (Contd.) Monolithic Kernel Layered Structure Micro-Kernel Modular Approach

2.25 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Monolithic Kernel Approach followed by early UNIX Kernel and system programs Kernel is a collection of various sub-systems File system CPU Scheduling Memory management Communications Very hard to maintain Especially modifying or adding new functionality

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

2.27 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Layered Approach OS built as a set of layers Bottom most layer is hardware Top most layer is user interface Each layer can invoke functionalities from layer immediately below it Advantages Easy debugging Information hiding Code modifications are relatively simple Drawbacks Placing routines in layers Less efficient – too many calls across layers and too much data passing

2.28 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Layered Operating System

2.29 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Microkernel System Structure Mach OS by CMU to address problems with monolithic kernel 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 with Java – 8 th Edition Modules Modern OSes 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 Features can be implemented dynamically Overall, similar to layers but with more flexibility

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

2.32 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Hybrid Structure of Mac OS X

2.33 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Virtual Machines VM technology takes layered approach to its logical conclusion Pioneered by IBM CP/CMS in 1967 Abstracts hardware resources into several different executing environment Each environment will be a separate machine A VM provides an interface identical to the underlying bare hardware Guest process is an OS The operating system creates the illusion that it has its own processor and (virtual memory).

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

2.35 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Virtual Machines Benefits Physical machine protected from VMs and VMs protected from one another Virus in a guest OS will not affect the host OS VMS can share files (through file system volume) VMs can also communicate (via virtual network interfaces) Aids in development and testing of OS Eliminates system development time Cloud computing and economies of scale Resource optimization through consolidation

2.36 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Virtual Machines Implementation Difficult to produce exact duplicate of the underlying machine VM software can run in kernel mode. The VMs should execute only in user mode Guest OSes also have user and kernel modes Virtual user mode – virtual kernel mode transitions System calls cause transfer to VM monitor VM monitor changes the register contents and program counter and transfer control back to guest OS VMs can be slow VMs need some level of hardware support

2.37 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Operating-System Debugging Debugging is finding and fixing errors, or bugs. OSes generate log files containing error information. Failure of an application can generate core dump file capturing memory of the process. Operating system failure can generate crash dump file containing kernel memory. Beyond crashes, performance tuning can optimize system performance. Kernighan’s Law: “Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” DTrace tool in Solaris, FreeBSD, Mac OS X allows live instrumentation on production systems. Probes fire when code is executed, capturing state data and sending it to consumers of those probes.

2.38 Silberschatz, Galvin and Gagne ©2009Operating System Concepts with Java – 8 th Edition End of Chapter 2