Cannot load 2.4.X module
vercingetorix52_at_yahoo.com
Date: 11/18/05
- Next message: lee_t_at_bigfoot.com: "starting embedded linux debugging"
- Previous message: Morgan Venable: "Embedded Linux Firmware/Driver Wiz?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 18 Nov 2005 09:19:44 -0800
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...
- Next message: lee_t_at_bigfoot.com: "starting embedded linux debugging"
- Previous message: Morgan Venable: "Embedded Linux Firmware/Driver Wiz?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|