• We did not send an email asking for donations - please read this post.

Changing the kernel

linuxnewbie_456

New Member
Joined
Sep 14, 2022
Messages
1
Reaction score
0
Credits
14
I have a university assignment where I'm supposed to propose and implement a patch to the kernel. It could be something related to the scheduling algorithm or the file system, for instance. We don't have to necessarily improve the OS's performance, but the changes must do something that can be discussed and analyzed. I should also note that it is a consensus among students who've taken this particular course that the project is unfair and cannot be completed adequately.
I have literally no idea what to do. Any tips/suggestions?
 


dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
1,559
Reaction score
1,177
Credits
9,920


man patch <- can be helpful.


If you've never compiled a kernel before, and you don't know what all is involved...


as far as step by step instructions...

 

gvisoc

Well-Known Member
Joined
May 29, 2020
Messages
445
Reaction score
534
Credits
4,554
I have a university assignment where I'm supposed to propose and implement a patch to the kernel. It could be something related to the scheduling algorithm or the file system, for instance. We don't have to necessarily improve the OS's performance, but the changes must do something that can be discussed and analyzed. I should also note that it is a consensus among students who've taken this particular course that the project is unfair and cannot be completed adequately.
I have literally no idea what to do. Any tips/suggestions?

I actually did modify the kernel!

Do you need to get your patch to just run locally? Keep reading. Do you need to send actual patches to the maintainers? Scroll down under.
  • Begin following this to start and set up your dev environment --> https://kernelnewbies.org/FirstKernelPatch
    • The above link will get you up and running and will provide you with the essential technical knowledge you need for the project
    • you will learn to get the source, configure your machine for the job, build the kernel, install the kernel (unmodified)
    • then they will guide you through modifying a device driver with a very simple line to write a message in the logs, repeate the above and verify your changes are running on your machine
    • You will also get some extra things done in case you want to send actual patches to the linux developers.
Another discussion will be to propose a meaningful change. Browsing the content of https://kernelnewbies.org you can get some ideas, as they usually get that question asked. There are patches and modifications needed in all areas. I will be thinking of something "academic", but for now, with the above steps to reproduce you already have some food for thought and work to do.

I hope it helps.

---- If you need to send the actual patch to the maintainers, an awesome and descriptive (and demistifying) resource is this talk by Greg KH, that can give you a practical idea on what to look for, also, and more dynamic than reading the above resources:

 
Last edited:

gvisoc

Well-Known Member
Joined
May 29, 2020
Messages
445
Reaction score
534
Credits
4,554
One thing you can do is change a device driver to be loaded lazily, or vice-versa. I think this is a common decision for device drivers to go through, i.e., if the kernel initializes the device on boot or if it waits until the first program needs to access it.

If you have a raspberry pi, the simplest (and coolest) thing you can do is to make your own GPIO device driver to output some runtime information of the kernel into a set of RGB leds. That is cool, physical, and probably you can check with your project tutor if it makes the cut. But I'd go with it as an idea.

Or a driver for a button, and when you press the button, the driver or the kernel outputs a log. That goes through a lot of core kernel concepts.
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Members online


Top