As with any package, the kernel source includes documentation explaining what you need to compile a functional kernel. These three aspects of your system are particularly important for building a kernel:
A C compiler ( gcc ). Most distributions put the C compiler in a development tools package. Make sure that your C compiler agrees with the recommendations in the kernel source code, specifically the README file. Kernel developers have not been eager to adopt the latest versions of gcc . Some distributions have a separate compiler named kgcc for compiling the kernel.
Disk space. A new kernel source tree can easily unpack to more than 100MB even before building any object files.
A relatively fast computer with plenty of memory. Otherwise, the compile will take some time.
Your first step is to get the source code.