Giter VIP home page Giter VIP logo

r9's Introduction

r9

Plan 9 in Rust

R9 is a reimplementation of the plan9 kernel in Rust. It is not only inspired by but in many ways derived from the original Plan 9 source code.

Building

We use cargo and the xtask pattern to build the kernel.

To build r9 for x86_64, we assume you have cloned the git repository somewhere convenient. Then simply change into the top-level directory and, cargo xtask build --arch x86-64.

To build for aarch64, run cargo xtask build --arch aarch64 (Currently only Raspberry Pi 3 is supported).

There are other useful xtask subcommands; run cargo xtask help to see what is available.

Right now, r9 is not self-hosting.

Runtime Dependencies

cargo xtask dist, which cargo xtask qemu and cargo xtask qemukvm depend on, requires llvm-objcopy. This is expected to live in the rust toolchain path. If you get No such file or directory (os error 2) messages, then install llvm separate from the rust toolchain and set:

OBJCOPY=$(which llvm-objcopy) cargo xtask qemukvm

If No such file or directory (os error 2) messages persist, check to ensure qemu or qemu-kvm is installed and the qemu-system-x86_64 binary is in your path (or qemu-system-aarch64 in the case of aarch64).

Running on Qemu

R9 can be run using qemu for the various supported architectures:

Arch Commandline
aarch64 cargo xtask qemu --arch aarch64 --verbose
x86-64 cargo xtask qemu --arch x86-64 --verbose
riscv cargo xtask qemu --arch riscv64 --verbose

Running on Real Hardware™️

R9 has been run on the following hardware to a greater or lesser degree:

  • Raspberry Pi 4 (Gets as far as printing 'r9' via the miniuart)

Raspberry Pi, Netboot

Assuming you can set up a TFTP server (good luck, it's incredibly fiddly, but for what it's worth, dnsmasq can work occasionally), and assuming the location of your netboot directory, you can build and copy the binary using the following command:

cargo xtask dist --arch aarch64 --verbose && cp target/aarch64-unknown-none-elf/debug/aarch64-qemu.gz ../netboot/kernel8.img

This copies a compressed binary, which should be much faster to copy across the network.

The Raspberry Pi firmware loads config.txt before the kernel. Here we can set which UART to use, amongst other things. The following contents will set up to use the miniuart:

enable_uart=1
core_freq_min=500

r9's People

Contributors

dancrossnyc avatar erde74 avatar gmacd avatar hdonnay avatar jdrouet avatar mraerino avatar orangecms avatar requaos avatar sevki avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.