Skip to content

nccgroup/freebsd-kernel-module-rust

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

FreeBSD kernel module in Rust

This repo is mostly an updated version of https://github.com/johalun/echo

It has been updated to Rust 2021 with new bindings to the kernel headers and tested with Rust version 1.64.0-nightly (b1dd22e66 2022-07-09)

For more information, see the accompanying blog post.

Setup

  • Install Rust via Rustup
  • rustup component add rust-src
  • Generate the kernel bindings:
cargo build -p kernel-sys --target x86_64-unknown-freebsd

Run

./build.sh
sudo make load
echo "hi rust" > /dev/rustmodule
cat /dev/rustmodule
sudo make unload

Licence

This source code is provided under the terms of the BSD 2-Clause licence and is based on public-domain work by Johannes Lundberg.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages