my problem is, I am trying to build a driver into the kernel. I decided to test my code with a simple Hello World program. The code looks like:
#include <linux/kernel.h>
#include <linux/err.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/printk.h>
int __init my_init(void)
{
printk(KERN_ALERT "Hello world\n");
return 0;
}
device_initcall(my_init);
//subsys_initcall(my_init);
Also, cat /proc/sys/kernel/printk shows 7 4 1 7 From the .config file, I find "CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4"
I am making the file using obj-y += in the Makefile. I find that 'make' can build the module, but no printk outputs are appearing in dmesg or under /var/log/ after boot.
I am wondering if the driver is not being built at all into the kernel. Is there any way of checking that?
Thanks, D.