Micro Kernel

Only available on StudyMode
  • Download(s) : 6
  • Published : February 18, 2013
Open Document
Text Preview
Lecture 2: OS Structure
CSC 469H1F Fall 2006 Angela Demke Brown

Week 1

Overview
• Motivation: Why talk about structure? • Kernel structures • • • • • Monolithic kernels Open systems Microkernels Kernel Extensions (Tuesday) Virtual Machines (Tuesday)

CSC469

Week 1

Motivation
• Let’s review what OS provides…
• • • • Abstraction layers Protection boundaries Resource allocators Resource schedulers

• It’s complicated!

• Windows NT ~29 million lines of code (as of 2000)

CSC469

Week 1

Monolithic OS
Apache
libc libpthread

Mozilla
libc libpthread

Emacs
libc

CPU Scheduling
Kernel

Interprocess Communication Networking File System Virtual Memory

Security CPU Network Memory Disk

CSC469

Week 1

Properties of Monolithic Kernels
• OS is all in one place, below the “red line” • Applications use a well-defined system call interface to interact with kernel • Examples: Unix, Windows NT/XP, Linux, BSD, OS/161 • Advantages? • Common in commercial systems

• Good performance, well-understood, easy for kernel developers, high level of protection between applications • No protection between kernel components, not (safely, easily) extensible, overall structure becomes complicated (no clear boundaries between modules) Week 1

• Disadvantages?

CSC469

Open Systems
Mozilla
Kernel and Applications

libpthread libc Interprocess Communication File System Virtual Memory

Apache

Emacs Networking

CPU

Network

Memory

Disk

CSC469

Week 1

Properties of Open Systems
• Applications, libraries, kernel all in the same address space • Crazy? • • • • MS-DOS Mac OS 9 and earlier Windows ME, 98, 95, 3.1, etc. Palm OS and some embedded systems

• Used to be very common • Advantages?
• •
CSC469

Very good performance, very extensible, works well for single-user OS No protection btwn kernel and/or apps, not very stable, composing extensions can lead to unpredictable behavior Week 1

• Disadvantages?

Microkernel OS
Mozilla libc libpthread Apache libc libpthread
Microkernel

Networking

Emacs libc

Processes Virtual Memory

File System

Interprocess Communication

CPU Scheduling

Security

CPU
CSC469

Network

Memory

Disk
Week 1

Properties of Microkernels
• Design Philosophy: protected kernel code provides minimal “small, clean, logical” set of abstractions • Tasks and threads • Virtual memory • Interprocess communication

• Everything else is a server process running at user-level • Examples: Mach, Chorus, QNX, GNU Hurd • Mixed results … CSC469 Week 1

Microkernel Advantages
• Extensible: add a new server to add new OS functionality • Kernel does not determine operating system environment • Allows support for multiple OS personalities • Need an emulation server for each system (e.g. Mac, Windows, Unix) • All applications run on same microkernel • Applications can use customized OS (e.g. for databases) CSC469 Week 1

More Advantages
• Mostly hardware agnostic
• Threads, IPC, user-level servers don’t need to worry about underlying hardware

• Strong protection
• Even of the OS against itself (i.e., the parts of the OS that are implemented as servers)

• Easy extension to multiprocessor and distributed systems

CSC469

Week 1

Microkernel Disadvantages
• Performance
• System calls can require a lot of protection mode changes (next slide)

• Expensive to reimplement everything with a new model
• OS personalities are easier to port to new hardware after porting to microkernel, but porting to microkernel may be harder than porting to new hardware • See IBM Workplace OS story

• Bad past history

CSC469

Week 1

Microkernel System Call Example
1. Application calls read(), traps to microkernel 2. microkernel sends message to Unix Personality requesting read 3. Unix personality sends message to File System Server (FSS) asking for data 4. FSS receives message and begins processing 5. FSS sends...
tracking img