firefly

module
v0.0.0-...-0effba1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2023 License: BSD-3-Clause

README

Firefly

Firefly is a research OS inspired by Plan 9 from Bell Labs. Firefly's planned name was Serenity, but SerenityOS got there first. This project is unrelated to SerenityOS.

Note that Firefly is an early prototype and is not yet ready for use.

This repository consists of:

  • the Firefly kernel in kernel
  • the Firefly bootloader (forked from bootloader) in bootloader
  • user code that runs on Firefly in user
  • code shared between the kernel, bootloader, and userspace in shared
  • code to manage the Bazel build system in bazel
  • tools to manage the repository in tools
  • third-party code is vendored using bazel run //tools/vendor-deps into vendor

Firefly is intended for executing cloud-native containerised server software. As a result, there are no plans to add a graphical user interface, device drivers, or a concept of users. Instead, the priority is to support userland applications on a virtual machine, with strong separation between processes. Firefly will provide a highly stable ABI, with syscalls providing the sole interface between userland processes and the kernel.

Building Firefly

Firefly is built using the Bazel build system. You will need to install Bazel to build Firefly. It is recommended that you use Bazelisk, rather than using Bazel directly, to ensure the right version of Bazel is used.

While Bazel manages most of the build, some tools are currently used from the host for now. This currently consists of:

  • Clang (expected in /usr/bin/clang)
  • LLD (expected in /usr/bin/ld)

Once Bazel and the above host tools are prepared, the following commands are common:

  • bazel build //kernel: Build the kernel binary.
  • bazel build //bootloader: Build the bootloader binary.
  • bazel build //:image: Build a bootable Firefly disk image.
  • bazel build //...: Build all code, documentation, and lints.
  • bazel test //...: Run all tests.
  • bazel run //tools/update-deps: Update managed dependencies.
  • bazel run //tools/vendor-deps: Vendor managed dependencies from deps.bzl.
  • bazel run //:qemu: Build a bootable disk image and run it in Qemu.

FAQ

Why make a new OS?

Firefly is primarily an experiment in producing equivalent capabilities for executing cloud-native applications as modern Linux, with a dramatically smaller attack surface and clearer security outcomes. I reckon creating a new OS from scratch will require less work than stripping the irrelevant functionality from Linux.

Why write the kernel in Rust?

A modern OS deserves a modern programming language. Rust provides more modern functionality like package management, code modules, integrated unit tests, putting it far ahead of C in usability. Furthermore, Rust has strong safety features without compromising runtime performance. This is perfectly suited to an OS kernel.

Directories

Path Synopsis
bazel
gofmt
Command gofmt checks whether Go code is formatted, exiting with an error if not.
Command gofmt checks whether Go code is formatted, exiting with an error if not.
tools
bootimage
Command bootimage turns the bootloader and kernel into a bootable disk image.
Command bootimage turns the bootloader and kernel into a bootable disk image.
check-deps
Command check-deps uses package vendeps to check external dependencies for issues.
Command check-deps uses package vendeps to check external dependencies for issues.
crate-features
Command crate-features analyses the Rust crates in the repository for unstable features, printing a summary.
Command crate-features analyses the Rust crates in the repository for unstable features, printing a summary.
crate-lints
Command crate-lints checks that all Rust crates in the repository configure a mandatory set of lints.
Command crate-lints checks that all Rust crates in the repository configure a mandatory set of lints.
cratesio
Package cratesio simplifies calling the Crates.io API.
Package cratesio simplifies calling the Crates.io API.
gomodproxy
Package gomodproxy simplifies fetching data from a Go module proxy.
Package gomodproxy simplifies fetching data from a Go module proxy.
plan
Command plan provides functionality to process syscall and structure information described in Plan documents.
Command plan provides functionality to process syscall and structure information described in Plan documents.
plan/ast
Package ast contains the types representing Plan syntax trees.
Package ast contains the types representing Plan syntax trees.
plan/format
Package format contains functionality to format a Plan document into the canonical style.
Package format contains functionality to format a Plan document into the canonical style.
plan/html
Package html uses templates to render a Plan document as HTML documentation.
Package html uses templates to render a Plan document as HTML documentation.
plan/lexer
Package lexer includes functionality for scanning a Plan source file into a sequence of tokens.
Package lexer includes functionality for scanning a Plan source file into a sequence of tokens.
plan/parser
Package parser contains a parser that takes a sequence of Plan tokens and produces an abstract syntax tree.
Package parser contains a parser that takes a sequence of Plan tokens and produces an abstract syntax tree.
plan/rust
Package rust uses templates to render a Plan document as Rust code.
Package rust uses templates to render a Plan document as Rust code.
plan/token
Package token contains constants for the lexical tokens in the Plan interface description language and types to compactly store a position in a Plan source file.
Package token contains constants for the lexical tokens in the Plan interface description language and types to compactly store a position in a Plan source file.
plan/types
Package types contains the Plan interpreter, which is used to validate a Plan source file's structure and contents, then store the result in a more constrained representation.
Package types contains the Plan interpreter, which is used to validate a Plan source file's structure and contents, then store the result in a more constrained representation.
simplehttp
Package simplehttp is a very simple HTTP client helper library.
Package simplehttp is a very simple HTTP client helper library.
starlark
Package starlark provides helper functionality for processing Starlark files.
Package starlark provides helper functionality for processing Starlark files.
update-deps
Command update-deps helps identify and perform updates to Firefly's dependencies.
Command update-deps helps identify and perform updates to Firefly's dependencies.
vendeps
Package vendeps provides functionality for managing vendored external dependencies.
Package vendeps provides functionality for managing vendored external dependencies.
vendor-deps
Command vendor-deps uses package vendeps to vendor external dependencies into the repository.
Command vendor-deps uses package vendeps to vendor external dependencies into the repository.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL