As a first step, let's see how we can add some simple code to our kernel sources. In this recipe, we'll simply add silly code just to demonstrate how easy it is, but further into this book, we're going to add even more complex code.
Adding custom code to the sources
Getting ready
Since we need to add our code to the Linux sources, let's go into the directory where all sources are located. On my system, I use the Projects/ldddc/linux/ path located in my home directory. Here is what the kernel sources look like:
$ cd Projects/ldddc/linux/
$ ls
arch Documentation Kbuild mm scripts virt
block drivers Kconfig modules.builtin security vmlinux
built-in.a firmware...