Operating System Structure. Announcements Make sure you are registered for CS 415 First CS 415 project is up –Initial design documents due next Friday,

Slides:



Advertisements
Similar presentations
Threads, SMP, and Microkernels
Advertisements

Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
1 OS Structure, Processes & Process Management. 2 Recap OS functions  Coordinator  Protection  Communication  Resource management  Service provider.
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 Design. Today’s Lectures I/O subsystem and device drivers Interrupts and traps Protection, system calls and operating mode OS structure.
1/28/2004CSCI 315 Operating Systems Design1 Operating System Structures & Processes Notice: The slides for this lecture have been largely based on those.
Figure 1.1 Interaction between applications and the operating system.
Architectural Support for Operating Systems
Architectural Support for Operating Systems. Announcements Most office hours are finalized Assignments (if any) up every Tuesday –Due one week later –Main.
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.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Modified from the text book.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Operating System Organization.
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?
Chapter 8 Windows Outline Programming Windows 2000 System structure Processes and threads in Windows 2000 Memory management The Windows 2000 file.
Microkernels, virtualization, exokernels Tutorial 1 – CSC469.
Protection and the Kernel: Mode, Space, and Context.
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.
Architecture Support for OS CSCI 444/544 Operating Systems Fall 2008.
Introduction to Operating Systems Chapter 1. cs431 -cotter2 Lecture Objectives Understand the relationship between computing hardware, operating system,
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
Processes and Threads Processes have two characteristics: – Resource ownership - process includes a virtual address space to hold the process image – Scheduling/execution.
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.
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.
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.
Operating Systems Structure what is the organizational principle?
1 Threads, SMP, and Microkernels Chapter Multithreading Operating system supports multiple threads of execution within a single process MS-DOS.
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.
1.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Lecture 2: OS Structures (Chapter 2.7)
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
Operating-System Structures
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.
Process Abstractions. Announcements First homework is due this Wednesday by midnight First CS 415 project is up Contact Bill Hogan
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
1.3 Operating system services An operating system provide services to programs and to the users of the program. It provides an environment for the execution.
Introduction to Operating Systems Concepts
Computer System Structures
Computer System Structures
OPERATING SYSTEM CONCEPTS AND PRACTISE
Chapter 2: Operating-System Structures
Operating System Structures
Kernel Design & Implementation
An Introduction to Operating Systems
Lecture 4: Operating System Structures
Operating System Structure
Chapter 2: Operating-System Structures
OS Organization.
Chapter 2: System Structures
Lecture Topics: 11/1 General Operating System Concepts Processes
Lecture 4- Threads, SMP, and Microkernels
Operating Systems Lecture 3.
Outline Chapter 2 (cont) OS Design OS structure
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.
Operating Systems: A Modern Perspective, Chapter 3
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
System calls….. C-program->POSIX call
Operating Systems Structure
Operating Systems Structure
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Presentation transcript:

Operating System Structure

Announcements Make sure you are registered for CS 415 First CS 415 project is up –Initial design documents due next Friday, February 2nd –Project due following Thursday, February 8th Everyone should have access to CMS ( –Check and contact me or Bill Hogan today if you do not have access to CMS Also, everyone should have CSUGLab account –Contact Bill or I if you do not

Review: Protecting Processes from Each Other Problem: Run multiple applications in such a way that they are protected from one another Goal: –Keep User Programs from Crashing OS –Keep User Programs from Crashing each other –[Keep Parts of OS from crashing other parts?] (Some of the required) Mechanisms: –Dual Mode Operation –Address Translation (base/limit registers, page tables, etc) –Privileged instructions (set timer, I/O, etc) Simple Policy: –Programs are not allowed to read/write memory of other Programs or of Operating System

Review: Dual Mode Operation Hardware provides at least two modes: –“Kernel” mode (or “supervisor” or “protected”) –“User” mode: Normal programs executed Some instructions/ops prohibited in user mode: –Example: cannot modify page tables in user mode Attempt to modify  Exception generated Transitions from user mode to kernel mode: –System Calls, Interrupts, Other exceptions

Today’s Lectures I/O subsystem and device drivers Interrupts and traps Protection, system calls and operating mode OS structure What happens when you boot a computer?

Operating System Structure An OS is just another kind of program running on the CPU – a process: –It has main() function that 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 sophisticated program: –“Entered” from different locations in response to external events –Does not have a single thread of control 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

How do you start the OS? Your computer has a very simple program pre-loaded in a special read-only memory –The Basic Input/Output Subsystem, or BIOS When the machine boots, the CPU runs the BIOS The BIOS, in turn, loads a “small” OS executable –From hard disk, CD-ROM, or whatever –Then transfers control to a standard start address in this image –The small version of the OS loads and starts the “big” version. The two stage mechanism is used so that BIOS won’t need to understand the file system implemented by the “big” OS kernel File systems are complex data structures and different kernels implement them in different ways The small version of the OS is stored in a small, special-purpose file system that the BIOS does understand

What does the OS do? OS runs user programs, if available, else enters 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

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

Operating System Structure Simple Structure: MS-DOS –Written to provide the most functionality in the least space –Applications have direct control of hardware Disadvantages: –Not modular –Inefficient –Low protection or security

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

Layered Structure OS divided into number of layers –bottom layer (layer 0), is the hardware –highest (layer N) is the user interface –each uses functions and services of only lower-level layers Advantages: –Simplicity of construction –Ease of debugging –Extensible Disadvantages: –Defining the layers –Each layer adds overhead

Layered Structure Device Drivers Extensions & Add’l device drivers Interrupt handlers File Systems Memory Manager Process Manager API App Network Support Boot & init App Object Support Machine dependent basic implementations Hardware Adaptation Layer (HAL)

Microkernel Structure Moves as much from kernel into “user” space User modules communicate 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 –Example: Mach, QNX Detriments: –Performance overhead of user to kernel space communication –Example: Evolution of Windows NT to Windows XP

Microkernel Structure Device Drivers Extensions & Add’l device drivers Interrupt handlers File Systems Memory Manager Process Manager Security Module App Network Support Boot & init App Basic Message Passing Support

Modules Most modern OSs 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 Examples: Solaris, Linux, MAC OS X

UNIX structure

Windows Structure

Modern UNIX Systems

MAC OS X

Virtual Machines Implements an observation that dates to Turing –One computer can “emulate” another computer –One OS can implement abstraction of a cluster of computers, each running its own OS and applications Incredibly useful! –System building –Protection Cons –implementation Examples –VMWare, JVM

VMWare Structure

But is it real? Can the OS know whether this is a real computer as opposed to a virtual machine? –It can try to perform a protected operation… but a virtual machine monitor (VMM) could trap those requests and emulate them –It could measure timing very carefully… but modern hardware runs at variable speeds Bottom line: you really can’t tell!

Modern version of this question Can the “spyware removal” program tell whether it is running on the real computer, or in a virtual machine environment created just for it? –Basically: no, it can’t! Vendors are adding “Trusted Computing Base” (TCB) technologies to help –Hardware that can’t be virtualized –We’ll discuss it later in the course