Language Based Operating Systems by Sean Olson

Download Report

Transcript Language Based Operating Systems by Sean Olson

Language Based Operating
Systems by Sean Olson

What is a virtual machine?

What is managed code?

Kernels.

Memory and security models.

What is a language based operating system?

Examples.

The (possible) future.
Virtual Machines
A virtual machine (often abreviated VM) is a hardware
abstraction designed to perform some task or execute
instructions designed for it rather than the actual
environment it is deployed in. It may encapsulate some
functionality, or emulate an existing machine.
Common examples of VMs in programming are the
Java Virtual Machine (JVM), CPython, the Ruby
Virtual Machine, and the Common Language Runtime
(CLR).
Managed Code
Managed code is code
written in a language
that is compiled to some
intermediate language
for execution or
interpretation by a VM.
Such languages are usually
very high level (abstract)
and provide expressive
features.

Arbitrary complexity.


VM instructions
may perform any
number of native
operations.
Safety.

The VM acts as
the interface
between managed
code and native
code.
Kernels

The kernel is the core of the operating system.

Performs important system tasks.

Memory management (hardware/software).

Interprocess communication (IPC).

Scheduling.

Interupts.

Provides hooks for code in user space.

Protection sensitive systems.
Monolithic Kernels
A monolithic kernel tends
to be large and contains
a stack of many complex
systems that run in
kernel space.
Services are tightly
integrated and very
interdependent.


Provides complex
services.

Virtual memory.

File systems.

Device drivers.

Dispatchers.
Presents a rich set of
system calls for
communication with
user space.
Microkernels
A microkernel is a
minimalistic kernel that
provides only required
services that must exist
in kernel space.
Remaining services are
implemented as servers,
which exist in user space
and are isolated from the
kernel.



Failed services
(servers) are okay;
they are in user
space.
Creates a security
layer.
Must provide fast and
powerful IPC tools to
support servers.
Kernel Comparison
Memory/Security Models




As hardware evolved, 16-bit systems adopted
segmented memory models.
Hardware memory controllers (MMUs) and
protection was embedded within CPUs.
With the advent of 32-bit computing, memory
protection schemes were also implemented in
hardware. The flat memory model was adopted.
Monolithic kernels were (and still are) the norm.
These schemes suit them well.
Memory/Security Models

The Intel x86 family of
processors provide at the
hardware level...



Security rings, controlling
access to certain features and
even specific opcodes. (Highly
unused.)
Embedded memory protection,
which tracks context switching
and protects address spaces.
Flags/modes to differentiate
between user and kernel code.
Language Based OS's
A language based operating system (LBOS) is a
computer OS that typically combines the technologies
of microkernels, VMs (or interpreters), and software
based protection schemes.
At the kernel level, simple models (such as the flat
memory model) are used, and the kernel is often small.
The kernel provides a safe interface to an augmented
VM, or a VM is loaded atop the kernel in user space.
Both core OS components and applications are then
built atop that VM.
Language Based OS's

Only the most low level components of the kernel
are implemented in languages like assembly or C.


Most of the kernel is implemented using a high
level language that executes within a core VM.


The VM/environment is also typically
implemented in a language like C.
IPC, scheduling, and even device drivers can be
implemented in this high level language.
Servers can be very robust, and simply restarted if
errors occur in many cases.
Advantages of a LBOS

Stability


The kernel, which
is the most
vulnerable part of
the system, is
small and very
isolated.
Servers may have
elevated
permissions, but
are still not in
kernel space.

Security


The VM/kernel
can implement
software
invariants and
security policies.
Type-safe
languages
eliminate the need
for protected
memory spaces.
Advantages of a LBOS

Development



Clean, easy to use
APIs.
Easily accessible
and safe bindings
to the kernel using
high level
concepts.
Consistency.

Compatibility


All but the core of
the kernel and VM
is platform
independent.
Additional
languages can be
easily bound with
compilers that
generate code
suitable for the
VM.
Disadvantages of a LBOS

Real time
applications.

Because it would
breach security,
unmanaged code
could not easily be
allowed. This
makes it difficult
to develop speed
critical
applications/proce
dures.

Legacy support.

Legacy/native
applications would
need to be
sandboxed by a
parent process or
emulation, losing
the advantage of
being native
machine
instructions.
Examples

Micro$oft's Singularity and Midori





Developed in Sing#, derived from Spec#, derived
from C#.
C/C++ HAL, debugging systems, and bootstrap.
Takes advantage of the CLR's unsafe mode for
Sing# features.
Uses ”software-isolated processes” (SIP) for
memory protection.
Static invariant analysis checking is performed on
source code.
Examples

JNode (previously JBSx)




Assembly bootstrap; no other low level languages
are used.
JIT translates Java bytecode to native instructions
as needed.
All software is written in Java; the only expection
is boot code.
Aims to be capable of running any Java
application.
Examples

Vita Nuova Holdings' Inferno

Kernel is a hybird microkernel/VM/hypervisor.

Applications are written in Limbo.



Kernel provides a standardized interface for
Limbo.
Designed for distributed architectures and provides
a consistent platform.
Runs both natively and within host
VMs/hypervisors.
The Future

LBOS's have open the doors on various new
concepts and models for computing.


The technology press has said that Micro$oft's
Midori is poised to supercede their Windows OS.


Enhanced stability and security.
Phew. Maybe PCs won't get infected every five
seconds anymore.
LBOS's lend themselves to rapid application
development (RAD).
The Future


Amatuer developers can more easily understand
and work with LBOS's.
Software deployment can be made safer and
easier with a centralized VM (the remote
repository model works well here).
And Questions?
?