Cecil, Many thanks for your help concerning the nvidia driver issue. For anyone who is interested in the kernel building tutorial please find the tutorial text below. This is the tutorial written by me and has been tested by others and is a pretty much cut and paste method. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Kernel building tutorial for Ubuntu Studio 9.04 build 2.6.29.5-rt21-all-nvk-062109-1 Source code based on Ubuntu Studio Generic with RT patch from kernel.org. __________________________________________________________________________________________________________________________________________________________ 1. Introduction. This tutorial describes in nine steps how to get kernel sources and how to compile, build and install a new real time kernel for Ubuntu Jaunty 9.04. The procedure as desribed below has been tested by the author but gives no guarantee for other pc hardware/software setups, but feel free to try the kernel building steps at your own risk. This tutorial desribes how to obtain, patch and compile Ubuntu Studio generic kernel. Real time patch wil be obtained from kernel.org. IMPORTANT NOTE: Before you start using the tutorial you should take notice of the following issue concerning nvidia proprietary drivers. Users who are using nvidia proprietary drivers should take care because these drivers could lead to building errors. I would like to refer to the comments made by Cecil on web page: https://bugs.launchpad.net/ubuntu/+source/linux-rt/+bug/290498/ She has made the following comment: $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ Using RTD's tutorial I was able to build 2.6.29.5-rt21 for my 9.04 system. (AMD 64 bit). I had one problem and it's doozy. It died in the very last step of the build because I had the nvidia drivers (non free). The kernel would boot and run (but a few things didn't work). It took a lot of hacking around to get rid of *all* of the nvidia artifacts so that syslog/messages/X.log didn't have errors. My advice is that if you have propriety drivers and you want to build a custom kernel, that you remove all the proprietary drivers before building the kernel. Then you can figure out how to get the proprietary drivers re-installed. Actually, my first thought would be to not build a custom kernel if you have proprietary drivers but if you do, you better know your dpkg and looking at the log files in recovery mode. $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 2. Installing tools: ## Become root: sudo -s ## For building the new kernel you need to install development tools first. apt-get install kernel-package ncurses-dev fakeroot bzip2 wget 3. Obtain and install generic kernel sources. ## Obtain the latest Ubuntu Studio generic kernel source for which a real-time patch is available at kernel.org: Go to web site: http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=M;O=D download linux-source-2.6.29_2.6.29-02062905_all.deb (this was the kernel source available at the time of writing this tutorial) Then go to web site http://www.kernel.org/pub/linux/kernel/projects/rt/ download patch-2.6.29.5-rt21.bz2 Both files should now be in your desktop directory. ## Install generic kernel Double click the obtained linux-source-2.6.29_2.6.29-02062905_all.deb from your desktop location. The system will now install the sources. After installation the packed source file linux-source-2.6.29.tar.bz2 can be found in /usr/src. ## Store the sources in your home directory: cd /home/ ( is your own home directory) ## Create a kernel directory in /home/ mkdir kernel ## go to the kernel directory: cd kernel ## Copy source file and patch file to /home//kernel/ cp /home//desktop/patch-2.6.29.5-rt21.bz2 /home//kernel/patch-2.6.29.5-rt21.bz2 cp /usr/src/linux-source-2.6.29.tar.bz2 /home//kernel/linux-source-2.6.29.tar.bz2 ## Check if both files are really there by typing : dir 4. Unpack sources. ## unpack the kernel sources: tar -xjvf linux-source-2.6.29.tar.bz2 Tar will unpack all files and create a linux-source-2.6.29 directory in /home//kernel 5. Patch kernel source for real time use. ## Go to the kernel root directory: cd ~/kernel/linux-source-2.6.29 ## Patch the kernel: bzcat ../patch-2.6.29.5-rt21.bz2 |patch -p1 ## Go back to the kernel directory: cd .. 6. Copy the patched kernel sources to the /usr/src/ work space and create symbolic link: ## Copy the unpacked linux directory to /usr/src/ cp -r linux-source-2.6.29 /usr/src/linux-2.6.29.5 This will take a minute or so.. ## Go to the kernel root directory: cd /usr/src/linux-2.6.29.5 ## Create a symbolic link ¨linux-2.6¨ to the /usr/src/linux-2.6.29.5 directory. This is needed by some scripts used by the make command. ln -s /usr/src/linux-2.6.29.5 /usr/src/linux-2.6 By creating a symbolic link to the kernel you want to work on, it is possible to compile and customize (in this case) 2.6 version kernels. Creating a symbolic link is necessary for the make command. Be aware of the fact that the symbolic link location always points to the kernel location you want to work on. 7. Create kernel config: ## Clean up now by typing: make mrproper ## For creating the RT kernel configuration we are going to use the previous version kernel configuration file from /boot/config-2.6.29.4-rt16-all-nvk-060109-1. This config file originates from config-2.6.28-12-generic the Ubuntu Studio generic kernel in which a few changes were made by the author (see below). (To be able to use the the original config-2.6.28-12-generic you have to install the generic kernel first before proceding with this tutorial) Now copy the configuration file from previous RT kernel to .config by typing: cp /boot/config-2.6.29.4-rt16-all-nvk-060109-1 .config --or in case you want to start from scratch: cp /boot/config-2.6.28-12-generic .config ## Start the menu configurator: make menuconfig It is important to check a few things before you save and exit the menuconfig tool; ## you have to be certain that the processor type and realtime settings are ok so just check/copy the settings below: [*] High resolution timers [*] symmetric multiprocessing support (SMP) ## Enter menu processor type and features: note: I selected -all processors- but in your case you may need another type. see processor type and features settings below: [*] Tickless System (Dynamic Ticks) [*] High Resolution Timer Support [*] Symmetric multi-processing support [ ] Support sparse irq numbering [*] Enable MPS table [ ] Support for big SMP systems with more than 8 CPUs [*] Support for extended (non-PC) x86 platforms [ ] AMD Elan [ ] RDC R-321x SoC [ ] Support non-standard 32-bit SMP architectures [*] Single-depth WCHAN output [*] Paravirtualized guest support ---> [ ] Memtest Processor family (586/K5/5x86/6x86/6x86MX) ---> [*] Generic x86 support [*] PentiumPro memory ordering errata workaround [*] HPET Timer Support (64) Maximum number of CPUs [*] SMT (Hyperthreading) scheduler support [*] Multi-core scheduler support Preemption Mode (Complete Preemption (Real-Time)) ---> -*- Thread Softirqs -*- Thread Hardirqs [ ] Reroute for broken boot IRQs [ ] Machine Check Exception < > Toshiba Laptop support Dell laptop support [*] Enable X86 board specific fixups for reboot /dev/cpu/microcode - microcode support [*] Intel microcode patch loading support [*] AMD microcode patch loading support /dev/cpu/*/msr - Model-specific register support /dev/cpu/*/cpuid - CPU information support < > /sys/kernel/debug/x86/cpu/* - CPU Debug support High Memory Support (4GB) ---> Memory model (Flat Memory) ---> [*] Add LRU list to track non-evictable pages [*] Allocate 3rd-level pagetables from highmem [*] Check for low memory corruption [*] Set the default setting of memory_corruption_check [*] Reserve low 64K of RAM on AMI/Phoenix BIOSen [ ] Math emulation [*] MTRR (Memory Type Range Register) support [*] MTRR cleanup support (0) MTRR cleanup enable value (0-1) (1) MTRR cleanup spare reg num (0-7) [ ] x86 PAT support [*] EFI runtime service support [*] Enable seccomp to safely compute untrusted bytecode [ ] Enable -fstack-protector buffer overflow detection (EXPERIMENTAL) Timer frequency (1000 HZ) ---> [*] kexec system call [*] kernel crash dumps [*] kexec jump (EXPERIMENTAL) (0x100000) Physical address where the kernel is loaded [*] Build a relocatable kernel (EXPERIMENTAL) (0x100000) Alignment value to which kernel should be aligned -*- Support for hot-pluggable CPUs [ ] Compat VDSO support [ ] Built-in kernel command line ## Enter menu kernel hacking: note: Some kernel hacking settings must be unchecked because these will slow down your kernel and are important for system developers: [*] Show timing information on printks [*] Continue building despite compiler warnings [ ] Enable __deprecated logic [ ] Enable __must_check logic (1024) Warn for stack frames larger than (needs gcc 4.4) [*] Magic SysRq key [*] Enable unused/obsolete exported symbols -*- Debug Filesystem [ ] Run 'make headers_check' when building vmlinux [ ] Enable full Section mismatch analysis [ ] Kernel debugging -*- Compile the kernel with frame pointers [*] Latency measuring infrastructure [*] Sysctl checks Tracers ---> [ ] Kernel Function Tracer [ ] Interrupts-off Latency Tracer [ ] Preemption-off Latency Tracer [ ] Sysprof Tracer [ ] Scheduling Latency Tracer [ ] Trace process context switches [ ] Trace various events in the kernel [ ] Trace syscalls [ ] Trace boot initcalls [ ] Trace likely/unlikely profiler [ ] Trace power consumption behavior [ ] Trace max stack [ ] Trace SLAB allocations [*] Support for tracing block io actions [ ] Perform a startup test on ftrace [ ] Memory mapped IO tracing [ ] Remote debugging over FireWire early on boot [ ] Remote debugging over FireWire with firewire-ohci [ ] Enable dynamic printk() call support [ ] Enable debugging of DMA-API usage [ ] Sample kernel code ---> [*] Filter access to /dev/mem [ ] Enable verbose x86 bootup info messages -*- Early printk [ ] Early printk via EHCI debug port [ ] Use 4Kb for kernel stacks instead of 8Kb IO delay type (port 0xed based port-IO delay) ---> [*] Allow gcc to uninline functions marked 'inline' ## After having checked all config settings exit and save. ## Clean up for compiling: make-kpkg clean 8. Building the kernel. ## compile and link by typing: fakeroot make-kpkg --initrd --append-to-version=-all-nvk-062109-1 kernel_image kernel_headers --- OR ---- in case you want to compile on a dual core processor system: CONCURRENCY_LEVEL=2 fakeroot make-kpkg --initrd --append-to-version=-all-nvk-062109-1 kernel_image kernel_headers I attached my own identifier (-all-nvk-060109-1) to the --append-to-version option but feel free to create one of your own liking. The building process could easily take 1 to two hours depending on your processor speed. The outcome of this building process will be two installable files which can be found in the /usr/src/ directory, in my case: linux-headers-2.6.29.5-rt21-all-nvk-062109-1_2.6.29.5-rt21-all-nvk-062109-1-10.00.Custom_i386.deb linux-image-2.6.29.5-rt21-all-nvk-062109-1_2.6.29.5-rt21-all-nvk-062109-1-10.00.Custom_i386.deb 9. Installing the kernel. ## Install the files by typing note: during installation ignore the two ¨hmm¨ warnings you will get. dpkg -i ../linux-headers-2.6.29.5-rt21-all-nvk-062109-1_2.6.29.5-rt21-all-nvk-062109-1-10.00.Custom_i386.deb dpkg -i ../linux-image-2.6.29.5-rt21-all-nvk-062109-1_2.6.29.5-rt21-all-nvk-062109-1-10.00.Custom_i386.deb ## reboot and your new kernel should be up and running. __________________________________________________________________________________________________________________________________________________________ Realtime Dutchman, 06-21-2009