This is the first in a series of articles aimed at the beginning kernel programmer, designed to lead the kernel newbie through the basics of writing and compiling their first kernel module, and getting increasingly sophisticated from there.
I need to debug an existing kernel driver (added to the kernel with menuconfig before kernel compilation). I intend to use printk statements to see what happens there, but in order to do that I need to remove the module from the kernel, rebuild it as a loadable module and load it. Is this possible and how? Do I need to rebuild the whole kernel without this module and then install it?
I'm trying to find the kernel address space where my loadable kernel module is relocated by insmod.
I came to know that by using the -m, -O switches while insmod'ing the module, we can only see the symbol table and the executable's sections' addresses from the view-point of the module and not their relocated addresses, as that process of relocation is carried out when we do an insmod.
I want to add some debug info or printf in the random.c in order to look deeply into the Linux random number generator. The entropy in /dev/random and /dev/urandom are both generated by random.c. My questions are:
1. Where I can find the random.c file in Linux 2.6.32?
2. What is the best way to add my modification of random source code into the kernel?
I know how to make loadable kernel modules in Linux.
But i want that loadable kernel module to be a part of the kernel , and after booting that driver should automatically load, like most of the other general driver.
I've attempted to install drivers for an FPGA device, but require that I remove the usbserial module. This happens to be impossible because usbserial is a built-in module. It was suggested that I compile a new kernel to make usbserial dynamically loadable and unloadable.
I'm now trying to compile a custom kernel w/ Fedora.
I've built a kernel with loadable module support for various reasons, one of them the possibility to compile modules and load them without rebooting. This is supposed to be useful when I need a module that I had not enabled in the kernel config.
Now, with drivers like nouveau, it's as easy as going to the source directory, and running make M=drivers/gpu/drm/nouveau.
I am working on a platform where loadable module is not an option(for security reason). When the kernel boots, if I look into /dev, I assume it shows all the device that are compiled as part of the kernel. My question is, how to I add a device to the kernel? For example, gpio driver source code is available in the /linux/driver/gpio directly.