SIMPLE KERNEL MODULE ERROR

45 views
Skip to first unread message

Kamran

unread,
May 18, 2012, 6:09:40 AM5/18/12
to beagl...@googlegroups.com
Hi , i have got the latest cloud9 image for beaglebone. i need help in building a simple hello world kernel module , make and then inserting and removing the module from the kernel. but the beaglebone angstrom os does not have the needed headers file such .... as modules.h.

can you help me how to go about it or what wrong steps i am taking?

Nilson Custódio Junior

unread,
May 18, 2012, 7:57:06 AM5/18/12
to beagl...@googlegroups.com

Kamran Ali

unread,
May 18, 2012, 2:26:48 PM5/18/12
to beagl...@googlegroups.com
thanks ....i will try and let you know...
--
Regards
Muhammed Kamran Ali



Kamran Ali

unread,
May 18, 2012, 3:02:05 PM5/18/12
to beagl...@googlegroups.com
i did opkg install kernel-headers and opkg install kernel-dev successfully.
NOW,
i am using the following code....simple hello world kernel module

#include <linux/module.h>    
#include <linux/kernel.h>      
#include <linux/init.h>        

static int __init hello_start(void)
{
printk(KERN_INFO "Loading hello module...\n");
printk(KERN_INFO "Hello world\n");
return 0;
}

static void __exit hello_end(void)
{
printk(KERN_INFO "Goodbye Mr.\n");
}

module_init(hello_start);
module_exit(hello_end);

but while make .... it say the module.h and kernel.h are not present.

can you tell me what to do next?
Reply all
Reply to author
Forward
0 new messages