Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best linux distribution to do Kernel Module programming

I want to do kernel module programming. But, all sources tell that linux distributions patch the original kernel and that module codes might not run on them. If this is true, what should i do.I tried making lfs using ubuntu but errors cropped up at almost every step. I saw somewhere that arch, gentoo, Ubuntu Server without any packages selected during the installation, slackware, susestudio etc. are vanilla distributions. So, can i use them for module programming?

Please suggest keeping in mind that i need a GUI in the distribution.

Can this be followed?
PS: I have a intel core i3 processor and will be running the distros on vmware workstation.

like image 483
AvinashK Avatar asked Sep 16 '12 19:09

AvinashK


People also ask

Which Linux distro is best for kernel development?

Fedora. Fedora is the favorite distro of Linus Torvalds, the creator of the Linux kernel. He loves it for its ease of use and support for PowerPC.

Which distro does Linus Torvalds use?

In 2008, Torvalds stated that he used the Fedora Linux distribution because it had fairly good support for the PowerPC processor architecture, which he favored at the time. He confirmed this in a 2012 interview.

Is Linux kernel the same for all distributions?

The kernel is a central project, and is nominally the same in each distro, but most distros customize it a bit. And the extra software doesn't just make the kernel more user friendly, it makes it usable at all.


1 Answers

If you want to program kernel modules then it doesn't matter which distribution you choose. You will need to be able to recompile the kernel from source and install a new kernel yourself. Even just for a kernel module you'll want to be able to compile the latest kernel and develop against that, otherwise you won't be able to get the module accepted in to mainline.

An alternative if the module is not to be released is to develop against a particular kernel version. In this instance then the choice of distribution should be chosen based on the target for the module - not the development environment.

So pick a distribution based on what you like: 1) Desktops - (GNOME, KDE, other) 2) Ease of use - (Ubuntu, Fedora, etc vs Arch, Gentoo) 3) Cutting edge vs Stable (Arch, Fedora vs Ubuntu vs Debian, Red Hat, CentOS)

Then head off to kernelbewbies to learn a bit about getting started with kernel programming (where to get the source, how to compile it). Then read Greg Kroah-Hartman's excellent book on linux device drivers. The interfaces will have changed (it's written about version 2.6 of the kernel and version 3.6 is currently being worked on). It can be found online here

You'll also want to learn how to use git. And more importantly how to use git to generate a patch and email it without messing it up! I don't have a website for this but a bit of googling will help.

like image 175
dave Avatar answered Oct 08 '22 15:10

dave