First of all, you need to know a little bit about the kernel. Here's
a link to where you can find all the info you want about a kernel.
What you want to probably do is startout by installing the distro's kernel source. So install a package called "kernel-source" (usually something like that). It'll put the source code in the /usr/src/linux directory (linux is a soft-link to a directory named after the kernel you're installing). If it's kernel 2.6, then you want to do either
or something like that, then change what you need to change.
I won't explain the whole process. But that's where to start. Don't be surprised if you have to compile it a few times before you get it right.
-- the dudeman