7

Which is the best light weight distro for learning linux kernel development. It should have lot of debugging and profiling tools available along with it :)

user361697
  • 1,093
  • 2
  • 12
  • 21

6 Answers6

9

LFS. Then install every debugger and profiler you can find.

Mizipzor
  • 51,151
  • 22
  • 97
  • 138
8

I've heard Linus himself uses Fedora. I'd recommend Gentoo which lets (intends) for you to hand customize your kernel, it's the perfect setting for it (and I've spent many hours squeezing out every last bit of performance for the fun of it).

Naturally Ubuntu is my preferred distro, but you may have trouble if you start hijacking and removing expected kernel features. Gentoo won't complain, and doesn't expected them around to begin with.

Matt Joiner
  • 112,946
  • 110
  • 377
  • 526
  • The Ubuntu kernel carries a fair number of patches for things like UUID handling and other such magic. I run vanilla kernels on my gentoo box all the time without problems. – stsquad Aug 17 '10 at 15:25
  • Fedora is also my favorite, damn stable. – Atiq Rahman Apr 21 '13 at 08:48
7

I've enjoyed using Gentoo for fiddling around with the kernel.

Ben S
  • 68,394
  • 30
  • 171
  • 212
4

The distro does not really matter. It is what you want to do with the kernel and do development/testing its feature.

Here are few things to do.

a. Turn on the kernel debugging and the logging options. Those would definitely help you in debugging. see useful linux kernel debug options to turn on

b. Getdebuggers tool like Valgrind that checks for memory leak. See doc like https://www.kernel.org/doc/Documentation/kmemleak.txt

c. Found a good editor for editing. I don't want to start a vim vs emacs war. It is really a personal preference, just make sure you follow the linux kernel coding style guidelines. https://www.kernel.org/doc/Documentation/CodingStyle

d. Get familiar with the log systems and proc system, as they provide valuable information.

e. Read the documentation in the directory /usr/src/linux/Documentation Very good starting point to understand the kernel

Community
  • 1
  • 1
g5thomas
  • 315
  • 1
  • 4
  • 14
2

The distro probably doesn't make much difference since you'll be working on your own kernel and not the "kitchen sink" kernel the distros tend to provide with a bunch of patches in most cases.

If you're doing kernel development work then I suppose you want a distro that boots quickly, something like puppy might be ideal here and do your actual coding from something like Ubuntu.

eneville
  • 61
  • 1
0

Buildroot

Buildroot is a set of scripts that generates tiny distros with rootfs images smaller than 10MiB.

It downloads everything from source and compiles it, so it is trivial to patch packages up.

The generated images are so tiny, that it becomes possible to understand the entire userland setup, which will make it easier to focus on the kernel.

Advantage over LFS: everything is fully automated. Because of this, Buildroot is used professionally in large organizations.

I have created this setup to automate things as much as possible: https://github.com/cirosantilli/linux-kernel-module-cheat

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985