Do you have a question? Post it now! No Registration Necessary
- vercingetorix52
November 18, 2005, 5:19 pm

It's been a while since I've done this so it's possible I'm doing
something silly, but I've been Googling for hours and haven't yet found
a solution.
The target system is an x86 PC104 running a stripped-down RedHat.
Here's what I get for version info on the PC104...
bash-2.05# uname -a
Linux localhost 2.4.18 #1 Wed Jun 19 14:33:06 MDT 2002 i486 unknown
The development machine is running Debian Etch. I downloaded the
2.4.18 linux kernel sources to the development computer and extracted
them in /usr/src/. Then I threw together the following bare-bones
kernel module called mymodule.c...
-----------------------------------------------------------------------------------------------------
#ifndef __KERNEL__
#define __KERNEL__
#define MODULE
#include <linux/kernel.h>
#include <linux/module.h>
int init_module(void)
{
printk("<1>Hello, World\n");
return 0;
}
void cleanup_module(void)
{
printk("<1>Goodbye!\n");
}
#endif
-----------------------------------------------------------------------------------------------------
This code compiles without complaint using the following command...
gcc -Wall -O2 -D__KERNEL__ -DMODULE -I/usr/src/linux/include -c
mymodule.c
...but when I try to load this on the target system, I get this...
bash-2.05# /sbin/insmod mymodule.o
mymodule.o: couldn't find the kernel version the module was compiled
for
bash-2.05# /sbin/insmod -f mymodule.o
mymodule.o: couldn't find the kernel version the module was compiled
for
Can anyone tell me what I'm doing wrong? Thanks in advance...
something silly, but I've been Googling for hours and haven't yet found
a solution.
The target system is an x86 PC104 running a stripped-down RedHat.
Here's what I get for version info on the PC104...
bash-2.05# uname -a
Linux localhost 2.4.18 #1 Wed Jun 19 14:33:06 MDT 2002 i486 unknown
The development machine is running Debian Etch. I downloaded the
2.4.18 linux kernel sources to the development computer and extracted
them in /usr/src/. Then I threw together the following bare-bones
kernel module called mymodule.c...
-----------------------------------------------------------------------------------------------------
#ifndef __KERNEL__
#define __KERNEL__
#define MODULE
#include <linux/kernel.h>
#include <linux/module.h>
int init_module(void)
{
printk("<1>Hello, World\n");
return 0;
}
void cleanup_module(void)
{
printk("<1>Goodbye!\n");
}
#endif
-----------------------------------------------------------------------------------------------------
This code compiles without complaint using the following command...
gcc -Wall -O2 -D__KERNEL__ -DMODULE -I/usr/src/linux/include -c
mymodule.c
...but when I try to load this on the target system, I get this...
bash-2.05# /sbin/insmod mymodule.o
mymodule.o: couldn't find the kernel version the module was compiled
for
bash-2.05# /sbin/insmod -f mymodule.o
mymodule.o: couldn't find the kernel version the module was compiled
for
Can anyone tell me what I'm doing wrong? Thanks in advance...
Site Timeline
- » starting embedded linux debugging
- — Next thread in » Embedded Linux
-
- » Embedded Linux Firmware/Driver Wiz?
- — Previous thread in » Embedded Linux
-
- » Crosscompiling for ARM: reloc type R_ARM_ABS32 is not supported for PIC - ...
- — Newest thread in » Embedded Linux
-
- » VHDL i wyĆwietlacze 7-seg.
- — The site's Newest Thread. Posted in » Electronics (Polish)
-
- » homemade or low cost circuit board/ battery box shield?
- — The site's Last Updated Thread. Posted in » Electronics Repair
-