An Introduction to Operating Systems

Slides:



Advertisements
Similar presentations
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 3 Operating System Organization.
Advertisements

1 OS Structure, Processes & Process Management. 2 Recap OS functions  Coordinator  Protection  Communication  Resource management  Service provider.
Winter 2005 CMPE 151: Network Administration Lecture 2.
Operating Systems High Level View Chapter 1,2. Who is the User? End Users Application Programmers System Programmers Administrators.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
Operating System Design. Today’s Lectures I/O subsystem and device drivers Interrupts and traps Protection, system calls and operating mode OS structure.
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.
OS Spring’03 Introduction Operating Systems Spring 2003.
Operating Systems - Introduction S H Srinivasan
Figure 1.1 Interaction between applications and the operating system.
Introduction Operating Systems’ Concepts and Structure Lecture 1 ~ Spring, 2008 ~ Spring, 2008TUCN. Operating Systems. Lecture 1.
Operating System Organization
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Operating System Organization.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
Protection and the Kernel: Mode, Space, and Context.
Chapter 6 Operating System Support. This chapter describes how middleware is supported by the operating system facilities at the nodes of a distributed.
WEEK 1 COURSE INTRODUCTION INTRODUCTION TO OPERATING SYSTEMS OPERATING SYSTEM STRUCTURES Operating Systems CS3013 / CS502.
Architecture Support for OS CSCI 444/544 Operating Systems Fall 2008.
 Create an abstract machine environment  A nicer environment than bare hardware  Consists of multiple, autonomous abstract components  Components.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: Operating-System Structures.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview Part 2: History (continued)
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.
Chapter 1: Introduction and History  Where does the operating system fit in a computing system?  What does the operating system achieve?  What are the.
Processes Introduction to Operating Systems: Module 3.
1 CSE451 Architectural Supports for Operating Systems Autumn 2002 Gary Kimura Lecture #2 October 2, 2002.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
CSE 451: Operating Systems Winter 2015 Module 25 Virtual Machine Monitors Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Virtualization Neependra Khare
Introduction to Operating Systems Concepts
Computer System Structures
Virtual Machine Monitors
Operating System & Application Software
Kernel Design & Implementation
Operating System Structure
2. OPERATING SYSTEM 2.1 Operating System Function
Operating System Structure
Introduction to Operating System (OS)
Chapter 3: Windows7 Part 1.
OS Organization.
Chapter 33: Virtual Machines
Basic Concepts Protection: Security:
Lecture Topics: 11/1 General Operating System Concepts Processes
Threads Chapter 4.
Computer Security: Art and Science, 2nd Edition
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
CSE 451: Operating Systems Autumn Module 24 Virtual Machine Monitors
Operating Systems: A Modern Perspective, Chapter 3
CSE 451: Operating Systems Winter 2007 Module 2 Architectural Support for Operating Systems Brian Bershad 562 Allen Center 1.
OS Organization.
Implementing Processes, Threads, and Resources
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
Outline Operating System Organization Operating System Examples
Review Hardware Support for OS What happens on
Operating Systems Structure
Operating Systems Principles Lecture 1: Introduction
Chapter-1 Computer is an advanced electronic device that takes raw data as an input from the user and processes it under the control of a set of instructions.
Operating Systems Structure
CSE 451: Operating Systems Autumn Module 24 Virtual Machine Monitors
Operating System Introduction
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Chapter 33: Virtual Machines
Introduction and Overview
Presentation transcript:

An Introduction to Operating Systems

What’s an OS? It’s a program that mediates between application programs and the hardware It provides abstractions to simplify building applications: files instead of “bytes on a disk” contiguous memory regions instead of “bits in a RAM chip” processes to run applications It allows application programs to co-exist peacefully enforces security policies enforces safety measures Allows effective usage of hardware resources

The 5 Views of OS Your view of an OS depends on who you are: The hardware view The operating system designer’s view The application programmer’s view The end-user’s view The system administrator’s view

The Hardware View The operating system is the layer of software that interacts directly with the hardware, concerns revolve around: The boot process Devices and how the OS can use them The interactions between H/W and OS

The OS Designer’s View The interest revolves mainly about the OS itself, its internal structure, its efficiency, performance, data structures, etc.. How can we make the OS more efficient How can we add more functionality? How do we debug the OS? Make it more reliable, scalable, etc.. Often, this view can become so insular to the point of forgetting what the OS is supposed to do in the first place (e.g. UNIX)

The Application Programmer’s View The OS is like a library with a well defined set of API’s What abstractions are available from the OS? How well is the API structured? Not too low-level, or high-level. How portable is the interface? Protection of the intellectual investment-- don’t want to keep rewriting the same program for each new OS release. Explain why Windows have been so successful

The End-User’s View The OS is just a program that happens to be pre-installed Must not crash or externalize the ugly aspects of the machine Must protect investment in existing software & applications Users care about applications, not the OS A good OS is the one that is most transparent Contrast Windows, Apple & UNIX

The System Administrator View An OS is a program that allows the efficient and equitable usage of resources: How can it track usage for accounting? How easy is it to install new software? Security Fairness Contrast Windows, Apple, UNIX, and mainframe systems

The Conflicts Between Views Hardware vs. OS designer API vs. User API vs. OS designer User vs. System administrator

A Short History Early machines -- 1940’s--1950 No OS. Machines programmed directly Early machines -- 1940’s--1955 Monitors -- a small program to manage devices, bootstrap, etc. Batch OS 1950’s--beyond Input & output processing separated from central processing Pipelining for increased throughput Time-sharing OS, 1960’s-- Several people can use the machine interactively (MVS, VMS,..)

A Short History (cont’d) Portable OS, 1970-- UNIX PC OS’s, 1974-- Apple II, and others MSDOS 1980-- The PC revolution Windowing OS 1980-- Apple (MacOS) & Xerox (Pilot OS) Windows 3.1, OS/2

A Short History (cont’d) Free/open OS 1985-- Linux, NetBSD, FreeBSD Distributed OS’s 1985-- UNIX, Novell, ...

The Big Consolidation (1995--) Desktop is mostly Windows 95/98 Workstation is mostly Windows NT or a UNIX variant Mainframes & servers have their own proprietary OS’s Embedded systems have still their OS’s

OS Types & Examples Desktop: MSDOS, Win95/98, MacOS, Linux Server: HPUX, AIX, Solaris, Minicomputers: AS/400, VMS Mainframes: CMS/MVS Embedded: OS-9, Vxworks, Lynx, PalmOS, Windows CE

What’s an OS? It’s a program that mediates between application programs and the hardware It provides abstractions to simplify building applications: files instead of “bytes on a disk” contiguous memory regions instead of “bits in a RAM chip” processes to run applications It allows application programs to co-exist peacefully enforces security policies enforces safety measures Allows effective usage of hardware resources

Hardware Support Operating system needs to: control I/O devices control access to the hardware all while denying these privileges to user programs: for protection for abstraction/ease of use Hardware supports two modes of operation (or more): access to hardware & I/O devices is done through privileged instructions, these are only available in “supervisor” mode privileged instructions cannot be executed in “user” mode

Implementation Using a bit in the processor Using protection rings (Intel Pentium uses 4 protection rings) Operating system code runs in supervisor mode, while user program code runs in user mode Switching from user to supervisor mode occurs on: interrupts: hardware devices needing service exceptions: user program acts silly (divide by 0, bus error, etc) trap instructions: user program requires OS service (system call) Switching back occurs by an RTI instruction

On Interrupts Key Fact: None of this is visible to the user program Hardware calls the operating system at a pre-specified location Operating system saves state of the user program Operating system identifies the device and cause of interrupt Responds to the interrupt (possibly killing program, <CTRL-C>) Operating system restores state of the user program (if applicable) or some other user program Execute an RTI instruction to return to the user program User program continues exactly at the same point it was interrupted. Key Fact: None of this is visible to the user program

On Exceptions Hardware calls the operating system at a pre-specified location Operating system identifies the cause of the exception (e.g. / 0) If user program has exception handling specified, then OS adjust the user program state so that it calls its handler Execute an RTI instruction to return to the user program If user program did not have a specified handler, then OS kills it and runs some other user program, as available Key Fact: Effects of exceptions are visible to user programs and cause abnormal execution flow

On System Calls User program executes a trap instruction (system call) Hardware calls the operating system at a pre-specified location Operating system identifies the required service and parameters (e.g. open(filename, O_RDONLY); Operating system executes the required service Operating system sets a register to contain the result of call Execute an RTI instruction to return to the user program User program receives the result and continues Key Fact: To the user program, it appears as a function call executed under program control

Implications on OS Structure An OS is just a program: It has a main() function, which gets called only once (during boot) Like any program, it consumes resources (such as memory), can do silly things (like generating an exception), etc. But it is a very strange program: It is “entered” from different locations in response to external events It does not have a single thread of control, it can be invoked simultaneously by two different events (e.g. sys call & an interrupt) It is not supposed to terminate It can execute any instruction in the machine

Control Flow in an OS From boot main() System call Initialization Interrupt Exception Idle Loop Operating System Modules RTI

General OS Structure Monolithic Structure. e.g. UNIX App App App API Memory Manager File Systems Process Manager Network Support Security Module Service Module Extensions & Add’l device drivers Device Drivers Interrupt handlers Boot & init

Layered Organization Layered Structure. e.g. Windows NT App App App API Each module has a well defined interface File Systems Memory Manager Process Manager Network Support Object Support Kernel: M/C dependent basic implementations Hardware Adaptation Layer (HAL) Boot & init Extensions & Add’l device drivers Device Drivers Interrupt handlers

Micro-Kernel Organization OS main functions implemented by out-of-kernel servers Memory Manager App App Process Manager Security Module File Systems e.g.: QNX, Mach Network Support Basic Message Passing Support Extensions & Add’l device drivers Device Drivers Interrupt handlers Boot & init

Virtual Machine Organization OS-1 App App App App App App App OS-2 OS-3 e.g. OS/370 Gives a hardware abstraction to the OS’es involved (sometimes called hypervisor) VM Layer

An Operating System in Action CPU loads boot program from ROM (e.g. BIOS in PC’s) Boot program: Examines/checks machine configuration (number of CPU’s, how much memory, number & type of hardware devices, etc.) Builds a configuration structure describing the hardware Loads the operating system, and gives it the configuration structure Operating system initialization: Initialize kernel data structures Initialize the state of all hardware devices Creates a number of processes to start operation (e.g. getty in UNIX, the Windowing system in NT, e.g.)

O.S. in Action (cont’d) After basic processes have started, the OS runs user programs, if available, otherwise enters the idle loop In the idle loop: OS executes an infinite loop (UNIX) OS performs some system management & profiling OS halts the processor and enter in low-power mode (notebooks) OS computes some function (DEC’s VMS on VAX computed Pi) OS wakes up on: interrupts from hardware devices traps from user programs exceptions from user programs