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

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

  • Comments

    Be the first to comment!

    Similar Projects

    Kanidm - Account Policy by firstyear

    Project Description

    Kanidm is a identity ...


    toniowm by fabriziosestito

    toniowm is yet another window manager written i...


    A Flight Dynamics Library written in Rust with an Entity Component System architecture by vcuadradojuan

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


    Waysettings by dspinella

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


    (Rust) Manage systems in NetBox using NetBox-Sync by chock

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


    Linux incarnation of the Party Parrot by rsimai

    Project Description

    Lesser on the coding s...


    Extract generic testing framework from Linux Test Project code base by acervesato

    Project Description

    The Linux Test Projec...


    Authenticated hashes for BTRFS by dsterba

    Project Description

    Implement a checksum ...


    Generic text file preprocessor using custom syntax for define include ifdef by mdati

    Project Description

    Scope of this project...


    Avahi Integration and Network Connection by vojha

    Avahi Integration and Network Connection

    ...


    early stage kdump support by mbrugger

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


    Authenticated hashes for BTRFS by dsterba

    Project Description

    Implement a checksum ...


    Model checking the BPF verifier by shunghsiyu

    Project Description

    BPF verifier plays a ...