Kernel Design & Implementation

Slides:



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

Threads, SMP, and Microkernels
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 3 Operating System Organization.
Chorus and other Microkernels Presented by: Jonathan Tanner and Brian Doyle Articles By: Jon Udell Peter D. Varhol Dick Pountain.
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.
Computer Systems/Operating Systems - Class 8
Operating Systems High Level View Chapter 1,2. Who is the User? End Users Application Programmers System Programmers Administrators.
Operating System Structure. Announcements Make sure you are registered for CS 415 First CS 415 project is up –Initial design documents due next Friday,
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
Cs238 Lecture 3 Operating System Structures Dr. Alan R. Davis.
1 OS & Computer Architecture Modern OS Functionality (brief review) Architecture Basics Hardware Support for OS Features.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Operating System Organization.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.
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?
CS533 Concepts of Operating Systems Jonathan Walpole.
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.
Windows 2000 Course Summary Computing Department, Lancaster University, UK.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 7 OS System Structure.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
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.
 Virtual machine systems: simulators for multiple copies of a machine on itself.  Virtual machine (VM): the simulated machine.  Virtual machine monitor.
OSes: 3. OS Structs 1 Operating Systems v Objectives –summarise OSes from several perspectives Certificate Program in Software Development CSE-TC and CSIM,
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.
The Mach System Abraham Silberschatz, Peter Baer Galvin, Greg Gagne Presentation By: Agnimitra Roy.
Processes and Process Control 1. Processes and Process Control 2. Definitions of a Process 3. Systems state vs. Process State 4. A 2 State Process Model.
CS533 - Concepts of Operating Systems 1 The Mach System Presented by Catherine Vilhauer.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
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.
The Mach System Silberschatz et al Presented By Anjana Venkat.
Operating-System Structures
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Chapter 2 Operating System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Concepts and Structures. Main difficulties with OS design synchronization ensure a program waiting for an I/O device receives the signal mutual exclusion.
Major OS Components CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
Threads, SMP, and Microkernels Chapter 4. Processes and Threads Operating systems use processes for two purposes - Resource allocation and resource ownership.
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.
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 Structure
Credits: 3 CIE: 50 Marks SEE:100 Marks Lab: Embedded and IOT Lab
CS 6560: Operating Systems Design
Protection of System Resources
Process Management Presented By Aditya Gupta Assistant Professor
Operating System Structure
KERNEL ARCHITECTURE.
OS Organization.
Threads, SMP, and Microkernels
ICS 143 Principles of Operating Systems
Page Replacement.
Chapter 2: System Structures
Outline Midterm results summary Distributed file systems – continued
B.Ramamurthy Chapter 2 : Appendix
Operating Systems Lecture 3.
LINUX System : Lecture 7 Lecture notes acknowledgement : The design of UNIX Operating System.
Operating Systems: A Modern Perspective, Chapter 3
OS Components and Structure
Outline Operating System Organization Operating System Examples
Operating Systems Structure
Advanced Operating Systems (CS 202) Operating System Structure
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Presentation transcript:

Kernel Design & Implementation

The Problems Kernel code is notoriously complex: Concurrency control Device drivers Interrupts Low-level hardware details Functionality is every increasing Debugging is slow Must reboot after every change

Yet More Problems How to develop a new operating system? How to maintain an operating system Fixing bugs Improving technology Adding new features Maintaining backward compatibility Operation across different hardware platforms

Kernel Types Simple monitor/library: e.g. DOS Monolithic piece of software: e.g. UNIX Micro-kernels: e.g. Mach Virtual Machines (VM): e.g. IBM CMS/VM Layered OS: e.g. Windows NT Extensible kernels: SPIN

Simple Monitor/Library Applications + OS co-exist in supervisor mode Share the same memory space Applications have direct access to devices Operating system has limited functionality No meaningful user accounting or security Operating system relies on application to solve problems: e.g. overlaying, EMS

Example: DOS DOS * No virtual memory * No protection I/O * One application at a time * Direct I/O I/O Frame buffer Application DOS interrupt vector Hardware vector (to the BIOS)

Simple Monitor/Library in Balance Advantages: Performance No context switching Direct I/O access No VM overhead Flexibility Applications can change OS behavior Disadvantages No safety or security No VM No multiprogramming OS cannot protect or manage I/O effectively

TSR Terminate-and-Stay-Resident: On a timer interrupt: Application overwrites OS vector for timer interrupt Timer interrupts invoke an application routine Application “exits” (not really) On a timer interrupt: TSR application is invoked TSR application runs TSR application calls OS timer interrupt routine TSR application returns to the “current application”

TSR cont’d More TSR applications could be added New TSR overwrites old TSR timer interrupt entry On a timer interrupt: Newest TSR is invoked, runs, then passes control to the next TSR application… All the way to oldest TSR application which finally invokes the OS TSR programs are thus chained through the interrupt vector

Expanded Memory System (EMS) To overcome limits of 1M addressing without having to do overlaying Uses special hardware to allow remap a memory address range (16K) to a different range of physical pages Programmer tells system which physical range to remap Mimicks virtual memory, but all are physical addresses!!!

EMS Additional physical memory Addressable memory (1M) Unit of remapping in EMS is 4 pages (16K) Up to 64K units of 16Kbytes each No virtual addressing, EMS != virtual memory

Monolothic Kernels Kernel is one big piece of software Runs in supervisor mode while applications run in user mode Mostly modular design, but interfaces may not be well defined

Example: UNIX Kernel consists of major modules naming basic file system process implementation and scheduling memory and paging network protocol support There is no clear layering or separation of functions: Modules can call each other in different ways

UNIX File system Process Memory Network Devices

Micro-Kernels To control the complexity of the OS A small kernel that does: Fast interprocess communications/RPC Device control Basic process implementation (e.g. context switching) Basic memory management implementation (e.g. mapping memory pages, handling TLB/page tables) Interrupt processing support OS is implemented by user-level processes

Micro-Kernels Applications Process Scheduler Memory Mgr. Network Protocol File System Micro-Kernel

Implementing Fork Parent process sends an RPC to the process manager (through the micro-kernel) Process manager sends an RPC to the memory manager (through the micro-kernel) Memory manager allocates memory, calls micro-kernel to map the pages/and/or do copy-on-write Memory manager replies to process manager, which creates process Process manager replies to parent process

Sending a Network Message Application program sends an RPC containing the message to the network manager Network manager forms the necessary packets (e.g. TCP/IP), opens the network device (through micro-kernel), and sends packets through device Network manager replies to application program (or perhaps it replies immediately in case if it is a non-blocking operation)

Observations In a monolithic kernel, process module would call memory module, etc. Therefore: A micro-kernel replaces inter-module procedure calls with remote procedure calls No shared memory between OS processes Extra data copying

Micro-Kernels in Balance Advantages Development and maintenance of OS processes are easier Change one OS process without changing the rest Easy to add more functionality (e.g. DOS personality) Disadvantages Performance Cost of RPC becomes very important

Compatibility with Legacy Code Applications Process Scheduler Memory Mgr. Network Protocol File System UNIX Server 3. reply 1. Trap 2. Message 4. return Micro-Kernel