| Rev | Author | # | Line |
|---|---|---|---|
| 11 | IanMcDonald | 1 | !! Tools for LinuxKernel development |
| 8 | IanMcDonald | 2 | |
| 12 | AristotlePagaltzis | 3 | * [Ostra] |
| 4 | * [Sparse] | ||
| 5 | * [Git]; see See KernelDevelopmentWithGit | ||
| 15 | IanMcDonald | 6 | * [OProfile] |
| 8 | IanMcDonald | 7 | |
| 8 | !! Resources | ||
| 10 | IanMcDonald | 9 | |
| 12 | AristotlePagaltzis | 10 | * KernelDevelopmentDebugging |
| 11 | * [Linux kernel source cross reference | http://lxr.linux.no/] | ||
| 12 | * [Hacking the Linux 2.6 kernel, Part 1: Getting ready | http://www-128.ibm.com/developerworks/linux/edu/l-dw-linux-kernelhack1-i.html] | ||
| 13 | * [Hacking the Linux 2.6 kernel, Part 2: Making your first hack | http://www-128.ibm.com/developerworks/linux/edu/l-dw-linux-kernelhack2-i.html] | ||
| 17 | IanMcDonald | 14 | * [Linux Kernel in a Nutshell | http://www.kroah.com/lkn/] |
| 8 | IanMcDonald | 15 | |
| 16 | !! Some notes | ||
| 17 | |||
| 16 | IanMcDonald | 18 | You can use [DistCC] or [ccache | http://ccache.samba.org/] (or both) to speed up compilation. |
| 19 | |||
| 20 | The main trick is to only make ONE target on the command line. i.e. don't try and do this <tt>make -j6 CC=distcc all modules_install</tt> or else the build will get screwed up and the whole thing will get remade each time. | ||
| 21 | |||
| 22 | Instead do this: | ||
| 23 | <verbatim> | ||
| 24 | make -j6 CC=distcc all | ||
| 25 | make modules_install INSTALL_MOD_PATH=~/tmp | ||
| 26 | </verbatim> | ||
| 18 | IanMcDonald | 27 | |
| 28 | To update the .config file with questions for new options do a <tt>make oldconfig</tt> | ||
| 29 | |||
| 30 | To output build files to another directory (so you don't mix source and object code) do <tt>make O=outputdir all</tt> | ||
| 31 | |||
| 32 | To make files in just one source code directory do <tt>make dir</tt>. To make the modules in a directory and link them do <tt>make M=dir</tt>. Remember to put a trailing slash after the directory name. | ||
| 33 | |||
| 34 | NB The above two may require you to have built your config etc first. | ||
| 35 | |||
| 19 | IanMcDonald | 36 | To enable extra error checks when compiling do <tt>make EXTRA_CFLAGS=-W</tt>. |
| 13 | IanMcDonald | 37 | |
| 15 | IanMcDonald | 38 | A script to copy a new [LinuxKernel] to remote machines:'''' |
| 12 | AristotlePagaltzis | 39 | |
| 40 | <verbatim> | ||
| 15 | IanMcDonald | 41 | #! /bin/bash |
| 42 | # syntax m machine_num directory version | ||
| 43 | H=/home/ian | ||
| 44 | SRC=$H/linuxsrc/$2 | ||
| 45 | VER=$3 | ||
| 46 | rm $H/tmp/lib/modules/$VER/build | ||
| 47 | rm $H/tmp/lib/modules/$VER/source | ||
| 48 | rsync $SRC/System.map root@jandi$1:/boot/System.map-$VER | ||
| 49 | rsync $SRC/arch/i386/boot/bzImage root@jandi$1:/boot/vmlinuz-$VER | ||
| 50 | rsync $SRC/vmlinux root@jandi$1:/boot/vmlinux-$VER | ||
| 51 | rsync -av $H/tmp/lib/modules/$VER root@jandi$1:/lib/modules | ||
| 12 | AristotlePagaltzis | 52 | </verbatim> |
| 14 | IanMcDonald | 53 | |
| 18 | IanMcDonald | 54 | It has also been suggested to use kgdb with qemu and/or kgdboe to help with debugging. |
| 9 | IanMcDonald | 55 | |
| 56 | ---- | ||
| 8 | IanMcDonald | 57 | CategoryKernel |
lib/blame.php:177: Warning: Invalid argument supplied for foreach() (...repeated 3 times)