Project Description

Rust language is on the way to enter linux kernel, use this hackweek to explore and learn what this could bring us (or not).

Goal for this Hackweek

No fixed goals, learn as much as possible, but some topics for inspiration:

  • set up compilation and testing environment
  • try to understand some aspects of the implementation
    • locking primitives
    • unsafe memory operations
    • passing C <-> rust data structures
  • higher level aspects
    • limitations of current implementation, eg. can other subsystems be adapted for rust
    • differences when designing interconnected data structures C vs rust
  • example drivers and code
    • analyze existing example driver
    • try to write own
    • analyze generated assembly object code

Resources

Skill level:

  • rust coding - beginner to expert
  • rust enthusiasm - skeptic to fanatic
  • linux kernel - intermediate to expert

Howtos

Rust

You can use rustup tool to install the versions manually (package available in openSUSE), we require 1.61, this is also available in openSUSE.

# rustup toolchain install 1.61
# rustup default 1.61
# rustup toolchain list
stable-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu
1.61-x86_64-unknown-linux-gnu (default)

The linux+rust support

Linux

Checkout the Rust-for-Linux git tree, all make commands need to be run as make LLVM=1 so the llvm support is detected even for configuration phase

  • make LLVM=1 defconfig
  • scripts/enable CONFIG_RUST and make LLVM=1 oldconfig
  • make LLVM=1 menuconfig, navigate to General to enable rust and to Kernel hacking to enable all examples
  • make LLVM=1 -j 16 to start build

Drivers, config options:

  • ANDROIDBINDERIPC_RUST
  • GPIOPL061RUST
  • SAMPLES_RUST -- check all
  • RUST_* namespace, various safety and debugging options

Looking for hackers with the skills:

rust linux kernel

This project is part of:

Hack Week 21

Activity

  • 8 months ago: fanyadan liked this project.
  • 8 months ago: jzerebecki liked this project.
  • 8 months ago: dmdiss liked this project.
  • 8 months ago: dsterba added keyword "kernel" to this project.
  • 8 months ago: dsterba added keyword "rust" to this project.
  • 8 months ago: dsterba added keyword "linux" to this project.
  • 8 months ago: dsterba started this project.
  • 8 months ago: dsterba originated this project.

  • Comments

    Be the first to comment!

    Similar Projects

    Build a Unikernel that runs WebAssembly by flavio_castelli

    [comment]: # (Please use the project descriptio...


    Make iguana-workflow to support multiple container frontends by oholecek

    Project Description

    Iguana is an attempt ...


    Tafl by mrohrich

    [comment]: # (Please use the project descriptio...


    Rewrite the D-Installer CLI by IGonzalezSosa

    Project Description

    Before the openSUSE 2...


    The world crab by cdywan

    The world is changing. A mouse got lose and fel...


    Authenticated hashes for BTRFS by dsterba

    Project Description

    Implement a checksum ...


    Encrypted volumes in elemental-toolkit by flonnegren

    [comment]: # (Please use the project descriptio...


    Testing and adding GNU/Linux distributions on Uyuni by juliogonzalezgil

    Join the Gitter channel! [https://gitter.im/uy...


    Improve Qualcomm SOC msm8994/msm8992 kernel mainline support by pvorel

    Project Description

    Due previous hackweek...


    Create a DRM driver for VGA video cards by tdz

    Yes, those [VGA video cards](https://en.wikiped...


    Modular kernel packaging by mwilck

    Project Description

    Create a PoC for a mo...


    Explore Steam Deck issues in openSUSE Tumbleweed by tschmitz

    [comment]: # (Please use the project descriptio...


    How software creation process can save energy and CO2 emissions by acervesato

    [comment]: # (Please use the project descriptio...


    Improve Qualcomm SOC msm8994/msm8992 kernel mainline support by pvorel

    Project Description

    Due previous hackweek...