the microkernel pattern
DESCRIPTION
The Microkernel Pattern. What is the Microkernel Pattern?. Similar to Layers pattern Separate minimal functionality from extended functionality Able to adapt to customer-specific parts Originates from OS theory and research. Why use the Microkernel Pattern?. - PowerPoint PPT PresentationTRANSCRIPT
Ad
vance
d D
esi
gn
an
d S
yst
em
Patt
ern
s
The Microkernel Pattern
2
Ad
vance
d D
esi
gn
an
d S
yst
em
Patt
ern
s What is the Microkernel Pattern?
Similar to Layers pattern Separate minimal functionality from
extended functionality Able to adapt to customer-specific
parts Originates from OS theory and
research
3
Ad
vance
d D
esi
gn
an
d S
yst
em
Patt
ern
s Why use the Microkernel Pattern?
When there is a need to adapt to changing system requirements
Portability, extensibility and adaptability
Easy integration of emerging technologies (e.g. emulation)
4
Ad
vance
d D
esi
gn
an
d S
yst
em
Patt
ern
s
Roles to be played
Internal server External server Adapter Client Microkernel
5
Ad
vance
d D
esi
gn
an
d S
yst
em
Patt
ern
s The Microkernel in more detail
Implements central services Other components build on these
basic services Encapsulation of system-specific
dependencies These basic services are called
atomic services (or mechanisms)
6
Ad
vance
d D
esi
gn
an
d S
yst
em
Patt
ern
s Internal Server (Subsystem) in more detail
Extends functionality offered by the microkernel
Separate component Encapsulates some dependencies on
underlying hardware/software system
Example: device drivers
7
Ad
vance
d D
esi
gn
an
d S
yst
em
Patt
ern
s External Server (Personality) in more detail
Uses microkernel to implement its own view of the underlying application domain
Layer on top of atomic services provided by microkernel
Different external servers implement different policies from different application domains
Example: OS/2 Warp
8
Ad
vance
d D
esi
gn
an
d S
yst
em
Patt
ern
s
Client in more detail
Application that is associated with exactly one external server
It accesses the APIs provided by the external server
9
Ad
vance
d D
esi
gn
an
d S
yst
em
Patt
ern
s Adapter (Emulator) in more detail
Protect clients and external server from direct dependencies
Use adapter interface Example: no distinction between a
native OS/2 Warp and microkernel support
Implement as a Proxy (since Adapter refers to one external server)
10
Ad
vance
d D
esi
gn
an
d S
yst
em
Patt
ern
s Example: The CHORUS System
Originated in INRIA (France) in 1990 High-performance UNIX emulation Distributed environments RT applications Integration with OOT
11
Ad
vance
d D
esi
gn
an
d S
yst
em
Patt
ern
s
Chorus Architecture
U1 U2 U3 User process
Microkernel
UserAddressSpace
KernelAddressSpace
S1 S2
K1
Unix Subsystem
S3
K2 Kernel process
System process
Object-Oriented Subsystem{{
12
Ad
vance
d D
esi
gn
an
d S
yst
em
Patt
ern
s Example of aMicrokernel System (Chorus)
Unix Process
PM
Microkernel
Microkernel Microkernel
Microkernel
PM
SM
IPCM
PMPM SM
SMOM
IPCM
Embedded System
Xterminal Diskless Workstation
Complete System
13
Ad
vance
d D
esi
gn
an
d S
yst
em
Patt
ern
s Test CaseWindows NT Architecture
OS designed to run programs from different environments
DOS, 16-bit Windows, OS/2 Client-server model (programs run in
User mode) Calls packaged and sent to Kernel
via LPC
14
Ad
vance
d D
esi
gn
an
d S
yst
em
Patt
ern
s
System Services
Kernel Mode}User Mode
System Services
LocalProcedureCall Facility
(LPC)
VirtualMemoryManager
I/OManager
FileSystemCache
SystemsDrivers
Kernel
Hardware Abstraction Layer(HAL)
Hardware
ObjectManager
. . .
15
Ad
vance
d D
esi
gn
an
d S
yst
em
Patt
ern
s
General Features
NT Executive is layered Some objects in charge of policy
(e.g. Security Monitor) The Kernel is responsible for
implementation
16
Ad
vance
d D
esi
gn
an
d S
yst
em
Patt
ern
s
General Features (continued)
Relaxed layered system (Kernel and I/O manager may access hardware directly)
NT has a subsystem for each operating system
17
Ad
vance
d D
esi
gn
an
d S
yst
em
Patt
ern
s
The Layers
System services: interface layer between subsystems and NT Executive
Resource management: Object Manager, Virtual Memory Manager etc.
Kernel: basic functions (interrupt, thread dispatching...)
18
Ad
vance
d D
esi
gn
an
d S
yst
em
Patt
ern
s
The Layers (continued)
HAL: hides hardware differences between different processor families
Hardware layer
19
Ad
vance
d D
esi
gn
an
d S
yst
em
Patt
ern
s
The Kernel
Bottom of the food chain Fundamental functions and objects Cannot be pre-empted
20
Ad
vance
d D
esi
gn
an
d S
yst
em
Patt
ern
s Responsibilities of the Kernel
Scheduling threads Transferring control on interrupts
and exceptions Synchronising multiprocessor
operations Initiating system recovery after a
power failure
21
Ad
vance
d D
esi
gn
an
d S
yst
em
Patt
ern
s
Objects in Kernel
Dispatcher objects (e.g. Mutex, Semaphore, Thread)
Control objects (Process, I/O, Asynchronous Procedure Call)
Represent more primitive attribute subset provided by corresponding User objects
22
Ad
vance
d D
esi
gn
an
d S
yst
em
Patt
ern
s
Final Remarks
Microkernel is a variant of Layers pattern
Use Microkernel when clients have different views of underlying business logic (Buschmann)