473,320 Members | 1,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

LINUX Modules

53
I have worked with this program of inserting a module to LINUX Kernel.
/*hellomodule.c*/
#define MODULE

int init_module(void){
printk("<1>Hello Module\n");
return 0;
}

void cleanup_module(void){
printk("<1>Goodbye\n");
}

I compiled the program with command

root# gcc -c hellomodule.c

I got the ouput file as hellomodule.o

And i failed in using the command,

root# insmod ./hellomodule.o

It is showing an error,

The file is not in module format and No module formats.

Whether we have any specific directories to put this modules?
How can i successfully install a module to the kernel?
Im using REDHAT EL - 4
Aug 21 '07 #1
1 948
svlsr2000
181 Expert 100+
I have worked with this program of inserting a module to LINUX Kernel.
/*hellomodule.c*/
#define MODULE

int init_module(void){
printk("<1>Hello Module\n");
return 0;
}

void cleanup_module(void){
printk("<1>Goodbye\n");
}

I compiled the program with command

root# gcc -c hellomodule.c

I got the ouput file as hellomodule.o

And i failed in using the command,

root# insmod ./hellomodule.o

It is showing an error,

The file is not in module format and No module formats.

Whether we have any specific directories to put this modules?
How can i successfully install a module to the kernel?
Im using REDHAT EL - 4
Can you post the kernel version your are using.
Can you post the output of this command
$ Uname -r
If you are using kenel 2.6 this is not the way to build modules.
Have a look at understanding linux device drivers book for more details of building the mofule. In 2.6.x kernels module linkage is done by kernel and it would be something like hello.ko and not hello.o
Aug 21 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: David ROBERT | last post by:
Hello, I need to read data from a MS Access database. The program (reader) is installed on a linux box and is written in python langage. The database is MS Access 2002 installed on a Win XP box...
4
by: Logan | last post by:
Several people asked me for the following HOWTO, so I decided to post it here (though it is still very 'alpha' and might contain many (?) mistakes; didn't test what I wrote, but wrote it - more or...
7
by: Erik Johnson | last post by:
I am trying to upgrade my Python installation. After downloading sources and building Python 2.3.4, I am unable to use the command history editing feature in the interactive interpreter (where the...
7
by: Edward Diener | last post by:
I can install Python 2.4 on the Fedora 3 Linux system, but after I do a number of Linux utilities and commands, like yum, stop working because they were dependent on the Python 2.3 installation....
2
by: RU | last post by:
Hi, I am working on a porting project to port C/C++ application from unixware C++, AT&T Standard components to g++ with STL on Linux. This application has been working properly on...
4
by: Fabian Braennstroem | last post by:
Hi, I am pretty new to python and will use it mainly in combination with scientific packages. I am running ubuntu breezy right now and see that some packages are out of date. Do you have any...
1
by: Sorin Schwimmer | last post by:
Hi All, After a disaster in which I lost my whole harddrive, I decided to install the newest everything that I use. I put the latest Gentoo Linux, with gcc 4.1.1, installed tcl/tk 8.4.14 and...
8
by: Prateek | last post by:
Hello, I'm trying to package my python program into a linux executable using cx_freeze. The goal is that the user should require python on their system. I've managed to make the binaries on...
1
by: kodaliece | last post by:
Hi, I am new to this PHP and linux OS as well. I am trying to install to Apache 2.2.8 and PHP 5.2.5 and do some PHP coding. I've installed Apache and tested it. Its working fine. Then, I...
5
by: John Ladasky | last post by:
Hi folks, Running Python 2.5 on both a Windows XP laptop, and an Ubuntu Linux 7.04 desktop. I've gotten tired of maintaining multiple copies of my personal modules that I use over and over. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.