ftl README

The project's README from github.com/nuta/ftl. As one markdown file: README.md.

FTL

FTL is a new operating system aiming to be an alternative OS in cloud environments to Linux/BSDs/Illumos.

    Container #1 (Linux compat)      Container #2 (custom OS)
┌────────────────────────────────┐     ┌─────────────────┐
│  VM space       VM space       │     │ VmSpace         │
│ ┏━━━━━━━━━━━━┓  ┏━━━━━━━━━━━━┓ │     │ ┏━━━━━━━━━━━━━┓ │
│ ┃            ┃  ┃            ┃ │     │ ┃             ┃ │
│ ┃   Linux    ┃  ┃   Linux    ┃ │     │ ┃ FTL native  ┃ │
│ ┃  Process   ┃  ┃  Process   ┃ │     │ ┃  unikernel  ┃ │
│ ┃            ┃  ┃            ┃ │     │ ┃             ┃ │
│ ┃ ╌╌╌╌╌╌╌╌ Linux ABI ╌╌╌╌╌╌╌╌┃ │     │ ┃╌╌╌╌╌╌╌╌╌╌╌╌╌┃ │
│ ┃   Linux compat library     ┃ │     │ ┃  Your own   ┃ │
│ ┃  (Process, VFS, TCP, ...)  ┃◀┄┄┐   │ ┃  custom OS  ┃ │
│ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ │ ┆   │ ┗━━━━━━━━━━━━━┛ │
└────────────────────────────────┘ ┆   └─────────────────┘
   ┆  Minimalistic system calls    ┆
   ▼                               ┆ user faults (syscalls)
╔════════════════════════════════════════════════════════╗
║                       Small kernel                     ║
║         (memory, vCPU, network multiplexing, ...)      ║
╚════════════════════════════════════════════════════════╝

Running locally

Install Rust toolchain, LLVM tools, and QEMU:

brew install rustup qemu        # macOS
apt  install rustup qemu-system # Ubuntu

Build and run:

./run.sh

You can start a specific Linux command:

./run.sh "/bin/echo Hello World"

To get an ISO image to run FTL on cloud:

ISO=1 ./build.sh

[!TIP]

Fun fact: ftl-os.org is served by FTL running on Google Compute Engine.

Design

Per-container userspace OS

Most of OS features such as the concept of Linux process is implemented in a userspace library, which we call "userspace OS". This design is similar to Exokernel where the traditional monolithic kernel features are moved to a userspace library (library OS).

FTL kernel provides hypervisor-like primitives: vCPU (thread), virtual address space (vmspace), virtual network, for example. The kernel does not interpret Linux system calls, and redirects them to the userspace OS's handler.

Each container instance has its own isolated userspace OS. This lets you run Linux containers on their own isolated Linux-like application kernels, similar to gVisor.

You can upgrade, add your own features, inject printfs for debugging, or optimize the userspace OS by simply starting a new container, without kernel programming or rebooting the machine.

Hypervisor-shaped kernel interface

FTL enables you to build your own OS best suited for your application. For example, the concept of Linux process is implemented in a userspace library, not in the kernel. VFS and TCP are also implemented in a library. This means the FTL kernel is more like a hypervisor, which multiplexes hardware resources and provides minimalistic interface like virtio.

FTL kernel interface is heavily inspired by hypervisors to narrow the attack surface, and to make userspace OS flexible. The difference from hypervisors is FTL uses the user mode to catch exceptions (not hardware-accelerated virtualization).

Linux compatibility layer

FTL is designed to support multiple personalities. The tier 1 personality is Linux which runs Linux executables without any modifications.

Foreign binary support (aka. ABI emulation) is a well-established technique that can be seen in modern operating systems, such as Windows Subsystem for Linux (WSL 1), FreeBSD's Linuxulator, and OSv, to name a few.

The key difference in FTL is that it is implemented as a userspace library, not as a in-kernel feature separate supervisor process. Each FTL container has its own isolated Linux-like application kernel.

We also aim to add our own personality to offer FTL's own system calls and features not available in Linux. That is, Linux ABI is just one of OS interfaces available on FTL.

Interceptors (planned)

Interceptor is a planned feature to control the behavior of OS components at runtime, just like middlewares in web frameworks. Rate limiting, security auditing, network packet routing, and live patching will be implemented as interceptors.

Batteries included

FTL will be more similar to BSD than Linux. We plan to provide FTL as an operating system bundled with userspace software integrated nicely.

License

FTL is dual-licensed under the MIT and Apache 2.0 licenses.

ftl (nuta/ftl)

Searching Database…

302 ·GitHub
What is this?FTL is a new operating system written in Rust that aims to be an alternative to Linux, BSD, and Illumos specifically for cloud environments.
Is FTL a monolithic kernel like Linux, or something different?No, the FTL kernel itself is small and hypervisor-shaped, exposing minimal primitives like vCPUs and virtual address spaces; actual OS features such as Linux system calls and TCP live in a userspace library called the 'userspace OS', similar to an Exokernel design.
How do I run FTL locally?Install the Rust toolchain, LLVM tools, and QEMU, then build and run the project; you can also start a specific Linux command or build an ISO image to run FTL on a cloud provider.
What do I need installed before building FTL?You need the Rust toolchain, LLVM tools, and QEMU for local emulation.
Can FTL already run unmodified Linux binaries today?FTL aims for a Linux binary compatibility layer so unmodified Linux executables run via userspace ABI emulation, but some planned features, like 'Interceptors' for runtime behavior control, are not implemented yet.
Is FTL meant for big cloud servers only, or can it run on smaller devices too?It's primarily aimed at cloud environments, but the project also keeps its footprint small enough to run on constrained devices.
What exactly is the 'userspace OS' in FTL?It's a userspace library that implements most traditional OS features (Linux process model, VFS, TCP) per container, so each container runs its own isolated, patchable application kernel without touching the real kernel.
How is this different from just using gVisor or a unikernel?Like gVisor, each container gets an isolated userspace kernel that handles Linux syscalls, but like a unikernel, you can patch or extend that userspace OS yourself without kernel programming or rebooting the machine.
Is FTL actually running anywhere in production?Yes, the project's own website, ftl-os.org, is served by FTL running live on Google Compute Engine as a real-world demo.
What does the project mean by 'batteries included'?The plan is to eventually ship FTL as a complete operating system bundled with integrated userspace software, making it closer to BSD's philosophy than Linux's minimal-core approach.
Creator
nuta
Size
1.5 MB
Stars
302
Age
8mo
Commits · 90 Days