lukeh021471
21st December 2004, 01:01 AM
I am learning how to write device drivers. I came across this tutorial my code is:
#define MODULE
#include <linux/module.h>
int init_module(void)
{
printk("Hello");
return 0;
}
void cleanup_module(void)
{
printk("Goodbye");
}
compiles fine useing #gcc -c hello.c
but when i did a #insmod hello.o, it complain: insmod: error inserting 'hello.o': -1 Invalid module format
so I tried to #modprobe hello.o it complained: FATAL: Module hello.o not found.
when the file is in that directory
I am just a beginner at this but I do need to know how to sucessfully do this since I am takeing a course in hardware apps in C
my OS is Fedora core 3 Linux version 2.6.9-1.667smp
any direction in this would be helpful
:rolleyes:
#define MODULE
#include <linux/module.h>
int init_module(void)
{
printk("Hello");
return 0;
}
void cleanup_module(void)
{
printk("Goodbye");
}
compiles fine useing #gcc -c hello.c
but when i did a #insmod hello.o, it complain: insmod: error inserting 'hello.o': -1 Invalid module format
so I tried to #modprobe hello.o it complained: FATAL: Module hello.o not found.
when the file is in that directory
I am just a beginner at this but I do need to know how to sucessfully do this since I am takeing a course in hardware apps in C
my OS is Fedora core 3 Linux version 2.6.9-1.667smp
any direction in this would be helpful
:rolleyes: