Skip to content

RFC rust abstractions for interacting with sysfs

Daniel Sedlak rust-for-linux 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3rust: kernel: types: add mode wrapperrust/kernel/types.rs+17 -02 replies
2/3rust: kernel: kobject: basic sysfs implementationrust/kernel/kobject.rs rust/kernel/lib.rs+273 -03 replies
3/3samples: rust: add kobject samplesamples/rust/Kconfig samples/rust/Makefile samples/rust/kobject_example.rs+75 -02 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/3] rust abstractions for interacting with sysfs

Hello,
For now, there are no facilities for the Rust side to tune modules written in Rust in runtime or for just simple debug output/statistics from the module. For exactly this purpose, the C has the sysfs. In this patch series, I implemented a minimal sysfs wrapper utilizing kobject API.

I would like to collect your thoughts on whether:
- Do we want something like this in the rust part of the kernel?
- Do we want to support all sysfs capabilities?

I implemented a sample to present the API I have chosen for the Rust part. It is a straightforward example that does not represent all capabilities of the sysfs. The documentation will be potentially improved, but I would like to first settle the abstractions.

Thank you

Daniel

Daniel Sedlak (3):
rust: kernel: types: add mode wrapper
rust: kernel: kobject: basic sysfs implementation
samples: rust: add kobject sample

 rust/kernel/kobject.rs          | 271 ++++++++++++++++++++++++++++++++
 rust/kernel/lib.rs              |   2 +
 rust/kernel/types.rs            |  17 ++
 samples/rust/Kconfig            |   8 +
 samples/rust/Makefile           |   1 +
 samples/rust/kobject_example.rs |  66 ++++++++
 6 files changed, 365 insertions(+)
 create mode 100644 rust/kernel/kobject.rs
 create mode 100644 samples/rust/kobject_example.rs

base-commit: 40384c840ea1944d7c5a392e8975ed088ecf0b37

Signature · 1 line
2.47.1