If you want to alter some feature of the kernel, then you will have to change the source or configure of linux kernel before compiling it. Here is some steps to do this. I will take linux-4.3 as an example.
Get a distribution of linux kernel source code.
You can get any version from github. Then here's some software you'll have to install.
There is an easy way to do the configure, which is to copy your own configure to the directory.
$cp /boot/config-*(uname -r) .config
$make menuconfig
$sudo make -j 4
$sudo make modules_install -j 4 && sudo make install -j 4
If your host system is 64bit, then it is fine to do just `make menuconfig`, and you will compile a 64bit kernel finally. When you need to compile a 64bit on a 32bit system, then it is necessary to do `make ARCH=x86_64 menuconfig`
Final steps
After the compile and install, we should choose to use the new kernel the next time we boot up.
And then use the following command to look for the kernels present in the boot folder. And update grub file
And then restart your system,and choose which kernel you use before start linux, use uname -r to show which kernel you are using
choose which kernel to boot
This operation is optional, if you can't choose the kernel when you are booting.
First change the file /etc/default/grub, and then uncomment the line GRUB_HIDDEN_TIMEOUT=0
and then update grub, then boot to choose the advanced option.
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_THEME=/boot/grub/themes/Vimix/theme.txt
GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)