Docsity

Microkernels: L3 - Lecture Notes - Advanced Operating Systems | CS 6210, Study notes of Operating Systems

Partial preview of the text

Download Microkernels: L3 - Lecture Notes - Advanced Operating Systems | CS 6210 and more Study notes Operating Systems in PDF only on Docsity!

Microkernels: L

  • based on the paper “On micro-kernel

Construction” by Jochen Liedtke.

Micro-kernels

  • Micro-kernels represent a well-studied OS

structuring idea:– very small kernel (implementing little more

than address spaces and threads)

  • most of the functionality outside the kernel– very fast communication between OS

components (to compensate for distribution)

Micro-kernel concepts

•^

What should the kernel implement?– implies limited functionality guaranteed, also need for

protection domain crossings

•^

The answer should depend on functionality— notperformance– many of the traditional performance bottlenecks can be

eliminated (e.g., Liedtke shows that user-to-user IPC canbe done 22 times faster than in Mach—which is also amicro-kernel)

•^

Also – can cross-protection domain interactions beefficiently supported

•^

Objective: System must support interactive andnot completely trustworthy applications– protection– principle of independence – S can make guarantees

independent of S’

  • principle of integrity – S1 and S2 must be able to

establish a channel that can be neither corrupted noteavesdropped by S’

•^

The kernel should implement only three things:– address spaces– threads and IPC– unique identifiers

Examples of Address Space Use

•^

A regular memory manager is just a “process” (

server

managing the initial address space– entirely outside the kernel!

-^

Memory managers can be stacked: one can grant partsof the physical memory to the next

-^

A pager can be a totally separate server, communicatingthrough IPC– of course it could also be integrated in a memory manager– advantage: easy to implement specific policies (e.g., real time,

flow-based, etc.)

Threads and IPC

•^

The kernel needs to have a concept of activities andtheir state of execution (i.e., registers, instructionpointer, stack pointer)

-^

Threads need to communicate but modifying a sharedaddress space can lead to corruption

-^

The kernel can add more structure with kernelcontrolled IPC– at least some rudimentary IPC mechanism must exist and

more complex ones can be built on top

  • IPC is safe because both parties agree (e.g., the server

receives information and interprets it voluntarily)

  • no chance of corruption of unsuspecting servers -^

Interrupts are just IPC– the HW is a thread sending IPC messages– the micro-kernel does the transformation

Examples of microkernel flexibility

•^

Device drivers won’t be in the kernel. They arejust servers that access I/O ports mapped to theiraddress space

-^

RPC on top of a basic IPC mechanism can beimplemented as an external server

-^

Unix system calls can be implemented as anexternal server

-^

everything but processor architecture, first-levelTLB and cache

  • Micro-kernel based OSs can offer extreme

flexibility but they are criticized for badperformance (due to switching and memoryeffects)

  • Paper argues that problem is not in the

concept but in the implementation!

Address space switches

•^

if no flush is needed (tagged architectures orarchitectures with segment registers) the cost is smaller

-^

crucial idea: let’s keep small, commonly used serveraddress spaces shared with regular “large” addressspaces

-^

for this to happen, address space assignment to a linearspace must be dynamic and dependent on size

  • IPC and thread switches
    • this can be made fairly fast for most purposes.– system call, argument copy, stack and address

space switch…

  • for L3 expensive – 100 cycle trap overhead

Non-portability

-^

Many micro-kernels have relied on a hardware abstractionlayer but were themselves hardware-independent

-^

Liedtke’s argument is that the micro-kernel should beprocessor-dependent–

not just the coding, but even the algorithms inside a micro-kernelshould be tuned to the architecture– a good example of the changes needed to port a micro-kernel fromthe 486 to a Pentium (“compatible” processors) is shown

-^

Understanding raw number differences–

RPC comparison exokernel and L