19 Extensible Oses Exokernel Spin
19 Extensible Oses Exokernel Spin
Exokernel:
• “Fixed high-level abstractions hurt application performance because there
is no single way to abstract physical resources or to implement an
abstraction that is best for all applications.”
• “Fixed high-level abstractions limit the functionality of applications,
because they are the only available interface between applications and
hardware resources”
Challenge: “Fixed” Interfaces
Both papers identify “fixed interfaces” provided by existing OSes
as main challenge
• Fixed interfaces provide protection but hurt performance and functionality
SPIN:
• “Existing operating systems provide fixed interfaces and implementations
to system services and resources. This makes them inappropriate for
applications whose resource demands and usage patterns are poorly
matched by the services provided.”
Problems in existing OSes
Extensibility
• Abstractions overly general
• Apps cannot dictate management
• Implementations are fixed
Performance
• Context switching expensive
• Generalizations and hiding information affect performance
Protection and Management offered with loss in Extensibility and
Performance
Symptoms
Databases know better than the OS what pages they will access
• Can prefetch pages, LRU hurts their performance, why?
Two Papers, Two Approaches
Exokernel:
• Very minimalist kernel, most functionality implemented in user space
• Assumed many apps have widely different requirements, maximal
extensibility
SPIN:
• Dynamically link extensions into the kernel
• Rely on programming language features, e.g. static typechecking
• Assumed device drivers need flexibility, so focused on how to enable
them while staying protected
Exokernel
Corollary:
• Kernel just safely exposes resources to apps
• Apps implement everything else, e.g., interfaces/APIs, resource allocation
pollcies
OS Component Layout
Exokernel
www.cs.cornell.edu/courses/CS6410/2011fa/lectures/08-extensible-kernels.pdf
(Hakim Weatherspoon, Cornell University)
Exokernel Main Ideas
ABSTRACTIONS
Exokernel design
Securely expose hardware
• Decouple authorization from use of resources
• Authorization at bind time (i.e., granting access to resource)
• Only access checks when using resource
• E.g., LibOS loads TLB on TLB fault, and then uses it multiple times
Expose allocation
• Allow LibOSes to request specific physical resources
• Not implicit allocation; LibOS should participate in every allocation
decision
Exokernel design
Expose revocation
• “Polite” and then forcibly abort
Example: Memory
Self-authenticated
Guard TLB loads and DMA capability
• Secure binding: using self-authenticating capabilities
– For each page Exokernel creates a random value, check
– Exokernel records: {Page, Read/Write Rights, MAC(check, Rights)}
• When accessing page, owner need to present capability
• Page owner can change capabilities associated and deallocate it
Downloadable filters
Event/handler abstraction
Language: Modula 3
Designed by DEC and Olivetti (1980s)
• Descendent from Mesa
Co-location
• Extensions dynamically linked into same memory-space as kernel
• Fast communication
Enforced modularity
• Modula 3 extensions provide compile-time protection (memory and
privileged instructions protected)
SPIN design
Extensions:
• Event: page fault
• App provides handle for page faults
Example: Processor Sharing
Based on Modula-3 threads
www.cs.cornell.edu/courses/CS6410/2011fa/lectures/08-extensible-kernels.pdf
(Hakim Weatherspoon, Cornell University)
SPIN vs Exokernel
Extensibility
Security
Performance
Exokernels
• Safely export machine resources
• Decouple protection from management to get performance, no
layers of indirection to slow things down
SPIN
• Kernel extensions (imported) safely specialize OS services
• Safety through Programming Language support