|
|
Log in / Subscribe / Register

Driver porting: hello world

Driver porting: hello world

Posted Jul 9, 2006 21:35 UTC (Sun) by dkandula (guest, #37125)
Parent article: Driver porting: hello world

The outputs are given below along with the program. Please help me out.

[root@localhost dp-c]# insmod modul.ko
insmod: error inserting 'modul.ko': -1 Invalid module format
[root@localhost dp-c]#

[root@localhost dp-c]# uname -a
Linux localhost.localdomain 2.6.16.20 #1 Sun Jun 25 23:05:31 EDT 2006 i686
i686 i386 GNU/Linux

The program is given below and the Makefile

obj-m += modul.o

Program

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

MODULE_LICENSE("Dual BSD/GPL");

static int hello_init (void) {
printk("Hello World!\n");
return 0;
}

static void hello_exit(void) {
printk("Bye world\n");
}

module_init(hello_init);
module_exit(hello_exit);

Please help me out. I want to be a device driver. None of the online help
regarding invalid format helps.


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds