问题
I am new bee in Linux kernel programming, trying to work with an old kernel Linux 2.6.32 on x86_64. I want to enable the CONFIG_PREEMPT option in it but can not find information about how can I do it. I can compile a new kernel with my preferred options, but do not know what I need to do in this case. So can anyone please tell me
How can I enable CONFIG_PREEMPT option? Do I need to recompile the kernel again with new menuconfig? In that case which option is responsible for CONFIG_PREEMPT?
I think it's trivial for anyone who worked with this before, so please give me your valuable help!
回答1:
You can use make menuconfig
to enable CONFIG_PREEMPT for the kernel; just select it from the menu options. To verify that it's enabled, check the .config
file generated by make menuconfig
for the following line:
CONFIG_PREEMPT=y
You can also make the modification by hand if you prefer (make menuconfig
is simply a GUI to create the .config
file).
Once everything is configured, recompile the kernel with the usual:
make && make modules_install && make install
回答2:
If you want to add fully optimized kernel, you need to add a patch, which can be downloaded from the main website here
If you don't know how to add a patch, just go through this thread.
回答3:
One can often install a corresponding package, such as the linux-image-4.19.0-12-rt-amd64-unsigned
on Debian
apt install linux-image-4.19.0-12-rt-amd64-unsigned
grep PREEMPT /boot/config-4.19.0-12-rt-amd64
sync && reboot
grep PREEMPT /proc/version
Linux version 4.19.0-12-rt-amd64 (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP PREEMPT RT Debian 4.19.152-1 (2020-10-18)
来源:https://stackoverflow.com/questions/16740754/how-to-enable-config-preempt-option-in-linux-kernel