Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
Cosmos
Cosmos is an operating system "construction kit". Build your own OS using managed languages such as C#, VB.NET, and more!
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Here's an example [1] of a device driver in C#. It is possible. It is also not recommended.
[1] https://github.com/VollRagm/KernelSharp
You can use UI4ETW[0] to capture an event trace when the mouse freezes. You may need to install the Windows SDK or Visual Studio to interpret the results, though.
[0] https://github.com/google/UIforETW
> How would this work?
Don't know exactly what you're asking.
> And why would it be a better idea?
Poorly written device drivers are a significant attack vector. It's one of the reasons Linux is now exploring using Rust for its own device drivers.[0] You may be asking -- why Rust and not some other language? Rust has many of the performance and interoperability advantages of C and C++, but as noted, makes certain classes of memory safety issues impossible. Rust also has significant mindshare among systems programming communities.
[0]: https://rust-for-linux.com
> Rust type system doesn't help when the data resides in a shared memory segment accessed by multiple processes.
This isn't quite true. You can provide a safe abstraction that involves cross-process locking APIs. https://github.com/elast0ny/shared_memory/blob/HEAD/examples... is an example using a mutex guard.
Rust's type system helps more in some cases than others but you can get at least some help from it almost all of the time.
Like this, for a possible example,
https://github.com/WildernessLabs/Meadow.Foundation
I didn't realise that. Then again, I only experimented with AOT executables quite briefly. Perhaps Cosmos[1] stuck in my head more than what I read about AOT dotnet applications.
[1]: https://github.com/CosmosOS/Cosmos