CS 346 – Chapter 2 OS services –OS user interface –System calls –System programs How to make an OS –Implementation –Structure –Virtual machines Commitment.

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

Operating-System Structures
Operating System Structures
Operating Systems Manage system resources –CPU scheduling –Process management –Memory management –Input/Output device management –Storage device management.
Chap 2 System Structures.
3: OS Structures 1 OPERATING SYSTEM STRUCTURES PROCESS MANAGEMENT A process is a program in execution: (A program is passive, a process active.) A process.
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
Operating Systems High Level View Chapter 1,2. Who is the User? End Users Application Programmers System Programmers Administrators.
UNIX Chapter 01 Overview of Operating Systems Mr. Mohammad A. Smirat.
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
Operating System Structure. Announcements Make sure you are registered for CS 415 First CS 415 project is up –Initial design documents due next Friday,
© 2004, D. J. Foreman 1 CS350 Operating Systems. © 2004, D. J. Foreman 2 Administrivia  Assignments ■ Homework on most chapters ■ Approximately 8 lab.
Operating Systems - Introduction S H Srinivasan
1/28/2004CSCI 315 Operating Systems Design1 Operating System Structures & Processes Notice: The slides for this lecture have been largely based on those.
Cs238 Lecture 3 Operating System Structures Dr. Alan R. Davis.
Silberschatz, Galvin and Gagne  Operating System Concepts Common OS Components Process Management Memory Management File Management I/O System.
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.
Copyright Arshi Khan1 System Programming Instructor Arshi Khan.
Operating Systems. Software Software – the instructions that make the CPU do useful things Divided into two main categories – System software – Applications.
Stack Management Each process/thread has two stacks  Kernel stack  User stack Stack pointer changes when exiting/entering the kernel Q: Why is this necessary?
Virtualization Concepts Presented by: Mariano Diaz.
ICOM Noack Operating Systems - Administrivia Prontuario - Please time-share and ask questions Info is in my homepage amadeus/~noack/ Make bookmark.
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.
Three fundamental concepts in computer security: Reference Monitors: An access control concept that refers to an abstract machine that mediates all accesses.
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.
Introduction 1-1 Introduction to Virtual Machines From “Virtual Machines” Smith and Nair Chapter 1.
CS 346 – Chapter 1 Operating system – definition Responsibilities What we find in computer systems Review of –Instruction execution –Compile – link – load.
INVITATION TO COMPUTER SCIENCE, JAVA VERSION, THIRD EDITION Chapter 6: An Introduction to System Software and Virtual Machines.
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.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Operating System What is an Operating System? A program that acts as an intermediary between a user of a computer and the computer hardware. An operating.
OSes: 3. OS Structs 1 Operating Systems v Objectives –summarise OSes from several perspectives Certificate Program in Software Development CSE-TC and CSIM,
Processes Introduction to Operating Systems: Module 3.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
Examples of Operating Systems.
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.
CENG334 Introduction to Operating Systems 1 Erol Sahin Dept of Computer Eng. Middle East Technical University Ankara, TURKEY URL:
2.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition System Programs (p73) System programs provide a convenient environment.
Chapter 2 Introduction to OS Chien-Chung Shen CIS/UD
Virtual Machines Mr. Monil Adhikari. Agenda Introduction Classes of Virtual Machines System Virtual Machines Process Virtual Machines.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Overview of today’s lecture Major components of an operating system Structure and internal architecture of an operating system Monolithic Vs Micro-kernels.
Introduction to Operating Systems Concepts
Computer System Structures
OPERATING SYSTEM CONCEPTS AND PRACTISE
Module 3: Operating-System Structures
Operating System Structures
Operating System Structure
Lecture 1-Part 2: Operating-System Structures
Operating System Structure
Hierarchical Architecture
What is an Operating System?
Chapter 2: Operating-System Structures
Operating System Concepts
Chapter 2: System Structures
Chapter 3: Operating-System Structures
Chapter 1 Introduction to Operating System Part 5
Outline Chapter 2 (cont) OS Design OS structure
Chapter 2: Operating-System Structures
Introduction to Virtual Machines
System calls….. C-program->POSIX call
Introduction to Virtual Machines
Presentation transcript:

CS 346 – Chapter 2 OS services –OS user interface –System calls –System programs How to make an OS –Implementation –Structure –Virtual machines Commitment –For next day, please finish chapter 2.

OS services 2 types For the user’s convenience –Shell –Running user programs –Doing I/O –File system –Detecting problems Internal/support –Allocating resources –System security –Accounting Infamous KGB spy ring uncovered due to discrepancy in billing of computer time at Berkeley lab

User interface Command line = shell program –Parses commands from user –Supports redirection of I/O (stdin, stdout, stderr) GUI –Pioneered by Xerox PARC, made famous by Mac –Utilizes additional input devices such as mouse –Icons or hotspots on screen Hybrid approach –GUI allowing several terminal windows –Window manager

System calls “an interface for accessing an OS service within a computer program” A little lower level than an API, but similar Looks like a function call Examples –Performing any I/O request, because these are not defined by the programming language itself e.g. read(file_ptr, str_buf_ptr, 80); –assembly languages typically have “syscall” instruction. When is it used? How? If many parameters, they may be put on runtime stack

Types of system calls Controlling a process File management Device management Information Communication between processes What are some specific examples you’d expect to find?

System programs Also called system utilities Distinction between “system call” and “system program” Examples –Shell commands like ls, lp, ps, top –Text editors, compilers –Communication: , talk, ftp –Miscellaneous: cal, fortune –What are your favorites? Higher level software includes: –Spreadsheets, text formatters, etc. –But, boundary between “application” and “utility” software is blurry. A text formatter is a type of compiler!

OS design ideas An OS is a big program, so we should consider principles of systems analysis and software engineering In design phase, need to consider policies and mechanisms –Policy = What should we do; should we do X –Mechanism = how to do X –Example:  a way to schedule jobs (policy) versus: what input needed to produce schedule, how schedule decision is specified (mechanism)

Implementation Originally in assembly Now usually in C (C++ if object-oriented) Still, some code needs to be in assembly –Some specific device driver routines –Saving/restoring registers We’d like to use HLL as much as possible – why? Today’s compilers produce very efficient code – what does this tell us? How to improve performance of OS: –More efficient data structure, algorithm –Exploit HW and memory hierarchy –Pay attention to CPU scheduling and memory management

Kernel structure Possible to implement minimal OS with a few thousand lines of code  monolithic kernel –Modularize like any other large program –After about 10k loc, difficult to prove correctness Layered approach to managing the complexity –Layer 0 is the HW –Layer n is the user interface –Each layer makes use of routines and d.s. defined at lower levels –# layers difficult to predict: many subtle dependencies –Many layers  lots of internal system call overhead 

Kernel structure (2)  kernel –Kernel = minimal support for processes and memory management –(The rest of the OS is at user level) –Adding OS services doesn’t require changing kernel, so easier to modify OS –The kernel must manage communication between user program and appropriate OS services (e.g. file system) –Microsoft gave up on  kernel idea for Windows XP OO Module approach –Components isolated (OO information hiding) –Used by Linux, Solaris –Like a layered approach with just 2 layers, a core and everything else

Virtual machine How to make 1 machine behave like many Give users the illusion they have access to real HW, distinct from other users Figure 2.17 levels of abstraction: –Processes / kernels / VM’s / VM implementations / host HW As opposed to: –Processes / kernels / different machines Why do it? –To test multiple OS’s on the same HW platform –Host machine’s real HW protected from virus in a VM bubble

VM implementation It’s hard! –Need to painstakingly replicate every HW detail, to avoid giving away the illusion –Need to keep track of what each guest OS is doing (whether it’s in kernel or user mode) –Each VM must interpret its assembly code – why? Is this a problem? Very similar concept: simulation –Often, all we are interested in is changing the HW, not the OS; for example, adding/eliminating the data cache –Write a program that simulates every HW feature, providing the OS with the expected behavior