I want to compile and later modify a Linux kernel code but I cannot do it by installing and running separate Linux system like Ubuntu and then compiling this kernel on linux system as I am not able to work on full fledged Linux system(Laptop hardware problems).I want to do it on Windows 7.Is there a way that I can do it?
WSL 2 not only loads a native Linux Kernel, the image of the Linux Kernel is in the directory C:\WINDOWS\System32\lxss\tools\kernel, but it also gives us the option of loading a customized Linux kernel. That's right, we can compile and customize our own kernel to be loaded into WSL 2.
The kernel doesn't compile itself -- it's compiled by a C compiler in userspace. In most CPU architectures, the CPU has a number of bits in special registers that represent what privileges the code currently running has. In x86, these are the current privilege level bits (CPL) in the code segment (CS) register.
The Linux kernel source tree has different files in some directories whose names only differ in capitalization, so unpacking the source tree would have to happen in a directory where the POSIX compatibility mode was active. Furthermore, you need a cross compiler targetting Linux, and an appropriate shell environment.
It can be done within the Cygwin environment if so desired, but I suspect it is significantly easier to run a Linux virtual machine, or CoLinux.
i Think you are talking about this have a look on this site they provide a way to compile and modify and infact build a new kernel in Visual Studio hope it will help you
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With