Can I able to modify the kernel of ubuntu OS, If yes please share the steps to change. or Can I able to include my own code in kernel.
Asked
Active
Viewed 33 times
-1
-
1Sure, but... why do you want to modify the kernel? Kernel programming is a wide topic, and not something you learn in a Q&A site. – vidarlo Mar 27 '24 at 09:39
-
@vidarlo let's assume the OP has a good reason to do so, until proven otherwise... – Artur Meinild Mar 27 '24 at 09:42
-
I'm perhaps assuming this is some kind of X-Y question :) – vidarlo Mar 27 '24 at 09:48
1 Answers
1
You download the source code, add your modifications and then compile it.
To get the source code for the Ubuntu kernels, you can either do:
sudo apt install linux-source-<insert.kernel.version>
Or the following (if you have deb-src
enabled in your repos):
sudo apt source linux-image-<insert.kernel.version>-generic
Adjust the commands for the kernel version you want.
After you have done your modifications, build and test the new kernel according to the official documentation on the Ubuntu Wiki.

Artur Meinild
- 26,018