3 ms·
WIL is user mode, for applications. Drivers will use Kernel Mode Driver Framework or User Mode Driver Framework. UMDF has a COM style API. C++ has been usable
by becurious 3y ago
WIL is user mode, for applications. Drivers will use Kernel Mode Driver Framework or User Mode Driver Framework. UMDF has a COM style API.
C++ has been usable in the Windows kernel for a long time but you need to make sure that code ends up in the correct PE segment types for pageable and non pageable code and that there are no hidden gotchas for features like exception unwinding and that new can use paged or non paged pool appropriately. Same for Rust: getting to a nostd etc that is compatible with kernel use.
I think there’s a strong case that many drivers could be written with either a user mode driver framework or a small VM. Most of the hardware devices I’ve worked with we just need fast transfers of data to user mode buffers so our application can handle it, and the code is mostly boilerplate framework code plus setting up device registers to set up DMA transfers. I don’t see why that couldn’t be handled with say an EBPF or WASM equivalent byte code.
- pjmlp 3y agoWIL is used on the kernel by some teams. https://community.osr.com/discussion/291326/the-new-wil-library-for-c-code-in-drivers https://community.osr.com/discussion/291326/the-new-wil-libr... > wil was primarily developed by the Windows shell team for writing usermode code, but the NDIS and Bluetooth teams have contributed some small kernel-specific features. Here's a few examples of how you can use wil in your kernel driver: