As for the strange looking Makefile (inside the directory where I have my module code), the Makefile earlier looked like it normally does:obj−m += hello−1.o all:... [by aijazbaig1]
on 07/03/2012 – Made popular on 07/03/2012
I have been trying to figure out how to compile a kernel module. I started with http://www.tldp.org/LDP/lkmpg/2.6/lkmpg.pdf to learn. I then found Compiling a kernel module, header problems, makefile problems to get my makefile going. After running make.
I am used to using -std=c99 to enable c99 features when compiling application code.
Recently I have been following some basic kernel module examples, and added ccflags-y := -std=c99 to the makefile. However this resulted in 17K lines of errors when I tried to make. gnu99 works perfectly.
What is the difference between gnu99 and c99 that kernel code relies on?
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 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?