Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/annsanns/wsl-kernel-module-template
A simple linux kernel module template running under WSL
https://github.com/annsanns/wsl-kernel-module-template
linux-kernel linux-module wsl wsl-kernel wsl2 wsl2-kernel
Last synced: 8 days ago
JSON representation
A simple linux kernel module template running under WSL
- Host: GitHub
- URL: https://github.com/annsanns/wsl-kernel-module-template
- Owner: AnnsAnns
- License: eupl-1.2
- Created: 2023-05-31T12:37:54.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-05-31T13:26:18.000Z (over 1 year ago)
- Last Synced: 2024-12-11T01:05:11.020Z (13 days ago)
- Topics: linux-kernel, linux-module, wsl, wsl-kernel, wsl2, wsl2-kernel
- Language: C
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wsl-kernel-module
A simple WSL kernel module meant as a demonstration on how to develop linux kernel modules under WSL.
## Version
This was developed for WSL2 Kernel 5.15.19.X but should work on all versions as long as you up/downgrade the submodule.
## How to use
Please note that you might have to change the WSL submodule branch depending on your WSL instance. It should match whatever is returned when typing:
```bash
uname -r
```---
### Compile / Configure Kernel
Copy your config over:
```bash
zcat /proc/config.gz > .config
```Compile the kernel:
```bash
make -j $(nproc)
```Install:
```bash
sudo make -j $(nproc) modules_install
```---
### Compile Module
```bash
cd kernel_module
make
```---
Congratulations, you should now have a working kernel module called main.ko. Try loading it via:
```bash
sudo insmod main.ko
```
and look at what it prints via:
```bash
dmesg
```