public inbox for kernelnewbies@kernelnewbies.org
 help / color / mirror / Atom feed
* Rust: how to implement file_operations for a misc device?
@ 2025-09-23 16:47 Fabio
  2025-09-24 10:27 ` Greg KH
  0 siblings, 1 reply; 8+ messages in thread
From: Fabio @ 2025-09-23 16:47 UTC (permalink / raw)
  To: kernelnewbies

Hello,

brand-new kernel newbie here. I'm interested in the Rust side of the 
kernel. To get acquainted, I'm following the Linux Driver Development 
book, 3rd edition, also integrating it with modern documentation and 
best practices (or at least I hope so).

I'm developing the scull module on top of the 
`kernel::miscdevice::MiscDevice` trait. Where I'm stuck at is the lack 
of the `kernel::file::Operations` trait [1], that most online resources 
refer to. I need such trait to implement read and write operations for 
the misc device. AFAIU, this trait used to exist but it's no longer in 
the mainline codebase [2]. Also, `kernel::miscdevice::MiscdeviceVTable` 
is private inside the miscdevice module, so there's no way I can somehow 
extend it.

Is there any workaround for what I want to achieve, or is ioctl the only 
allowed interface to misc devices in Rust?

Thank you,
Fabio.

[^1]: 
https://rust-for-linux.github.io/docs/kernel/file/trait.Operations.html
[^2]: https://rust.docs.kernel.org/kernel/fs/index.html



_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-11-20 13:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-23 16:47 Rust: how to implement file_operations for a misc device? Fabio
2025-09-24 10:27 ` Greg KH
2025-11-14 10:42   ` Simple mutex_destroy question Lucas Tanure
2025-11-19 10:08     ` Lucas Tanure
2025-11-19 13:08       ` Raka Gunarto
2025-11-19 16:27     ` Billie Alsup (balsup)
2025-11-20 10:27       ` Lucas Tanure
2025-11-20 13:43         ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox