huangchong 写了: 2024年 7月 19日 18:44
理论上 能用c就应该能用rust吧?
While possible, writing a Windows kernel module in Rust presents some challenges:
* **No Official Support:** Microsoft doesn't officially support Rust for kernel driver development.
* **Limited Ecosystem:** The tooling and libraries for Rust kernel development in Windows are still under development.
However, there are resources available if you're interested in exploring further:
* **Experimental Framework:** Microsoft has an experimental framework called `windows-drivers-rs` that provides some basic functionalities for building Windows drivers in Rust [
https://github.com/microsoft/Windows-ru ... er-samples](
https://github.com/microsoft/Windows-ru ... er-samples).
* **Community Project:** Another project, `windows-kernel-rs`, offers safe abstractions on top of the Windows Kernel API for Rust [
https://github.com/StephanvanSchaik/windows-kernel-rs](
https://github.com/StephanvanSchaik/windows-kernel-rs).
Here are some things to consider before using Rust for Windows kernel modules:
* **Development Complexity:** Expect a steeper learning curve compared to using C or C++ due to the lack of official support and a less mature ecosystem.
* **Limited Debugging Tools:** Debugging kernel modules written in Rust might be more challenging compared to traditional languages.
* **Community Resources:** While there are community projects, they might have less documentation and support compared to established languages.
If you're new to kernel development or require a stable solution, using C or C++ might be a better option. But if you're comfortable with the challenges and want to explore Rust for kernel development, the resources mentioned above can be a starting point.