views:

2182

answers:

10

In my Operating Systems class we are looking to modify a Linux kernel with some simple system calls of our own in C.

What would be a good distro suited for this purpose? We don't need any frills, no GUI, a vanilla kernel, etc. The more basic the better.

+7  A: 

I was able to modify the kernel pretty easily using a minimal Gentoo install. Just install gentoo, follow the installation instructions, then:

$ emerge gentoo-sources
$ emerge emacs
$ cd /usr/src/linux
Tom Ritter
+1 for the commands it takes to get "just enough to edit/compile a kernel", awesome
xyld
+1  A: 

I wouldn't necessarily say any particular distro is geared towards kernel development as such, but if you want a traditional Linux distro that doesn't pile too much custom configuration stuff between you and the kernel, Slackware is a decent choice.

bobince
+2  A: 

On all distributions, you can install the vanilla kernel.org sources instead of the distribution-related kernel packages, which is probably a good idea anyway when you want to do kernel development.

However, you'll be in trouble when you want to use any recent distribution with non-2.6 kernels, because they often build libc6 in a way that it cannot run with 2.4. Additionally, a lot of the guts of hardware management (like udev) require fairly recent kernels.

Apart from that, using Debian gives you a barebone system, and installing your own kernels is a breeze with kernel-package.

Torsten Marek
+4  A: 

archlinux++

but really.. gentoo, slack, and arch are all more-or-less good choices

A: 

My suggestion is to grab the latest kernel. There will be more debugging features inside it than in an older kernel. Also, older kernels would pretty much look just as complex as the most recent to the newbie.

As for the distribution itself, you can't really go wrong. If all you want is to try some custom system calls, then grab whatever mainstream distribution which gives you a nice development environment. Then compile and try your customized glibc without installing it over the distro's.

Eduard - Gabriel Munteanu
+5  A: 

In my operating systems course last semester we used User Mode Linux, the big advantage being that when you hose the system, you can simply kill the process with no risk to the host environment.

Adding/Modifying system calls is tedious but trivial regardless of the kernel you use. However the 2.6 kernel is significantly more massive and complex, so if you're going to be modifying the code in a significant way the older kernels are easier to work with and much better documented. (ie: easier to find books and references)

Happy hacking :)

vinc456
+1 for UML. If only HURD could do this - its a smaller, more immature kernel with more places that can be improved.
new123456
+1  A: 

When choosing a distro for kernel development, remember that it's the kernel you want to hack, not the distro itself. You will therefor want an easy distro that stays out of your way as much as possible. Ubuntu says out of the way fairly nicely.

IANAKH

TokenMacGuy
How in the world did you come to that conclusion? Ubuntu kernels are a PITA to customize.
Robert S. Barnes
+1  A: 

Arch Linux provides a great platform for kernel development that is also very functional. If you learn to use pacman, it will actually make testing your kernel modifications quite easily and provides the sources and tools in a sane manner.

I do think that if you are serious about learning linux and kernel hacking, doing a Linux From Scratch install should be on your list. It's a great distro/book and will let you build the platform for development yourself.

neorab
A: 

A non-linux alternative is Geek OS, but this is very much aimed at the educational level, and is not a practical kernel. It is ultra-simple though.

A: 

well I have found one called "minix" it isn't really a linux distro, but it was made specifically for teaching, but if you can only use a linux distro, then it shouldn't matter, I am pretty sure all distros have the same kernel

noah