I have worked with ubuntu operating system for a year and have been doing kernel development for the past 3 months.It works well in ubuntu but is it possible to do linux kernel development through wsl .If so how...
-
4WSL doesn't really run a full Linux kernel, so I don't believe you can do kernel dev and testing via WSL– Thomas Ward ♦Jul 26, 2019 at 16:07
-
2@ThomasWard WSL2 now runs a custom kernel using Hyper-V technology. I do agree though that for (non-Microsoft) kernel development it's not ideal though, so you should post that as an answer... ;-)– FabbyJul 27, 2019 at 8:00
-
In general, you can do kernel/kernel module development on WSL 2 reasonably well, if you aren't trying to develop device drivers (obviously, given the Hyper-V environment). On the other hand, there are certain other limitations because WSL 2 distros run effectively in containers; as such, you can't see kernel threads in PS, for example, and the root fs kernel threads see isn't the root fs of the distro you're working in. See github.com/microsoft/WSL/issues/4425 for more.– CerebrateNov 7, 2019 at 17:53
1 Answer
You can do kernel development with WSL 1 perfectly if you have these shortcomings in mind:
- You can not debug the compiled kernel image in WSL itself; no problem if you target e.g. a raspberry pi or similar or your kernel runs in a VM
- There is a 50% performance penalty that affects compilation of large projects
-
2"There is a 50% performance penalty that affects compilation of large projects" Can you edit to provide a source and/or explanation for this? Aug 29, 2019 at 11:38