OS Organization Continued

Slides:



Advertisements
Similar presentations
OS Organization Continued Andy Wang COP 5611 Advanced Operating Systems.
Advertisements

Threads, SMP, and Microkernels
Operating System Structures
The Spring System (and its trusty sidekick, Subcontract) Sun Microsystems.
Study of Hurricane and Tornado Operating Systems By Shubhanan Bakre.
Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
Chapter 4 Threads, SMP, and Microkernels Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design.
CS-550: Distributed File Systems [SiS]1 Resource Management in Distributed Systems: Distributed File Systems.
Lightweight Remote Procedure Call Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented by Alana Sweat.
Computer Systems/Operating Systems - Class 8
Memory Management (II)
Object Based Operating Systems1 Learning Objectives Object Orientation and its benefits Controversy over object based operating systems Object based operating.
PRASHANTHI NARAYAN NETTEM.
CS510 Concurrent Systems Jonathan Walpole. Lightweight Remote Procedure Call (LRPC)
CS533 Concepts of Operating Systems Jonathan Walpole.
Distributed Systems. Interprocess Communication (IPC) Processes are either independent or cooperating – Threads provide a gray area – Cooperating processes.
CS 153 Design of Operating Systems Spring 2015 Lecture 17: Paging.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Processes and Threads Processes have two characteristics: – Resource ownership - process includes a virtual address space to hold the process image – Scheduling/execution.
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
The Mach System Abraham Silberschatz, Peter Baer Galvin, Greg Gagne Presentation By: Agnimitra Roy.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
1 Threads, SMP, and Microkernels Chapter Multithreading Operating system supports multiple threads of execution within a single process MS-DOS.
CS533 - Concepts of Operating Systems 1 The Mach System Presented by Catherine Vilhauer.
M. Accetta, R. Baron, W. Bolosky, D. Golub, R. Rashid, A. Tevanian, and M. Young MACH: A New Kernel Foundation for UNIX Development Presenter: Wei-Lwun.
Processes and Virtual Memory
The Mach System Silberschatz et al Presented By Anjana Venkat.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
CEN6502, Spring Understanding the ORB: Client Side Structure of ORB (fig 4.1) Client requests may be passed to ORB via either SII or DII SII decide.
Lecture 4 Page 1 CS 111 Online Modularity and Memory Clearly, programs must have access to memory We need abstractions that give them the required access.
Introduction to Operating Systems Concepts
Modularity Most useful abstractions an OS wants to offer can’t be directly realized by hardware Modularity is one technique the OS uses to provide better.
Kernel Design & Implementation
Memory Management.
Non Contiguous Memory Allocation
Chapter 8: Main Memory.
The Mach System Sri Ramkrishna.
Operating System Organization
CS533 Concepts of Operating Systems
Chapter 2: System Structures
File System Implementation
Operating System Structure
Out-of-Process Components
Modularity and Memory Clearly, programs must have access to memory
CSI 400/500 Operating Systems Spring 2009
Main Memory Management
B. N. Bershad, T. E. Anderson, E. D. Lazowska and H. M
Introduction to Operating Systems
O.S Lecture 13 Virtual Memory.
Threads, SMP, and Microkernels
Chapter 2: System Structures
Sarah Diesburg Operating Systems COP 4610
Today: Coda, xFS Case Study: Coda File System
Chapter 1 Introduction to Operating System Part 5
Basic Concepts Protection: Security:
Lecture 4- Threads, SMP, and Microkernels
Fast Communication and User Level Parallelism
Outline Chapter 2 (cont) OS Design OS structure
Presented by: SHILPI AGARWAL
CSE451 Virtual Memory Paging Autumn 2002
Chapter 15: File System Internals
OS Components and Structure
Out-of-Process Components
Chapter 2: Operating-System Structures
Lecture 3: Main Memory.
System calls….. C-program->POSIX call
Operating Systems Structure
Lecture 4: File-System Interface
Last Class: Communication in Distributed Systems
Presentation transcript:

OS Organization Continued

Outline Overall organization of microkernel systems Spring

Organizing the Total System In microkernels, much of the OS is outside the microkernel But how is the entire system organized? How do you fit the components to build an integrated system? While maintaining the advantages of the microkernel

A Sample Microkernel OS—Spring Developed by Sun Intended to examine how to improve OSes by building from the ground up Approach was to address the greatest problem in building OSes A response to problems with UNIX

UNIX Problems Spring Addresses Cost of maintaining/evolving system Inflexible security model Hard to build distributed services Hard to handle real-time issues Multiplicity of naming schemes

Basic Spring Approach Make it possible for others to extend the OS itself through strong interfaces Which are open, flexible, and extensible Spring designers clearly learned from success of extensible UNIX features (like VFS) OS as set of cooperating services

Object-Oriented Organizations OO organization is increasingly popular Well suited to OS development, in some ways OSes manage important data structures OSes are modularizable Strong interfaces are good in OSes

Object-Orientation and Extensibility One of the main advantages of OO programming is extensibility OSes increasingly need extensibility So, again, OO techniques are a good match for OS design

How object-oriented should an OS be? Many OSes have been built with OO techniques E.g., Mach and Windows NT But most of them leave object orientation at the microkernel boundary No attempt to force object orientation on out-of-kernel modules

Spring is a Microkernel System Spring microkernel consists of nucleus and basic VM support Nucleus supports operating system objects With security And high speed object invocation

Spring Object Managers Spring is implemented as microkernel plus a suite of object managers Running in non-kernel mode In private address spaces Adding new functionality to Spring amounts to adding a new object manager Object managers are objects themselves

Spring’s Interface Definition Language Spring wants to avoid being tied to a single language But it also requires strong interfaces to allow for extensibility So, Spring interfaces are written in IDL Interfaces are defined in IDL, but IDL says nothing about implementation

IDL Compilers Convert IDL definitions of interfaces into particular languages To generate language-specific form of the interface For use of objects written in that language Also generates client and server stub code for use by objects deploying the interface

Objects in Spring Object users invoke operations defined in its interface The operation could be performed in The same address space A different address space on the same machine A different address space on a different machine

Server-based Objects Server-based Spring objects live in their own address spaces IDL generates stubs for their benefit Subcontracts and doors used to communicate between clients and servers Essentially, they are passed to another address space by a pointer

Serverless Objects Objects kept in the caller’s address space Typically used for lightweight objects most of local interest Can be passed to another address space by copying

Parts of a Spring Object From the client’s point of view, an object consists of A method table A subcontract operation vector Client-local private state (representation)

Spring Object Diagram Method Table Subcontract Table Representation

Methods and Spring Objects Spring object methods are either handled in the object’s local address space Through the method table Or in a remote address space Through the subcontract table Subcontracts essentially allow other objects to handle your methods for you

Spring Subcontracts Semantics of invoking an object in a different address space can vary Can the object be replicated? Can it support an atomic transaction? Can it migrate? Is it persistent? Spring subcontracts allow this flexibility In the context of RPC

Subcontracts and Extensibility Subcontracts are essentially an extensibility mechanism Service providers can extend the service Without requiring clients to do things differently Essentially, subcontracts sit between interfaces and implementations

Simple Subcontracts One example A subcontract for invoking a method on an object at a remote server Subcontract implements the machinery for communicating with the remote server Methods simply marshal arguments and call the subcontract, in this case

Simple Subcontract Diagram Server Application Client Application Server Stubs Client Stubs Subcontract Subcontract

So, what can I do with subcontracts? One example: a simple replication service Users access through client object Server objects maintain replication Client object has representation showing where each server maintaining a replica is All local methods are stub calls to subcontracts

Replication Subcontract Diagram Server object 1 Server object 2 Client object Server replication subcontract Server replication subcontract Client replication subcontract

Replication Subcontract Diagram Server object 1 Server object 2 Client object Server replication subcontract Server replication subcontract Client replication subcontract

Other Types of Subcontracts The simplex subcontract: uses one door to communicate with a server (RPC) The cluster subcontract: uses a single door to access a set of objects The caching subcontract: supports access to either remote object or local caching object

Spring Nucleus Abstractions Domains Threads Doors All used to support Spring’s basic object model

Spring Domains Provide address space and container to hold application resources Similar to UNIX processes Or Mach tasks

Spring Threads Unit of execution in Spring Similar to threads in other systems Spring domains are typically multithreaded

Spring Doors Abstraction supporting interdomain OO method calls A door describes an entry point to a domain Also like a capability Possession of a door implies right to invoke an object’s method

Protecting Doors Since doors are capabilities, kernel must protect them to provide security Domains don’t hold doors themselves They hold door identifiers Door identifiers point to doors stored in the kernel Kernel maintains per-domain door table

Obtaining Doors Only two ways for a domain to get a door From the domain that the door opens to From another domain that already has the desired door Target domain can’t tell who used a door

Cross-Domain Object Invocation Via Doors Client invokes door via door identifier Nucleus allocates server thread in a target domain, then quickly transfers control to it Passing door information and arguments

Returning from a Cross-Domain Invocation When target wishes to return, the nucleus Deactivates the called thread Reactivates the caller thread Passes return data to caller

Door Invocation Methods Kernel supports three flavors of door invocation The fast path The vanilla path The bulk path Stubs make choice invisible to user, typically

The Fast-Path Door Invocation For simple data values, less than 16 bytes Which is the dominant case No doors may be passed Highly optimized—around 100 Sparc instructions to cross domains and come back

The Vanilla-Path Door Invocation For passing less than 5 Kbytes of data Include moderate number of doors Data passed through the kernel

The Bulk-path Door Invocation For sending entire pages of data And/or large numbers of doors Uses VM remapping to move data Can either unmap/remap in target address space Or map into both and use copy-on-write

Spring Network Proxies When a door points to an off-machine object, it actually points to a network proxy Network proxies Connect multiple Spring machines User-mode server domains Per-protocol, not per-machine

Network Proxy Diagram Client domain Proxy A Proxy B Server domain Nucleus A Nucleus B Door X Door Y

Spring Security Doors provide some level of security But clearly are lacking in certain ways Augmented with both access control list and capabilities Essentially, put a security object in front of the real object Security object can check capability ACL

Virtual Memory in Spring Each Spring machine has one Virtual Memory Manager (VMM) VMM handles mapping, sharing, page protection, transfers, and caching of local memory External pagers access backing store

Address Space Objects Represents the virtual address space of a Spring domain Implemented by VMM Represents just the address space, not particular pieces of real memory Either in terms of physical page frames or logical data pages

Memory Objects Abstraction of memory that can be mapped into an address space object Memory objects represent logical memory Implemented by object at the user level Operations include set/query length and bind Not page-in/page-out—separate object provides paging

Cache and Paging Objects Pager objects Know how to fetch and store pages of an object Provide methods to actually fetch pieces of memory VMM provides cache objects that actually control page frames

Cache/Pager Communications Caches are where the pages are stored Ask pagers for pages Pagers know how to get the pages Tell caches what to invalidate

Virtual Memory Object Diagram User object Memory object Pager object Map VMM Address space object Cache object

What’s where on this diagram? Domain address space management Control of individual segment of data Paging to and from location of data Page frame control

Domain Address Space Management User object Memory object Pager object Map VMM Address space object Cache object

Control of Data Segments User object Memory object Pager object Map VMM Address space object Cache object

Paging to and from Data Location User object Memory object Pager object Map VMM Address space object Cache object

Page Frame Control User object Memory object Pager object Map VMM Address space object Cache object

The Joys of Flexibility Pagers can fetch pages from disk Or across the net Different memory objects can permit different types of access to the same memory E.g., read-only versus read/write A single address space object can have memory provided from mapped files, normal VM, off-site files

More Joys of Flexibility Since the address space object is the normal Spring object, we can create doors to it So, other objects (even in other domains) can access it Since multiple pagers are possible, they can be optimized for their backing store Such as log-based file system versus an extent-based file system

Distributed Shared Memory? No problem: Let multiple address space objects on different machines map in the same memory object Pagers then provide access to data And enforce coherency

What this really means Virtual memory, shared memory, distributed shared memory, file systems, caches, everything Provided by one set of interoperable mechanisms Extreme power, extreme flexibility

Naming in Spring Spring uses a single unified system to name all resources Any object can be bound to any name And objects of different types can share the same name space

Contexts in Spring Names are bound to objects within a context Contexts are objects containing a set of name bindings All naming operations go through contexts Contexts can be bound inside other contexts Allowing connection of name spaces in a naming graph

Naming and Persistence By default, Spring objects are not persistent To make an object persistent, bind it to a persistent namespace Also provides methods of re-obtaining persistent object

Making a Named Object Persistent How does a name context make an arbitrary object persistent? Assuming disk storage, how do we store complex objects on disk? Each object type provides an implementation of persistence Through a general interface