Notes /
RTPatchInstalling a Kernel with the RT PatchApril 22, 2014 (NB: appears to be missing the important bit of creating the Installing new kernels has gone from Extremely Intimidating to routine over the course of TAing an OS course, working with a custom OS, and now my current research. It is, however, still a bit of a pain, especially if you need to muck with the configuration. This post outlines how to install a kernel with the RT Patch, and was tested on Ubuntu 12.04. The Setup: get Kernel, Patch, and ToolsThe kernel source you select should have an RT Patch available for it. So, first check your current kernel: My kernel was 3.2.0-60, so I had to pick a new kernel. I went with 3.2.55 from https://www.kernel.org/pub/linux/kernel/v3.x/ (you will need to download the source for the kernel regardless; picking one that is the same or close to your current will make configuration much easier). The corresponding patch I downloaded from https://www.kernel.org/pub/linux/kernel/projects/rt/3.2/ Unzip and de-tar (patch only needs de-zipping): Finally, to install needed tools: Patch and Build KernelGo into patch source directory and patch: If you haven't done this before:
See Update at bottom for the VMA / Ancestor fix If you don't do a For configuration, I selected 5 for the level of RT (fully premptable kernel). The rest I just used the defaults. There were not too many new configuration options since the kernel I selected was similar to my current. And everything seems to work just fine. The building takes a long time, so you should probably consider using the Install Kernel, Config Grub
To make sure Grub shows the splash screen, edit Test / Verify KernelRestart and select the RT kernel on the grub splash screen. Verify the kernel running by checking: Configuration for DebuggingThere are some useful configuration options that can help with figuring out the source of kernel latency. However, the tracing mechanisms increase latency, so should likely only be used in a debugging version of the kernel. While doing a
Install kernel headersIf you are doing any system level programming you probably want to have the correct headers included. This is only really a problem if your original kernel (headers) don't have a feature that your new kernel does. For example, I upgraded from 3.2 to 3.14, and sub-reapers were introduced in 3.4. The command looks something like this (source):
February 20, 2016 Update: fix for Anon_VMA problemThere is a patch for the Anon_VMA problem, described and explored in Kmemleak. Download the kernel source you want as described above and apply the rt-preempt patch. Then edit mm/mmap.c and mm/rmap.c as described here: Attach:anon_vma_length_patch.txt. Make sure to update the EXTRAVERSION variable in the top level Makefile (and remember that '_'s are not allowed in it). Resources (may or not be useful)Most useful:
Also helpful: |