Module driver "hello" for beagleboard

Hi all.
I am beginner with beagleboard.
I trying write driver “hello” for beagleboard but it not load in the kernel when i run command:
root@linaro:/lib/modules/ insmod ./hello.ko
insmod: error inserting ‘./hello.ko’: -1 Invalid module format
I run command:
root@linaro:~# modprobe hello
FATAL: Module hello not found.
I have ALIP running on beagleboard, i use source code linux
Help me solve this problem.
Thank all.
Best Regards.
Hien Nguyen

Be in the folder where hello.ko is present. Then try insmod ./hello.ko

For using modprobe first do depmod, then I think u can use modprobe for your local module.

I used modprobe hello but it not success.

2012/10/16 @ksonly@ks <>

Yaa… modprobe will not work directly. You first try insmod ./hello.ko

For modprobe you need to run command: depmod

Then modprobe can work.




to be sure that you have cross compiled module for hello.ko

I used cross_compile:arm-linux-gnueabi- to compile modules driver

  • Source code hello.c:
    #include <linux/module.h> // modules
    #include <linux/kernel.h> // KERN_INFO
    #include <linux/init.h> // macros

static int __init hello_start(void)

printk(KERN_INFO “***********************************\n”);

printk(KERN_INFO “Loading my first kernel driver…\n”);

printk(KERN_INFO “Welcome to the hello driver\n”);

printk(KERN_INFO “***********************************\n”);

return 0;


static void __exit hello_end(void)

printk(KERN_INFO “***********************************\n”);

printk(KERN_INFO “Unloading hello…\n”);

printk(KERN_INFO “***********************************\n”);


//Defining the function that will be called when the module is loaded

//Defining the function that will be called when the module is unloaded

  • Makefile:

obj-m := hello.o

Help me solve it.Thank you very much