Skip to content

feat(kernel): add misc rust-null and split userspace/ - #1

Merged
bunnysi merged 2 commits into
nextfrom
feat/kernel-misc-device
Sep 14, 2026
Merged

bunnysi merged 2 commits into
nextfrom
feat/kernel-misc-device

Conversation

@1907

@1907 1907 commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Move the crate under userspace/ (workspace root).
  • Add C misc module kernel/rust_null.c: misc_register as /dev/rust-null, fops copied from null_fops (read 0, write count, llseek always 0).
  • Add RfL MiscDevice source in kernel/rfl/ for a later CONFIG_RUST=y kernel (not built by make -C kernel).
  • /dev/null vs /dev/rust-null tests skip when the node is missing.

Scope

  • One focused task
  • No unrelated refactor or formatting churn

Quality gate

  • Tests added/updated
  • cargo fmt --check, clippy -D warnings, cargo test --locked passed
  • make -C kernel produced rust_null.ko (not loaded)
  • README/docs/CHANGELOG updated
  • No secrets; public repo surface clean
  • Independent review: passed (no security/logic blockers)

Verification

  • cargo test --locked: contract 6, against /dev/null 4, compare_devices 6 skip-ok, doctest 1
  • echo hello | cargo run -p rust-null --example discard --locked exit 0
  • make -C kernel on 6.12.107+deb13-amd64: rust_null.ko vermagic matches; not insmod
  • /dev/rust-null absent after the build

Risk and rollback

Distro kernels still cannot compile the .rs. make load is opt-in and was not run. Revert the squash if the layout is wrong.

evie added 2 commits September 14, 2026 06:06
Move the crate under userspace/. Add a C misc module whose
file_operations copy null_fops, and RfL MiscDevice source for a
CONFIG_RUST=y kernel. compare_devices skips without /dev/rust-null.
The public README is a product page; one sentence that this is
WIP while learning RfL, not a process dump.
@1907
1907 changed the base branch from main to next September 14, 2026 04:27
@bunnysi
bunnysi merged commit a32dd82 into next Sep 14, 2026
1 check passed
@bunnysi
bunnysi deleted the feat/kernel-misc-device branch September 14, 2026 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants