Skip to content

lumosgatsby/wsl-module-init

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Как написать эти модули в wsl2?

Установка

  1. Не хватает source code. А без source code компилировать нельзя.

  2. Загружаем source code. Компилируем.

https://learn.microsoft.com/en-us/community/content/wsl-user-msft-kernel-v6

uname -r
# Download version `linux-msft-wsl-*` as in your system. Here pwd=~/source/
git clone https://github.com/microsoft/WSL2-Linux-Kernel.git --depth=1 -b linux-msft-wsl-6.6.87.1 WSL2-Linux-Kernel-6.6.87.1
# Build the kernel. Here pwd=~/source/WSL2-Linux-Kernel-6.6.87.1
make -j$(nproc) KCONFIG_CONFIG=Microsoft/config-wsl
# Install the kernel modules and headers
sudo make modules_install headers_install

# Reference `/lib/modules/$(uname -r)+/build` for work
  1. Enable cpp IntelliSence support

add to settings.json

"C_Cpp.default.includePath": [
    "/lib/modules/6.6.87.1-microsoft-standard-WSL2+/build/include"
]

Пример

See Hello, world

About

Setup wsl for writing modules

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published